createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 #include "readGravitationalAcceleration.H"
4 
5 Info<< "Reading thermophysical properties\n" << endl;
6 autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
7 psiReactionThermo& thermo = pThermo();
8 thermo.validate(args.executable(), "h", "e");
9 
10 SLGThermo slgThermo(mesh, thermo);
11 
12 basicSpecieMixture& composition = thermo.composition();
13 PtrList<volScalarField>& Y = composition.Y();
14 
15 const word inertSpecie(thermo.get<word>("inertSpecie"));
16 if (!composition.species().found(inertSpecie))
17 {
19  << "Inert specie " << inertSpecie << " not found in available species "
20  << composition.species()
21  << exit(FatalIOError);
22 }
23 
25 
26 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
27 
28 forAll(Y, i)
29 {
30  fields.add(Y[i]);
31 }
32 fields.add(thermo.he());
33 
35 (
36  IOobject
37  (
38  "rho",
39  runTime.timeName(),
40  mesh,
41  IOobject::NO_READ,
42  IOobject::AUTO_WRITE
43  ),
44  thermo.rho()
45 );
46 
47 // lagrangian effective density field - used externally (optional)
49 (
50  IOobject
51  (
52  "rhoEffLagrangian",
53  runTime.timeName(),
54  mesh,
55  IOobject::NO_READ,
56  IOobject::AUTO_WRITE
57  ),
58  mesh,
60 );
61 
62 // dynamic pressure field - used externally (optional)
64 (
65  IOobject
66  (
67  "pDyn",
68  runTime.timeName(),
69  mesh,
70  IOobject::NO_READ,
71  IOobject::AUTO_WRITE
72  ),
73  mesh,
75 );
76 
77 
78 Info<< "\nReading field U\n" << endl;
80 (
81  IOobject
82  (
83  "U",
84  runTime.timeName(),
85  mesh,
86  IOobject::MUST_READ,
87  IOobject::AUTO_WRITE
88  ),
89  mesh
90 );
91 
92 #include "compressibleCreatePhi.H"
93 
94 mesh.setFluxRequired(p.name());
95 
96 Info<< "Creating turbulence model\n" << endl;
97 autoPtr<compressible::turbulenceModel> turbulence
98 (
100  (
101  rho,
102  U,
103  phi,
104  thermo
105  )
106 );
107 
108 Info<< "Creating combustion model\n" << endl;
109 autoPtr<CombustionModel<psiReactionThermo>> combustion
110 (
112 );
113 
115 (
116  IOobject
117  (
118  "Qdot",
119  runTime.timeName(),
120  mesh,
121  IOobject::READ_IF_PRESENT,
122  IOobject::AUTO_WRITE
123  ),
124  mesh,
126 );
127 
128 #include "createDpdt.H"
129 
130 #include "createK.H"
131 
132 #include "createMRF.H"
133 #include "createClouds.H"
134 #include "createRadiationModel.H"
135 #include "createFvOptions.H"
Info<< "Reading thermophysical properties\"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))
volScalarField Qdot(IOobject("Qdot", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero))
const word inertSpecie(thermo.get< word >("inertSpecie"))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
SLGThermo slgThermo(mesh, thermo)
forAll(U.boundaryField(), patchi)
Definition: createFields.H:52
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:85
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:84
psiReactionThermo & thermo
Definition: createFields.H:28
rho
Definition: createFields.H:81
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
const word & executable() const noexcept
Name of executable without the path.
Definition: argListI.H:44
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimPressure, Zero))
const dimensionSet dimPressure
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:598
const dimensionSet dimEnergy
volScalarField & p
Definition: createFields.H:23
const dimensionSet dimDensity
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
Info<< "Creating combustion model\"<< endl;autoPtr< CombustionModel< psiReactionThermo > > combustion(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
PtrList< volScalarField > & Y
Definition: createFields.H:9
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
Information stream (stdout output on master, null elsewhere)
volScalarField rhoEffLagrangian(IOobject("rhoEffLagrangian", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimDensity, Zero))
Foam::argList args(argc, argv)
basicSpecieMixture & composition
Definition: createFields.H:8
Creates and initialises the face-flux field phi.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:157