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 
18 Info<< "Creating field rho\n" << endl;
20 (
21  IOobject
22  (
23  "rho",
24  runTime.timeName(),
25  mesh,
26  IOobject::NO_READ,
27  IOobject::AUTO_WRITE
28  ),
29  thermo.rho()
30 );
31 
32 volScalarField& p = thermo.p();
33 const volScalarField& T = thermo.T();
34 const volScalarField& psi = thermo.psi();
35 
36 Info<< "\nReading field U\n" << endl;
38 (
39  IOobject
40  (
41  "U",
42  runTime.timeName(),
43  mesh,
44  IOobject::MUST_READ,
45  IOobject::AUTO_WRITE
46  ),
47  mesh
48 );
49 
50 #include "compressibleCreatePhi.H"
51 
52 Info<< "Creating turbulence model\n" << endl;
53 autoPtr<compressible::turbulenceModel> turbulence
54 (
56  (
57  rho,
58  U,
59  phi,
60  thermo
61  )
62 );
63 
64 // Set the turbulence into the combustion model
65 combustion->setTurbulence(turbulence());
66 
67 Info<< "Creating field dpdt\n" << endl;
69 (
70  IOobject
71  (
72  "dpdt",
73  runTime.timeName(),
74  mesh
75  ),
76  mesh,
77  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
78 );
79 
80 Info<< "Creating field kinetic energy K\n" << endl;
81 volScalarField K("K", 0.5*magSqr(U));
82 
83 
84 #include "readGravitationalAcceleration.H"
85 #include "readhRef.H"
86 #include "gh.H"
87 
88 
90 (
91  IOobject
92  (
93  "p_rgh",
94  runTime.timeName(),
95  mesh,
96  IOobject::MUST_READ,
97  IOobject::AUTO_WRITE
98  ),
99  mesh
100 );
101 
102 // Force p_rgh to be consistent with p
103 p_rgh = p - rho*gh;
104 
105 mesh.setFluxRequired(p_rgh.name());
106 
107 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
108 
110 {
111  fields.add(Y[i]);
112 }
113 fields.add(thermo.he());
114 
115 IOdictionary additionalControlsDict
116 (
117  IOobject
118  (
119  "additionalControls",
120  runTime.constant(),
121  mesh,
122  IOobject::MUST_READ_IF_MODIFIED,
123  IOobject::NO_WRITE
124  )
125 );
126 
127 Switch solvePrimaryRegion
128 (
129  additionalControlsDict.lookup("solvePrimaryRegion")
130 );
131 
133 (
134  IOobject
135  (
136  "dQ",
137  runTime.timeName(),
138  mesh,
139  IOobject::NO_READ,
140  IOobject::AUTO_WRITE
141  ),
142  mesh,
144 );
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