createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 Info<< "Creating reaction model\n" << endl;
4 
5 autoPtr<combustionModels::rhoCombustionModel> reaction
6 (
8 );
9 
10 rhoReactionThermo& thermo = reaction->thermo();
11 thermo.validate(args.executable(), "h", "e");
12 
13 basicMultiComponentMixture& composition = thermo.composition();
14 PtrList<volScalarField>& Y = composition.Y();
15 
16 const word inertSpecie(thermo.lookup("inertSpecie"));
17 if (!composition.species().found(inertSpecie))
18 {
20  << "Inert specie " << inertSpecie << " not found in available species "
21  << composition.species()
22  << exit(FatalIOError);
23 }
24 
26 (
27  IOobject
28  (
29  "rho",
30  runTime.timeName(),
31  mesh
32  ),
33  thermo.rho()
34 );
35 
36 Info<< "Reading field U\n" << endl;
38 (
39  IOobject
40  (
41  "U",
42  runTime.timeName(),
43  mesh,
44  IOobject::MUST_READ,
45  IOobject::AUTO_WRITE
46  ),
47  mesh
48 );
49 
50 
51 volScalarField& p = thermo.p();
52 
53 #include "compressibleCreatePhi.H"
54 
55 pressureControl pressureControl(p, rho, pimple.dict(), false);
56 
57 mesh.setFluxRequired(p.name());
58 
59 
60 Info << "Creating turbulence model.\n" << nl;
61 autoPtr<compressible::turbulenceModel> turbulence
62 (
64  (
65  rho,
66  U,
67  phi,
68  thermo
69  )
70 );
71 
72 // Set the turbulence into the reaction model
73 reaction->setTurbulence(turbulence());
74 
75 
76 Info<< "Creating field dpdt\n" << endl;
78 (
79  IOobject
80  (
81  "dpdt",
82  runTime.timeName(),
83  mesh
84  ),
85  mesh,
86  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
87 );
88 
89 Info<< "Creating field kinetic energy K\n" << endl;
90 volScalarField K("K", 0.5*magSqr(U));
91 
92 
93 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
94 
95 forAll(Y, i)
96 {
97  fields.add(Y[i]);
98 }
99 fields.add(thermo.he());
100 
102 (
103  IOobject
104  (
105  "Qdot",
106  runTime.timeName(),
107  mesh,
108  IOobject::READ_IF_PRESENT,
109  IOobject::AUTO_WRITE
110  ),
111  mesh,
113 );
114 
115 #include "createMRF.H"
surfaceScalarField & phi
forAll(Y, i)
Definition: createFields.H:106
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
const dictionary & pimple
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
CGAL::Exact_predicates_exact_constructions_kernel K
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:104
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
psiReactionThermo & thermo
Definition: createFields.H:31
rho
Definition: createFields.H:81
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
volScalarField & dpdt
dimensioned< scalar > magSqr(const dimensioned< Type > &)
static const char nl
Definition: Ostream.H:262
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.
Info<< "Creating reaction model\"<< endl;autoPtr< combustionModels::psiCombustionModel > reaction(combustionModels::psiCombustionModel::New(mesh))
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