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 
23 Info<< "Creating field rho\n" << endl;
25 (
26  IOobject
27  (
28  "rho",
29  runTime.timeName(),
30  mesh,
31  IOobject::NO_READ,
32  IOobject::AUTO_WRITE
33  ),
34  thermo.rho()
35 );
36 
37 volScalarField& p = thermo.p();
38 const volScalarField& T = thermo.T();
39 const volScalarField& psi = thermo.psi();
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 
73 (
74  IOobject
75  (
76  "dQ",
77  runTime.timeName(),
78  mesh,
79  IOobject::NO_READ,
80  IOobject::AUTO_WRITE
81  ),
82  mesh,
84 );
85 
86 
87 Info<< "Creating field dpdt\n" << endl;
89 (
90  IOobject
91  (
92  "dpdt",
93  runTime.timeName(),
94  mesh
95  ),
96  mesh,
97  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
98 );
99 
100 Info<< "Creating field kinetic energy K\n" << endl;
101 volScalarField K("K", 0.5*magSqr(U));
102 
103 
104 #include "readGravitationalAcceleration.H"
105 #include "readhRef.H"
106 #include "gh.H"
107 
108 
110 (
111  IOobject
112  (
113  "p_rgh",
114  runTime.timeName(),
115  mesh,
116  IOobject::MUST_READ,
117  IOobject::AUTO_WRITE
118  ),
119  mesh
120 );
121 
122 // Force p_rgh to be consistent with p
123 p_rgh = p - rho*gh;
124 
125 mesh.setFluxRequired(p_rgh.name());
126 
127 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
128 
130 {
131  fields.add(Y[i]);
132 }
133 fields.add(thermo.he());
134 
135 IOdictionary additionalControlsDict
136 (
137  IOobject
138  (
139  "additionalControls",
140  runTime.constant(),
141  mesh,
142  IOobject::MUST_READ_IF_MODIFIED,
143  IOobject::NO_WRITE
144  )
145 );
146 
147 Switch solvePrimaryRegion
148 (
149  additionalControlsDict.lookup("solvePrimaryRegion")
150 );
gh.H
Foam::compressible::New
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Definition: turbulentFluidThermoModel.C:36
forAll
forAll(Y, i)
Definition: createFields.H:129
dQ
volScalarField dQ(IOobject("dQ", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("dQ", dimEnergy/dimTime, 0.0))
Foam::dimEnergy
const dimensionSet dimEnergy
fields
Info<< "Creating field dpdt\n"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar("dpdt", p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\n"<< endl;volScalarField K("K", 0.5 *magSqr(U));volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);p_rgh=p - rho *gh;mesh.setFluxRequired(p_rgh.name());multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:127
phi
surfaceScalarField & phi
Definition: createFields.H:13
additionalControlsDict
IOdictionary additionalControlsDict(IOobject("additionalControls", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE))
inertSpecie
const word inertSpecie(thermo.lookup("inertSpecie"))
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
rho
rho
Definition: createFields.H:79
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:12
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:56
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::argList::executable
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::Info
messageStream Info
psi
const volScalarField & psi
Definition: createFields.H:24
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
p
volScalarField & p
Definition: createFields.H:51
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:34
compressibleCreatePhi.H
Creates and initialises the face-flux field phi.
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
T
const volScalarField & T
Definition: createFields.H:25
slgThermo
SLGThermo slgThermo(mesh, thermo)
readhRef.H
solvePrimaryRegion
Switch solvePrimaryRegion(additionalControlsDict.lookup("solvePrimaryRegion"))
composition
basicMultiComponentMixture & composition
Definition: createFields.H:35
combustion
Info<< "Creating combustion model\n"<< endl;autoPtr< combustionModels::psiCombustionModel > combustion(combustionModels::psiCombustionModel::New(mesh))
args
Foam::argList args(argc, argv)
U
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), Urel+SRF->U())
p_rgh
volScalarField & p_rgh
Definition: setRegionFluidFields.H:31
Foam::magSqr
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Y
PtrList< volScalarField > & Y
Definition: createFields.H:36