createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 #include "readGravitationalAcceleration.H"
4 
5 Info<< "Creating combustion model\n" << endl;
6 
7 autoPtr<combustionModels::rhoCombustionModel> combustion
8 (
10 );
11 
12 rhoReactionThermo& thermo = combustion->thermo();
13 thermo.validate(args.executable(), "h", "e");
14 
15 SLGThermo slgThermo(mesh, thermo);
16 
17 basicSpecieMixture& composition = thermo.composition();
18 PtrList<volScalarField>& Y = composition.Y();
19 
20 const word inertSpecie(thermo.lookup("inertSpecie"));
21 if (!composition.species().found(inertSpecie))
22 {
24  << "Inert specie " << inertSpecie << " not found in available species "
25  << composition.species()
26  << exit(FatalIOError);
27 }
28 
29 volScalarField& p = thermo.p();
30 
32 (
33  IOobject
34  (
35  "rho",
36  runTime.timeName(),
37  mesh,
38  IOobject::NO_READ,
39  IOobject::AUTO_WRITE
40  ),
41  thermo.rho()
42 );
43 
44 Info<< "\nReading field U\n" << endl;
46 (
47  IOobject
48  (
49  "U",
50  runTime.timeName(),
51  mesh,
52  IOobject::MUST_READ,
53  IOobject::AUTO_WRITE
54  ),
55  mesh
56 );
57 
58 #include "compressibleCreatePhi.H"
59 
60 mesh.setFluxRequired(p.name());
61 
63 (
64  dimensionedScalar::lookupOrDefault
65  (
66  "rhoMax",
67  pimple.dict(),
68  dimDensity,
69  GREAT
70  )
71 );
72 
74 (
75  dimensionedScalar::lookupOrDefault
76  (
77  "rhoMin",
78  pimple.dict(),
79  dimDensity,
80  0
81  )
82 );
83 
84 Info<< "Creating turbulence model\n" << endl;
85 autoPtr<compressible::turbulenceModel> turbulence
86 (
88  (
89  rho,
90  U,
91  phi,
92  thermo
93  )
94 );
95 
96 // Set the turbulence into the combustion model
97 combustion->setTurbulence(turbulence());
98 
99 Info<< "Creating field dpdt\n" << endl;
101 (
102  IOobject
103  (
104  "dpdt",
105  runTime.timeName(),
106  mesh
107  ),
108  mesh,
109  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
110 );
111 
112 Info<< "Creating field kinetic energy K\n" << endl;
113 volScalarField K("K", 0.5*magSqr(U));
114 
115 Info<< "Creating multi-variate interpolation scheme\n" << endl;
116 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
117 
118 forAll(Y, i)
119 {
120  fields.add(Y[i]);
121 }
122 fields.add(thermo.he());
123 
125 (
126  IOobject
127  (
128  "Qdot",
129  runTime.timeName(),
130  mesh,
131  IOobject::READ_IF_PRESENT,
132  IOobject::AUTO_WRITE
133  ),
134  mesh,
136 );
137 
138 #include "createMRF.H"
139 #include "createRadiationModel.H"
140 #include "createClouds.H"
surfaceScalarField & phi
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
forAll(Y, i)
Definition: createFields.H:106
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
Info<< "Creating combustion model\"<< endl;autoPtr< combustionModels::psiCombustionModel > combustion(combustionModels::psiCombustionModel::New(mesh))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
SLGThermo slgThermo(mesh, thermo)
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
const dictionary & pimple
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
CGAL::Exact_predicates_exact_constructions_kernel K
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:104
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
rho
Definition: createFields.H:81
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
volScalarField & dpdt
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:325
const dimensionSet dimEnergy
const dimensionSet dimDensity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
messageStream Info
Foam::argList args(argc, argv)
const word inertSpecie(thermo.lookup("inertSpecie"))
Creates and initialises the face-flux field phi.
volScalarField Qdot(IOobject("Qdot", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0))
IOerror FatalIOError