createTurbulenceFields.C
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 #include "fvCFD.H"
00039 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
00040 #include "RASModel.H"
00041
00042
00043
00044 int main(int argc, char *argv[])
00045 {
00046 timeSelector::addOptions();
00047
00048 #include "setRootCase.H"
00049 #include "createTime.H"
00050
00051 instantList timeDirs = timeSelector::select0(runTime, args);
00052
00053 #include "createMesh.H"
00054 #include "createFields.H"
00055
00056 forAll(timeDirs, timeI)
00057 {
00058 runTime.setTime(timeDirs[timeI], timeI);
00059
00060 Info<< "Time = " << runTime.timeName() << endl;
00061
00062
00063
00064 Info<< "\nRetrieving field k from turbulence model" << endl;
00065 const volScalarField k = RASModel->k();
00066
00067 Info<< "\nRetrieving field epsilon from turbulence model" << endl;
00068 const volScalarField epsilon = RASModel->epsilon();
00069
00070 Info<< "\nRetrieving field R from turbulence model" << endl;
00071 const volSymmTensorField R = RASModel->R();
00072
00073
00074
00075 if (!IOobject("k", runTime.timeName(), mesh).headerOk())
00076 {
00077 Info<< "\nWriting turbulence field k" << endl;
00078 k.write();
00079 }
00080 else
00081 {
00082 Info<< "\nTurbulence k field already exists" << endl;
00083 }
00084
00085 if (!IOobject("epsilon", runTime.timeName(), mesh).headerOk())
00086 {
00087 Info<< "\nWriting turbulence field epsilon" << endl;
00088 epsilon.write();
00089 }
00090 else
00091 {
00092 Info<< "\nTurbulence epsilon field already exists" << endl;
00093 }
00094
00095 if (!IOobject("R", runTime.timeName(), mesh).headerOk())
00096 {
00097 Info<< "\nWriting turbulence field R" << endl;
00098 R.write();
00099 }
00100 else
00101 {
00102 Info<< "\nTurbulence R field already exists" << endl;
00103 }
00104
00105 if (!IOobject("omega", runTime.timeName(), mesh).headerOk())
00106 {
00107 const scalar Cmu = 0.09;
00108
00109 Info<< "creating omega" << endl;
00110 volScalarField omega
00111 (
00112 IOobject
00113 (
00114 "omega",
00115 runTime.timeName(),
00116 mesh
00117 ),
00118 epsilon/(Cmu*k),
00119 epsilon.boundaryField().types()
00120 );
00121 Info<< "\nWriting turbulence field omega" << endl;
00122 omega.write();
00123 }
00124 else
00125 {
00126 Info<< "\nTurbulence omega field already exists" << endl;
00127 }
00128 }
00129
00130 Info<< "\nEnd\n" << endl;
00131
00132 return 0;
00133 }
00134
00135
00136
00137
Copyright © 2000-2009 OpenCFD Ltd