createFields.H
Go to the documentation of this file.
1 #include "readGravitationalAcceleration.H"
2 
3 Info<< "Creating combustion model\n" << endl;
4 
5 autoPtr<combustionModels::psiCombustionModel> combustion
6 (
8 );
9 
10 psiReactionThermo& thermo = combustion->thermo();
11 thermo.validate(args.executable(), "h", "e");
12 
13 SLGThermo slgThermo(mesh, thermo);
14 
15 basicSpecieMixture& composition = thermo.composition();
16 PtrList<volScalarField>& Y = composition.Y();
17 
18 const word inertSpecie(thermo.lookup("inertSpecie"));
19 if (!composition.species().found(inertSpecie))
20 {
22  << "Inert specie " << inertSpecie << " not found in available species "
23  << composition.species()
24  << exit(FatalIOError);
25 }
26 
27 volScalarField& p = thermo.p();
28 
30 (
31  IOobject
32  (
33  "rho",
34  runTime.timeName(),
35  mesh,
36  IOobject::READ_IF_PRESENT,
37  IOobject::AUTO_WRITE
38  ),
39  thermo.rho()
40 );
41 
42 Info<< "\nReading field U\n" << endl;
44 (
45  IOobject
46  (
47  "U",
48  runTime.timeName(),
49  mesh,
50  IOobject::MUST_READ,
51  IOobject::AUTO_WRITE
52  ),
53  mesh
54 );
55 
56 #include "compressibleCreatePhi.H"
57 
58 mesh.setFluxRequired(p.name());
59 
61 (
62  dimensionedScalar::lookupOrDefault
63  (
64  "rhoMax",
65  pimple.dict(),
66  dimDensity,
67  GREAT
68  )
69 );
70 
72 (
73  dimensionedScalar::lookupOrDefault
74  (
75  "rhoMin",
76  pimple.dict(),
77  dimDensity,
78  0
79  )
80 );
81 
82 Info<< "Creating turbulence model\n" << endl;
83 autoPtr<compressible::turbulenceModel> turbulence
84 (
86  (
87  rho,
88  U,
89  phi,
90  thermo
91  )
92 );
93 
94 // Set the turbulence into the combustion model
95 combustion->setTurbulence(turbulence());
96 
97 Info<< "Creating field dpdt\n" << endl;
99 (
100  IOobject
101  (
102  "dpdt",
103  runTime.timeName(),
104  mesh
105  ),
106  mesh,
107  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
108 );
109 
110 Info<< "Creating field kinetic energy K\n" << endl;
111 volScalarField K("K", 0.5*magSqr(U));
112 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
113 
114 forAll(Y, i)
115 {
116  fields.add(Y[i]);
117 }
118 fields.add(thermo.he());
119 
121 (
122  IOobject
123  (
124  "Qdot",
125  runTime.timeName(),
126  mesh,
127  IOobject::NO_READ,
128  IOobject::AUTO_WRITE
129  ),
130  mesh,
132 );
133 
134 #include "createMRF.H"
135 #include "createClouds.H"
136 #include "createRadiationModel.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