createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 Info<< "Reading thermophysical properties\n" << endl;
4 autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
5 psiReactionThermo& thermo = pThermo();
6 thermo.validate(args.executable(), "h", "e");
7 
8 basicSpecieMixture& composition = thermo.composition();
9 PtrList<volScalarField>& Y = composition.Y();
10 
11 const word inertSpecie(thermo.get<word>("inertSpecie"));
12 if (!composition.species().found(inertSpecie))
13 {
15  << "Inert specie " << inertSpecie << " not found in available species "
16  << composition.species() << exit(FatalIOError);
17 }
18 
20 (
21  IOobject
22  (
23  "rho",
24  runTime.timeName(),
25  mesh
26  ),
27  thermo.rho()
28 );
29 
30 Info<< "Reading field U\n" << endl;
32 (
33  IOobject
34  (
35  "U",
36  runTime.timeName(),
37  mesh,
38  IOobject::MUST_READ,
39  IOobject::AUTO_WRITE
40  ),
41  mesh
42 );
43 
44 volScalarField& p = thermo.p();
45 
46 #include "compressibleCreatePhi.H"
47 
48 pressureControl pressureControl(p, rho, pimple.dict(), false);
49 
50 mesh.setFluxRequired(p.name());
51 
52 Info << "Creating turbulence model.\n" << nl;
53 autoPtr<compressible::turbulenceModel> turbulence
54 (
56  (
57  rho,
58  U,
59  phi,
60  thermo
61  )
62 );
63 
64 Info<< "Creating reaction model\n" << endl;
65 autoPtr<CombustionModel<psiReactionThermo>> reaction
66 (
68 );
69 
70 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
71 
72 forAll(Y, i)
73 {
74  fields.add(Y[i]);
75 }
76 fields.add(thermo.he());
77 
79 (
80  IOobject
81  (
82  "Qdot",
83  runTime.timeName(),
84  mesh,
85  IOobject::READ_IF_PRESENT,
86  IOobject::AUTO_WRITE
87  ),
88  mesh,
90 );
91 
92 #include "createDpdt.H"
93 
94 #include "createK.H"
95 
96 #include "createMRF.H"
97 #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
forAll(U.boundaryField(), patchi)
Definition: createFields.H:52
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
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 >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
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
Info<< "Creating reaction model\"<< endl;autoPtr< CombustionModel< psiReactionThermo > > reaction(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
pimpleControl & pimple
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
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
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)
Foam::argList args(argc, argv)
pressureControl pressureControl(p, rho, pimple.dict(), false)
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:133