createFields.H
Go to the documentation of this file.
1 Info<< "Creating combustion model\n" << endl;
2 
3 autoPtr<combustionModels::psiCombustionModel> combustion
4 (
6  (
7  mesh
8  )
9 );
10 
11 Info<< "Reading thermophysical properties\n" << endl;
12 
13 psiReactionThermo& thermo = combustion->thermo();
14 thermo.validate(args.executable(), "h", "e");
15 
16 SLGThermo slgThermo(mesh, thermo);
17 
18 basicMultiComponentMixture& composition = thermo.composition();
19 PtrList<volScalarField>& Y = composition.Y();
20 
21 const word inertSpecie(thermo.lookup("inertSpecie"));
22 if (!composition.species().found(inertSpecie))
23 {
25  << "Inert specie " << inertSpecie << " not found in available species "
26  << composition.species()
27  << exit(FatalIOError);
28 }
29 
30 Info<< "Creating field rho\n" << endl;
32 (
33  IOobject
34  (
35  "rho",
36  runTime.timeName(),
37  mesh,
38  IOobject::NO_READ,
39  IOobject::AUTO_WRITE
40  ),
41  thermo.rho()
42 );
43 
44 volScalarField& p = thermo.p();
45 
46 Info<< "\nReading field U\n" << endl;
48 (
49  IOobject
50  (
51  "U",
52  runTime.timeName(),
53  mesh,
54  IOobject::MUST_READ,
55  IOobject::AUTO_WRITE
56  ),
57  mesh
58 );
59 
60 #include "compressibleCreatePhi.H"
61 
62 #include "createMRF.H"
63 
64 
65 Info<< "Creating turbulence model\n" << endl;
66 autoPtr<compressible::turbulenceModel> turbulence
67 (
69  (
70  rho,
71  U,
72  phi,
73  thermo
74  )
75 );
76 
77 // Set the turbulence into the combustion model
78 combustion->setTurbulence(turbulence());
79 
80 
81 #include "readGravitationalAcceleration.H"
82 #include "readhRef.H"
83 #include "gh.H"
84 #include "readpRef.H"
85 
87 (
88  IOobject
89  (
90  "p_rgh",
91  runTime.timeName(),
92  mesh,
93  IOobject::MUST_READ,
94  IOobject::AUTO_WRITE
95  ),
96  mesh
97 );
98 
99 mesh.setFluxRequired(p_rgh.name());
100 
101 #include "phrghEqn.H"
102 
103 
104 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
105 
106 forAll(Y, i)
107 {
108  fields.add(Y[i]);
109 }
110 fields.add(thermo.he());
111 
112 IOdictionary additionalControlsDict
113 (
114  IOobject
115  (
116  "additionalControls",
117  runTime.constant(),
118  mesh,
119  IOobject::MUST_READ_IF_MODIFIED,
120  IOobject::NO_WRITE
121  )
122 );
123 
124 Switch solvePrimaryRegion
125 (
126  additionalControlsDict.lookup("solvePrimaryRegion")
127 );
128 
130 (
131  additionalControlsDict.lookupOrDefault<bool>("solvePyrolysisRegion", true)
132 );
133 
135 (
136  IOobject
137  (
138  "Qdot",
139  runTime.timeName(),
140  mesh,
141  IOobject::READ_IF_PRESENT,
142  IOobject::AUTO_WRITE
143  ),
144  mesh,
146 );
147 
148 
149 Info<< "Creating field dpdt\n" << endl;
151 (
152  IOobject
153  (
154  "dpdt",
155  runTime.timeName(),
156  mesh
157  ),
158  mesh,
159  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
160 );
161 
162 Info<< "Creating field kinetic energy K\n" << endl;
163 volScalarField K("K", 0.5*magSqr(U));
164 
165 #include "createClouds.H"
166 #include "createSurfaceFilmModel.H"
167 #include "createPyrolysisModel.H"
168 #include "createRadiationModel.H"
Switch solvePrimaryRegion(additionalControlsDict.lookup("solvePrimaryRegion"))
surfaceScalarField & phi
forAll(Y, i)
Definition: createFields.H:106
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
Info<< "Creating combustion model\"<< endl;autoPtr< combustionModels::psiCombustionModel > combustion(combustionModels::psiCombustionModel::New(mesh))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
SLGThermo slgThermo(mesh, thermo)
Switch solvePyrolysisRegion(additionalControlsDict.lookupOrDefault< bool >("solvePyrolysisRegion", true))
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
CGAL::Exact_predicates_exact_constructions_kernel K
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:104
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
rho
Definition: createFields.H:81
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
volScalarField & dpdt
dimensioned< scalar > magSqr(const dimensioned< Type > &)
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:325
const dimensionSet dimEnergy
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
messageStream Info
Foam::argList args(argc, argv)
const word inertSpecie(thermo.lookup("inertSpecie"))
Creates and initialises the face-flux field phi.
volScalarField Qdot(IOobject("Qdot", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0))
IOdictionary additionalControlsDict(IOobject("additionalControls", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE))
IOerror FatalIOError