1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 CreateTurbulenceFields
29 Creates a full set of turbulence fields.
31 - Currently does not output nut and nuTilda
36 \*---------------------------------------------------------------------------*/
39 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 int main(int argc, char *argv[])
46 timeSelector::addOptions();
48 #include "setRootCase.H"
49 #include "createTime.H"
51 instantList timeDirs = timeSelector::select0(runTime, args);
53 #include "createMesh.H"
54 #include "createFields.H"
56 forAll(timeDirs, timeI)
58 runTime.setTime(timeDirs[timeI], timeI);
60 Info<< "Time = " << runTime.timeName() << endl;
62 // Cache the turbulence fields
64 Info<< "\nRetrieving field k from turbulence model" << endl;
65 const volScalarField k = RASModel->k();
67 Info<< "\nRetrieving field epsilon from turbulence model" << endl;
68 const volScalarField epsilon = RASModel->epsilon();
70 Info<< "\nRetrieving field R from turbulence model" << endl;
71 const volSymmTensorField R = RASModel->R();
73 // Check availability of tubulence fields
75 if (!IOobject("k", runTime.timeName(), mesh).headerOk())
77 Info<< "\nWriting turbulence field k" << endl;
82 Info<< "\nTurbulence k field already exists" << endl;
85 if (!IOobject("epsilon", runTime.timeName(), mesh).headerOk())
87 Info<< "\nWriting turbulence field epsilon" << endl;
92 Info<< "\nTurbulence epsilon field already exists" << endl;
95 if (!IOobject("R", runTime.timeName(), mesh).headerOk())
97 Info<< "\nWriting turbulence field R" << endl;
102 Info<< "\nTurbulence R field already exists" << endl;
105 if (!IOobject("omega", runTime.timeName(), mesh).headerOk())
107 const scalar Cmu = 0.09;
109 Info<< "creating omega" << endl;
119 epsilon.boundaryField().types()
121 Info<< "\nWriting turbulence field omega" << endl;
126 Info<< "\nTurbulence omega field already exists" << endl;
130 Info<< "\nEnd\n" << endl;
136 // ************************************************************************* //