createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 Info<< "Reading thermophysical properties\n" << endl;
4 autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
5 rhoReactionThermo& 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.lookup("inertSpecie"));
12 if (!composition.species().found(inertSpecie))
13 {
15  << "Inert specie " << inertSpecie << " not found in available species "
16  << composition.species()
17  << exit(FatalIOError);
18 }
19 
21 (
22  IOobject
23  (
24  "rho",
25  runTime.timeName(),
26  mesh
27  ),
28  thermo.rho()
29 );
30 
31 Info<< "Reading field U\n" << endl;
33 (
34  IOobject
35  (
36  "U",
37  runTime.timeName(),
38  mesh,
39  IOobject::MUST_READ,
40  IOobject::AUTO_WRITE
41  ),
42  mesh
43 );
44 
45 
46 volScalarField& p = thermo.p();
47 
48 
49 #include "compressibleCreatePhi.H"
50 
51 mesh.setFluxRequired(p.name());
52 
53 Info << "Creating turbulence model.\n" << nl;
54 autoPtr<compressible::turbulenceModel> turbulence
55 (
57  (
58  rho,
59  U,
60  phi,
61  thermo
62  )
63 );
64 
65 Info<< "Creating reaction model\n" << endl;
66 autoPtr<CombustionModel<rhoReactionThermo>> reaction
67 (
69 );
70 
71 #include "readGravitationalAcceleration.H"
72 #include "readhRef.H"
73 #include "gh.H"
74 
75 Info<< "Reading field p_rgh\n" << endl;
77 (
78  IOobject
79  (
80  "p_rgh",
81  runTime.timeName(),
82  mesh,
83  IOobject::MUST_READ,
84  IOobject::AUTO_WRITE
85  ),
86  mesh
87 );
88 
89 // Force p_rgh to be consistent with p
90 p_rgh = p - rho*gh;
91 
92 Info<< "Creating field dpdt\n" << endl;
94 (
95  IOobject
96  (
97  "dpdt",
98  runTime.timeName(),
99  mesh
100  ),
101  mesh,
102  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
103 );
104 
105 Info<< "Creating field kinetic energy K\n" << endl;
106 volScalarField K("K", 0.5*magSqr(U));
107 
108 
109 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
110 
111 forAll(Y, i)
112 {
113  fields.add(Y[i]);
114 }
115 fields.add(thermo.he());
116 
118 (
119  IOobject
120  (
121  "Qdot",
122  runTime.timeName(),
123  mesh,
124  IOobject::READ_IF_PRESENT,
125  IOobject::AUTO_WRITE
126  ),
127  mesh,
129 );
130 
131 #include "createMRF.H"
132 #include "createFvOptions.H"
forAll(Y, i)
Definition: createFields.H:99
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
surfaceScalarField & phi
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
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
Info<< "Creating reaction model\"<< endl;autoPtr< CombustionModel< psiReactionThermo > > reaction(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
dimensioned< scalar > magSqr(const dimensioned< Type > &)
static const char nl
Definition: Ostream.H:265
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
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
const volScalarField & gh
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