createFields.H
Go to the documentation of this file.
1 #include "readGravitationalAcceleration.H"
2 
3 
4 Info<< "Reading thermophysical properties\n" << endl;
5 autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
6 rhoReactionThermo& thermo = pThermo();
7 thermo.validate(args.executable(), "h", "e");
8 
9 SLGThermo slgThermo(mesh, thermo);
10 
11 basicSpecieMixture& composition = thermo.composition();
12 PtrList<volScalarField>& Y = composition.Y();
13 
14 const word inertSpecie(thermo.get<word>("inertSpecie"));
15 if (!composition.species().found(inertSpecie))
16 {
18  << "Inert specie " << inertSpecie << " not found in available species "
19  << composition.species()
20  << exit(FatalIOError);
21 }
22 
24 
26 (
27  IOobject
28  (
29  "rho",
30  runTime.timeName(),
31  mesh,
32  IOobject::NO_READ,
33  IOobject::AUTO_WRITE
34  ),
35  thermo.rho()
36 );
37 
38 Info<< "\nReading field U\n" << endl;
40 (
41  IOobject
42  (
43  "U",
44  runTime.timeName(),
45  mesh,
46  IOobject::MUST_READ,
47  IOobject::AUTO_WRITE
48  ),
49  mesh
50 );
51 
52 #include "compressibleCreatePhi.H"
53 
54 mesh.setFluxRequired(p.name());
55 
56 const dimensionedScalar rhoMax("rhoMax", dimDensity, GREAT, simple.dict());
57 const dimensionedScalar rhoMin("rhoMin", dimDensity, Zero, simple.dict());
58 
59 Info<< "Creating turbulence model\n" << endl;
60 autoPtr<compressible::turbulenceModel> turbulence
61 (
63  (
64  rho,
65  U,
66  phi,
67  thermo
68  )
69 );
70 
71 Info<< "Creating reaction model\n" << endl;
72 autoPtr<CombustionModel<rhoReactionThermo>> reaction
73 (
75 );
76 
77 Info<< "Creating multi-variate interpolation scheme\n" << endl;
78 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
79 
80 forAll(Y, i)
81 {
82  fields.add(Y[i]);
83 }
84 fields.add(thermo.he());
85 
87 (
88  IOobject
89  (
90  "Qdot",
91  runTime.timeName(),
92  mesh,
93  IOobject::NO_READ,
94  IOobject::AUTO_WRITE
95  ),
96  mesh,
98 );
99 
100 #include "createMRF.H"
101 #include "createRadiationModel.H"
102 #include "createClouds.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 >> &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()))
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))
const dictionary & simple
PtrList< volScalarField > & Y
Definition: createFields.H:9
const dimensionedScalar rhoMin("rhoMin", dimDensity, Zero, pimple.dict())
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)
basicSpecieMixture & composition
Definition: createFields.H:8
Creates and initialises the face-flux field phi.
const dimensionedScalar rhoMax("rhoMax", dimDensity, GREAT, pimple.dict())
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