createFields.H
Go to the documentation of this file.
1 #include "readGravitationalAcceleration.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 SLGThermo slgThermo(mesh, thermo);
9 
10 basicSpecieMixture& composition = thermo.composition();
11 PtrList<volScalarField>& Y = composition.Y();
12 
13 const word inertSpecie(thermo.lookup("inertSpecie"));
14 if (!composition.species().found(inertSpecie))
15 {
17  << "Inert specie " << inertSpecie << " not found in available species "
18  << composition.species()
19  << exit(FatalIOError);
20 }
21 
22 volScalarField& p = thermo.p();
23 
25 (
26  IOobject
27  (
28  "rho",
29  runTime.timeName(),
30  mesh,
31  IOobject::READ_IF_PRESENT,
32  IOobject::AUTO_WRITE
33  ),
34  thermo.rho()
35 );
36 
37 Info<< "\nReading field U\n" << endl;
39 (
40  IOobject
41  (
42  "U",
43  runTime.timeName(),
44  mesh,
45  IOobject::MUST_READ,
46  IOobject::AUTO_WRITE
47  ),
48  mesh
49 );
50 
51 #include "compressibleCreatePhi.H"
52 
53 mesh.setFluxRequired(p.name());
54 
55 dimensionedScalar rhoMax
56 (
57  dimensionedScalar::lookupOrDefault
58  (
59  "rhoMax",
60  pimple.dict(),
61  dimDensity,
62  great
63  )
64 );
65 
66 dimensionedScalar rhoMin
67 (
68  dimensionedScalar::lookupOrDefault
69  (
70  "rhoMin",
71  pimple.dict(),
72  dimDensity,
73  0
74  )
75 );
76 
77 Info<< "Creating turbulence model\n" << endl;
78 autoPtr<compressible::turbulenceModel> turbulence
79 (
81  (
82  rho,
83  U,
84  phi,
85  thermo
86  )
87 );
88 
89 Info<< "Creating combustion model\n" << endl;
90 autoPtr<CombustionModel<psiReactionThermo>> combustion
91 (
93 );
94 
95 Info<< "Creating field dpdt\n" << endl;
97 (
98  IOobject
99  (
100  "dpdt",
101  runTime.timeName(),
102  mesh
103  ),
104  mesh,
105  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
106 );
107 
108 Info<< "Creating field kinetic energy K\n" << endl;
109 volScalarField K("K", 0.5*magSqr(U));
110 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
111 
112 forAll(Y, i)
113 {
114  fields.add(Y[i]);
115 }
116 fields.add(thermo.he());
117 
119 (
120  IOobject
121  (
122  "Qdot",
123  runTime.timeName(),
124  mesh,
125  IOobject::NO_READ,
126  IOobject::AUTO_WRITE
127  ),
128  mesh,
130 );
131 
132 #include "createMRF.H"
133 #include "createClouds.H"
134 #include "createRadiationModel.H"
135 #include "createFvOptions.H"
forAll(Y, i)
Definition: createFields.H:99
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
pimpleNoLoopControl & pimple
surfaceScalarField & phi
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
SLGThermo slgThermo(mesh, thermo)
Info<< "Reading initial conditions.\"<< endl;IOdictionary initialConditions(IOobject("initialConditions", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE));scalar p0=readScalar(initialConditions.lookup("p"));scalar T0=readScalar(initialConditions.lookup("T"));# 24 "/home/ubuntu/OpenFOAM-6/applications/solvers/combustion/chemFoam/createFields.H" 2 Info<< "Reading thermophysical properties\"<< endl;autoPtr< rhoReactionThermo > pThermo(rhoReactionThermo::New(mesh))
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero))
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
CGAL::Exact_predicates_exact_constructions_kernel K
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
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
volScalarField & dpdt
rho
Definition: createFields.H:81
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
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
Info<< "Creating combustion model\"<< endl;autoPtr< CombustionModel< psiReactionThermo > > combustion(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
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