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 
8 psiReactionThermo& thermo = combustion->thermo();
9 thermo.validate(args.executable(), "h", "e");
10 
11 SLGThermo slgThermo(mesh, thermo);
12 
13 basicSpecieMixture& composition = thermo.composition();
14 PtrList<volScalarField>& Y = composition.Y();
15 
16 const word inertSpecie(thermo.lookup("inertSpecie"));
17 if (!composition.species().found(inertSpecie))
18 {
20  << "Inert specie " << inertSpecie << " not found in available species "
21  << composition.species()
22  << exit(FatalIOError);
23 }
24 
25 Info<< "Creating field rho\n" << endl;
27 (
28  IOobject
29  (
30  "rho",
31  runTime.timeName(),
32  mesh,
33  IOobject::NO_READ,
34  IOobject::AUTO_WRITE
35  ),
36  thermo.rho()
37 );
38 
39 volScalarField& p = thermo.p();
40 
41 Info<< "\nReading field U\n" << endl;
43 (
44  IOobject
45  (
46  "U",
47  runTime.timeName(),
48  mesh,
49  IOobject::MUST_READ,
50  IOobject::AUTO_WRITE
51  ),
52  mesh
53 );
54 
55 #include "compressibleCreatePhi.H"
56 
57 Info<< "Creating turbulence model\n" << endl;
58 autoPtr<compressible::turbulenceModel> turbulence
59 (
61  (
62  rho,
63  U,
64  phi,
65  thermo
66  )
67 );
68 
69 // Set the turbulence into the combustion model
70 combustion->setTurbulence(turbulence());
71 
72 Info<< "Creating field dpdt\n" << endl;
74 (
75  IOobject
76  (
77  "dpdt",
78  runTime.timeName(),
79  mesh
80  ),
81  mesh,
82  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
83 );
84 
85 Info<< "Creating field kinetic energy K\n" << endl;
86 volScalarField K("K", 0.5*magSqr(U));
87 
88 
89 #include "readGravitationalAcceleration.H"
90 #include "readhRef.H"
91 #include "gh.H"
92 
93 
95 (
96  IOobject
97  (
98  "p_rgh",
99  runTime.timeName(),
100  mesh,
101  IOobject::MUST_READ,
102  IOobject::AUTO_WRITE
103  ),
104  mesh
105 );
106 
107 // Force p_rgh to be consistent with p
108 p_rgh = p - rho*gh;
109 
110 mesh.setFluxRequired(p_rgh.name());
111 
112 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
113 
114 forAll(Y, i)
115 {
116  fields.add(Y[i]);
117 }
118 fields.add(thermo.he());
119 
120 IOdictionary additionalControlsDict
121 (
122  IOobject
123  (
124  "additionalControls",
125  runTime.constant(),
126  mesh,
127  IOobject::MUST_READ_IF_MODIFIED,
128  IOobject::NO_WRITE
129  )
130 );
131 
132 Switch solvePrimaryRegion
133 (
134  additionalControlsDict.lookup("solvePrimaryRegion")
135 );
136 
138 (
139  IOobject
140  (
141  "Qdot",
142  runTime.timeName(),
143  mesh,
144  IOobject::READ_IF_PRESENT,
145  IOobject::AUTO_WRITE
146  ),
147  mesh,
149 );
150 
151 #include "createMRF.H"
152 #include "createClouds.H"
153 #include "createRadiationModel.H"
154 #include "createSurfaceFilmModel.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)
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 volScalarField & gh
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