createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 Info<< "Reading thermophysical properties\n" << endl;
4 autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
5 rhoReactionThermo& thermo = pThermo();
6 thermo.validate(args.executable(), "h", "e");
7 
8 SLGThermo slgThermo(mesh, thermo);
9 
10 basicSpecieMixture& composition = thermo.composition();
11 PtrList<volScalarField>& Y = composition.Y();
12 
13 const word inertSpecie(thermo.get<word>("inertSpecie"));
14 if
15 (
16  !composition.species().found(inertSpecie)
17  && composition.species().size() > 0
18 )
19 {
21  << "Inert specie " << inertSpecie << " not found in available species "
22  << composition.species()
23  << exit(FatalIOError);
24 }
25 
26 Info<< "Creating field rho\n" << endl;
28 (
29  IOobject
30  (
31  "rho",
32  runTime.timeName(),
33  mesh,
34  IOobject::NO_READ,
35  IOobject::AUTO_WRITE
36  ),
37  thermo.rho()
38 );
39 
40 volScalarField& p = thermo.p();
41 
42 Info<< "\nReading field U\n" << endl;
44 (
45  IOobject
46  (
47  "U",
48  runTime.timeName(),
49  mesh,
50  IOobject::MUST_READ,
51  IOobject::AUTO_WRITE
52  ),
53  mesh
54 );
55 
56 #include "compressibleCreatePhi.H"
57 
58 Info<< "Creating turbulence model\n" << endl;
59 autoPtr<compressible::turbulenceModel> turbulence
60 (
62  (
63  rho,
64  U,
65  phi,
66  thermo
67  )
68 );
69 
70 Info<< "Creating combustion model\n" << endl;
71 autoPtr<CombustionModel<rhoReactionThermo>> combustion
72 (
74 );
75 
76 #include "readGravitationalAcceleration.H"
77 #include "readhRef.H"
78 #include "gh.H"
79 
80 
82 (
83  IOobject
84  (
85  "p_rgh",
86  runTime.timeName(),
87  mesh,
88  IOobject::MUST_READ,
89  IOobject::AUTO_WRITE
90  ),
91  mesh
92 );
93 
94 // Force p_rgh to be consistent with p
95 p_rgh = p - rho*gh;
96 
97 pressureControl pressureControl(p, rho, pimple.dict(), false);
98 
99 mesh.setFluxRequired(p_rgh.name());
100 
101 Info<< "Creating multi-variate interpolation scheme\n" << endl;
102 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
103 
105 {
106  fields.add(Y[i]);
107 }
108 fields.add(thermo.he());
109 
111 (
112  IOobject
113  (
114  "Qdot",
115  runTime.timeName(),
116  mesh,
117  IOobject::READ_IF_PRESENT,
118  IOobject::AUTO_WRITE
119  ),
120  mesh,
122 );
123 
124 #include "createDpdt.H"
125 
126 #include "createK.H"
127 
128 #include "createMRF.H"
129 #include "createRadiationModel.H"
130 #include "createClouds.H"
131 #include "createSurfaceFilmModel.H"
132 #include "createFvOptions.H"
Info<< "Reading thermophysical properties\"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))
volScalarField Qdot(IOobject("Qdot", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero))
const word inertSpecie(thermo.get< word >("inertSpecie"))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
SLGThermo slgThermo(mesh, thermo)
forAll(U.boundaryField(), patchi)
Definition: createFields.H:52
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
p_rgh
Definition: createFields.H:95
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
psiReactionThermo & thermo
Definition: createFields.H:28
rho
Definition: createFields.H:81
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
const word & executable() const noexcept
Name of executable without the path.
Definition: argListI.H:44
pimpleControl & pimple
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:618
const dimensionSet dimEnergy
volScalarField & p
Definition: createFields.H:23
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
Info<< "Creating combustion model\"<< endl;autoPtr< CombustionModel< psiReactionThermo > > combustion(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
PtrList< volScalarField > & Y
Definition: createFields.H:9
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const volScalarField & gh
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::argList args(argc, argv)
pressureControl pressureControl(p, rho, pimple.dict(), false)
basicSpecieMixture & composition
Definition: createFields.H:8
Creates and initialises the face-flux field phi.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127