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 
31 (
32  IOobject
33  (
34  "rho",
35  runTime.timeName(),
36  mesh,
37  IOobject::READ_IF_PRESENT,
38  IOobject::AUTO_WRITE
39  ),
40  thermo.rho()
41 );
42 
43 Info<< "\nReading field U\n" << endl;
45 (
46  IOobject
47  (
48  "U",
49  runTime.timeName(),
50  mesh,
51  IOobject::MUST_READ,
52  IOobject::AUTO_WRITE
53  ),
54  mesh
55 );
56 
57 #include "compressibleCreatePhi.H"
58 
59 mesh.setFluxRequired(p.name());
60 
62 (
63  dimensionedScalar::lookupOrDefault
64  (
65  "rhoMax",
66  pimple.dict(),
67  dimDensity,
68  GREAT
69  )
70 );
71 
73 (
74  dimensionedScalar::lookupOrDefault
75  (
76  "rhoMin",
77  pimple.dict(),
78  dimDensity,
79  0
80  )
81 );
82 
83 Info<< "Creating turbulence model\n" << endl;
84 autoPtr<compressible::turbulenceModel> turbulence
85 (
87  (
88  rho,
89  U,
90  phi,
91  thermo
92  )
93 );
94 
95 // Set the turbulence into the combustion model
96 combustion->setTurbulence(turbulence());
97 
98 Info<< "Creating field dpdt\n" << endl;
100 (
101  IOobject
102  (
103  "dpdt",
104  runTime.timeName(),
105  mesh
106  ),
107  mesh,
108  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
109 );
110 
111 Info<< "Creating field kinetic energy K\n" << endl;
112 volScalarField K("K", 0.5*magSqr(U));
113 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
114 
116 {
117  fields.add(Y[i]);
118 }
119 fields.add(thermo.he());
120 
122 (
123  IOobject
124  (
125  "dQ",
126  runTime.timeName(),
127  mesh,
128  IOobject::NO_READ,
129  IOobject::AUTO_WRITE
130  ),
131  mesh,
133 );
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
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
rhoMin
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
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
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
rhoMax
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
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