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 if (!composition.contains(inertSpecie))
19 {
21  << "Specified inert specie '" << inertSpecie << "' not found in "
22  << "species list. Available species:" << composition.species()
23  << exit(FatalError);
24 }
25 
27 const volScalarField& T = thermo.T();
28 const volScalarField& psi = thermo.psi();
29 
30 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
31 
32 forAll(Y, i)
33 {
34  fields.add(Y[i]);
35 }
36 fields.add(thermo.he());
37 
39 (
40  IOobject
41  (
42  "rho",
43  runTime.timeName(),
44  mesh,
45  IOobject::NO_READ,
46  IOobject::AUTO_WRITE
47  ),
48  thermo.rho()
49 );
50 
51 // lagrangian effective density field - used externally (optional)
53 (
54  IOobject
55  (
56  "rhoEffLagrangian",
57  runTime.timeName(),
58  mesh,
59  IOobject::NO_READ,
60  IOobject::AUTO_WRITE
61  ),
62  mesh,
63  dimensionedScalar("zero", dimDensity, 0.0)
64 );
65 
66 // dynamic pressure field - used externally (optional)
68 (
69  IOobject
70  (
71  "pDyn",
72  runTime.timeName(),
73  mesh,
74  IOobject::NO_READ,
75  IOobject::AUTO_WRITE
76  ),
77  mesh,
78  dimensionedScalar("zero", dimPressure, 0.0)
79 );
80 
81 
82 Info<< "\nReading field U\n" << endl;
84 (
85  IOobject
86  (
87  "U",
88  runTime.timeName(),
89  mesh,
90  IOobject::MUST_READ,
91  IOobject::AUTO_WRITE
92  ),
93  mesh
94 );
95 
96 #include "compressibleCreatePhi.H"
97 
98 mesh.setFluxRequired(p.name());
99 
100 Info<< "Creating turbulence model\n" << endl;
101 autoPtr<compressible::turbulenceModel> turbulence
102 (
104  (
105  rho,
106  U,
107  phi,
108  thermo
109  )
110 );
111 
112 // Set the turbulence into the combustion model
113 combustion->setTurbulence(turbulence());
114 
115 Info<< "Creating field dpdt\n" << endl;
117 (
118  IOobject
119  (
120  "dpdt",
121  runTime.timeName(),
122  mesh
123  ),
124  mesh,
125  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
126 );
127 
128 Info<< "Creating field kinetic energy K\n" << endl;
129 volScalarField K("K", 0.5*magSqr(U));
130 
132 (
133  IOobject
134  (
135  "dQ",
136  runTime.timeName(),
137  mesh,
138  IOobject::NO_READ,
139  IOobject::AUTO_WRITE
140  ),
141  mesh,
143 );
Foam::dimPressure
const dimensionSet dimPressure
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
rhoEffLagrangian
volScalarField rhoEffLagrangian(IOobject("rhoEffLagrangian", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimDensity, 0.0))
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
Foam::dimDensity
const dimensionSet dimDensity
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
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
pDyn
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimPressure, 0.0))
Foam::FatalError
error FatalError
p
volScalarField & p
Definition: createFields.H:51
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
compressibleCreatePhi.H
Creates and initialises the face-flux field phi.
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
T
const volScalarField & T
Definition: createFields.H:25
slgThermo
SLGThermo slgThermo(mesh, thermo)
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())
Foam::magSqr
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Y
PtrList< volScalarField > & Y
Definition: createFields.H:36