createFields.H
Go to the documentation of this file.
1#include "createRDeltaT.H"
2
3Info<< "Reading thermophysical properties\n" << endl;
4autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
5rhoReactionThermo& thermo = pThermo();
6thermo.validate(args.executable(), "h", "e");
7
8basicSpecieMixture& composition = thermo.composition();
9PtrList<volScalarField>& Y = composition.Y();
10
11const word inertSpecie(thermo.get<word>("inertSpecie"));
12if (!composition.species().found(inertSpecie))
13{
15 << "Inert specie " << inertSpecie << " not found in available species "
16 << composition.species()
17 << exit(FatalIOError);
18}
19
20volScalarField rho
21(
22 IOobject
23 (
24 "rho",
25 runTime.timeName(),
26 mesh
27 ),
28 thermo.rho()
29);
30
31Info<< "Reading field U\n" << endl;
32volVectorField U
33(
34 IOobject
35 (
36 "U",
37 runTime.timeName(),
38 mesh,
39 IOobject::MUST_READ,
40 IOobject::AUTO_WRITE
41 ),
42 mesh
43);
44
45
46volScalarField& p = thermo.p();
47
48
50
51mesh.setFluxRequired(p.name());
52
53Info << "Creating turbulence model.\n" << nl;
54autoPtr<compressible::turbulenceModel> turbulence
55(
56 compressible::turbulenceModel::New
57 (
58 rho,
59 U,
60 phi,
61 thermo
62 )
63);
64
65Info<< "Creating reaction model\n" << endl;
66autoPtr<CombustionModel<rhoReactionThermo>> reaction
67(
68 CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
69);
70
71#include "readGravitationalAcceleration.H"
72#include "readhRef.H"
73#include "gh.H"
74
75Info<< "Reading field p_rgh\n" << endl;
76volScalarField p_rgh
77(
78 IOobject
79 (
80 "p_rgh",
81 runTime.timeName(),
82 mesh,
83 IOobject::MUST_READ,
84 IOobject::AUTO_WRITE
85 ),
86 mesh
87);
88
89// Force p_rgh to be consistent with p
90p_rgh = p - rho*gh;
91
92multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
93
95{
96 fields.add(Y[i]);
97}
98fields.add(thermo.he());
99
100volScalarField Qdot
101(
102 IOobject
103 (
104 "Qdot",
105 runTime.timeName(),
106 mesh,
107 IOobject::READ_IF_PRESENT,
108 IOobject::AUTO_WRITE
109 ),
110 mesh,
111 dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
112);
113
114#include "createDpdt.H"
115
116#include "createK.H"
117
118#include "createMRF.H"
119#include "createFvOptions.H"
volScalarField & p_rgh
surfaceScalarField & phi
const volScalarField & gh
const word & executable() const noexcept
Name of executable without the path.
Definition: argListI.H:51
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
U
Definition: pEqn.H:72
volScalarField & p
Creates and initialises the face-flux field phi.
dynamicFvMesh & mesh
engineTime & runTime
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:467
compressible::turbulenceModel & turbulence
CombustionModel< rhoReactionThermo > & reaction
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
Foam::argList args(argc, argv)
scalar Qdot
Definition: solveChemistry.H:2
Info<< "Reading thermophysical properties\n"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))
const word inertSpecie(thermo.get< word >("inertSpecie"))
basicSpecieMixture & composition
Definition: createFields.H:8
PtrList< volScalarField > & Y
Definition: createFields.H:9
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333