Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #include <finiteVolume/fvCFD.H>
00069 #include <incompressibleTransportModels/singlePhaseTransportModel.H>
00070 #include <incompressibleRASModels/RASModel.H>
00071
00072
00073
00074 int main(int argc, char *argv[])
00075 {
00076 timeSelector::addOptions();
00077
00078 #include <OpenFOAM/setRootCase.H>
00079 #include <OpenFOAM/createTime.H>
00080
00081 instantList timeDirs = timeSelector::select0(runTime, args);
00082
00083 #include <OpenFOAM/createMesh.H>
00084 #include "createFields.H"
00085
00086 forAll(timeDirs, timeI)
00087 {
00088 runTime.setTime(timeDirs[timeI], timeI);
00089
00090 Info<< "Time = " << runTime.timeName() << endl;
00091
00092
00093
00094 Info<< "\nRetrieving field k from turbulence model" << endl;
00095 const volScalarField k = RASModel->k();
00096
00097 Info<< "\nRetrieving field epsilon from turbulence model" << endl;
00098 const volScalarField epsilon = RASModel->epsilon();
00099
00100 Info<< "\nRetrieving field R from turbulence model" << endl;
00101 const volSymmTensorField R = RASModel->R();
00102
00103
00104
00105 if (!IOobject("k", runTime.timeName(), mesh).headerOk())
00106 {
00107 Info<< "\nWriting turbulence field k" << endl;
00108 k.write();
00109 }
00110 else
00111 {
00112 Info<< "\nTurbulence k field already exists" << endl;
00113 }
00114
00115 if (!IOobject("epsilon", runTime.timeName(), mesh).headerOk())
00116 {
00117 Info<< "\nWriting turbulence field epsilon" << endl;
00118 epsilon.write();
00119 }
00120 else
00121 {
00122 Info<< "\nTurbulence epsilon field already exists" << endl;
00123 }
00124
00125 if (!IOobject("R", runTime.timeName(), mesh).headerOk())
00126 {
00127 Info<< "\nWriting turbulence field R" << endl;
00128 R.write();
00129 }
00130 else
00131 {
00132 Info<< "\nTurbulence R field already exists" << endl;
00133 }
00134
00135 if (!IOobject("omega", runTime.timeName(), mesh).headerOk())
00136 {
00137 const scalar Cmu = 0.09;
00138
00139 Info<< "creating omega" << endl;
00140 volScalarField omega
00141 (
00142 IOobject
00143 (
00144 "omega",
00145 runTime.timeName(),
00146 mesh
00147 ),
00148 epsilon/(Cmu*k),
00149 epsilon.boundaryField().types()
00150 );
00151 Info<< "\nWriting turbulence field omega" << endl;
00152 omega.write();
00153 }
00154 else
00155 {
00156 Info<< "\nTurbulence omega field already exists" << endl;
00157 }
00158 }
00159
00160 Info<< "\nEnd\n" << endl;
00161
00162 return 0;
00163 }
00164
00165
00166