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::momentumTransportModel> turbulence
55 (
57  (
58  rho,
59  U,
60  phi,
61  thermo
62  )
63 );
64 
65 Info<< "Creating thermophysical transport model\n" << endl;
66 autoPtr<rhoReactionThermophysicalTransportModel>
68 (
70  (
71  turbulence(),
72  thermo
73  )
74 );
75 
76 Info<< "Creating reaction model\n" << endl;
77 autoPtr<CombustionModel<rhoReactionThermo>> reaction
78 (
80 );
81 
82 #include "readGravitationalAcceleration.H"
83 #include "readhRef.H"
84 #include "gh.H"
85 #include "readpRef.H"
86 
87 Info<< "Reading field p_rgh\n" << endl;
89 (
90  IOobject
91  (
92  "p_rgh",
93  runTime.timeName(),
94  mesh,
95  IOobject::MUST_READ,
96  IOobject::AUTO_WRITE
97  ),
98  mesh
99 );
100 
101 // Force p_rgh to be consistent with p
102 p_rgh = p - rho*gh - pRef;
103 
105 (
106  p,
107  p_rgh,
108  rho,
109  pimple.dict(),
110  thermo.incompressible()
111 );
112 
113 mesh.setFluxRequired(p_rgh.name());
114 
115 Info<< "Creating field dpdt\n" << endl;
117 (
118  IOobject
119  (
120  "dpdt",
121  runTime.timeName(),
122  mesh
123  ),
124  mesh,
125  dimensionedScalar(p.dimensions()/dimTime, 0)
126 );
127 
128 Info<< "Creating field kinetic energy K\n" << endl;
129 volScalarField K("K", 0.5*magSqr(U));
130 
132 
133 
134 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
135 forAll(Y, i)
136 {
137  fields.add(Y[i]);
138 }
139 fields.add(thermo.he());
140 
141 #include "createMRF.H"
142 #include "createFvOptions.H"
143 
144 
145 // This solver does not support moving mesh but it uses the pressure equation
146 // of one which does, so we need a dummy face-momentum field
147 autoPtr<surfaceVectorField> rhoUf(nullptr);
autoPtr< surfaceVectorField > rhoUf(nullptr)
forAll(Y, i)
Definition: createFields.H:105
const word & executable() const
Name of executable without the path.
Definition: argListI.H:36
pimpleNoLoopControl & pimple
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)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
CGAL::Exact_predicates_exact_constructions_kernel K
phi
Definition: pEqn.H:104
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:103
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
volScalarField & dpdt
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
pressureControl & pressureControl
Info<< "Creating reaction model\"<< endl;autoPtr< CombustionModel< psiReactionThermo > > reaction(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
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(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
static const char nl
Definition: Ostream.H:260
Info<< "Reading thermophysical properties\"<< endl;autoPtr< rhoReactionThermo > pThermo(rhoReactionThermo::New(mesh))
scalar pRef
Definition: createFields.H:19
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:325
Info<< "Creating thermophysical transport model\"<< endl;autoPtr< fluidThermophysicalTransportModel > thermophysicalTransport(fluidThermophysicalTransportModel::New(turbulence(), thermo))
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
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.
IOerror FatalIOError