createFields.H
Go to the documentation of this file.
1 Info<< "Reading thermophysical properties\n" << endl;
2 autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
3 psiReactionThermo& thermo = pThermo();
4 thermo.validate(args.executable(), "h", "e");
5 
6 SLGThermo slgThermo(mesh, thermo);
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 
20 Info<< "Creating field rho\n" << endl;
22 (
23  IOobject
24  (
25  "rho",
26  runTime.timeName(),
27  mesh,
28  IOobject::NO_READ,
29  IOobject::AUTO_WRITE
30  ),
31  thermo.rho()
32 );
33 
34 volScalarField& p = thermo.p();
35 
36 Info<< "\nReading 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 #include "compressibleCreatePhi.H"
51 
52 #include "createMRF.H"
53 
54 
55 Info<< "Creating turbulence model\n" << endl;
56 autoPtr<compressible::momentumTransportModel> turbulence
57 (
59  (
60  rho,
61  U,
62  phi,
63  thermo
64  )
65 );
66 
67 Info<< "Creating thermophysical transport model\n" << endl;
68 autoPtr<psiReactionThermophysicalTransportModel> thermophysicalTransport
69 (
71 );
72 
73 Info<< "Creating combustion model\n" << endl;
74 autoPtr<CombustionModel<psiReactionThermo>> combustion
75 (
77 );
78 
79 
80 #include "readGravitationalAcceleration.H"
81 #include "readhRef.H"
82 #include "gh.H"
83 #include "readpRef.H"
84 
86 (
87  IOobject
88  (
89  "p_rgh",
90  runTime.timeName(),
91  mesh,
92  IOobject::MUST_READ,
93  IOobject::AUTO_WRITE
94  ),
95  mesh
96 );
97 
98 mesh.setFluxRequired(p_rgh.name());
99 
100 #include "phrghEqn.H"
101 
102 
103 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
104 
105 forAll(Y, i)
106 {
107  fields.add(Y[i]);
108 }
109 fields.add(thermo.he());
110 
111 IOdictionary additionalControlsDict
112 (
113  IOobject
114  (
115  "additionalControls",
116  runTime.constant(),
117  mesh,
118  IOobject::MUST_READ_IF_MODIFIED,
119  IOobject::NO_WRITE
120  )
121 );
122 
123 Switch solvePrimaryRegion
124 (
125  additionalControlsDict.lookup("solvePrimaryRegion")
126 );
127 
128 Info<< "Creating field dpdt\n" << endl;
130 (
131  IOobject
132  (
133  "dpdt",
134  runTime.timeName(),
135  mesh
136  ),
137  mesh,
138  dimensionedScalar(p.dimensions()/dimTime, 0)
139 );
140 
141 Info<< "Creating field kinetic energy K\n" << endl;
142 volScalarField K("K", 0.5*magSqr(U));
143 
144 #include "createClouds.H"
145 #include "createSurfaceFilmModel.H"
146 #include "createRadiationModel.H"
147 #include "createFvOptions.H"
Switch solvePrimaryRegion(additionalControlsDict.lookup("solvePrimaryRegion"))
forAll(Y, i)
Definition: createFields.H:105
const word & executable() const
Name of executable without the path.
Definition: argListI.H:36
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)
SLGThermo slgThermo(mesh, thermo)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
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)
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
Info<< "Reading thermophysical properties\"<< endl;autoPtr< rhoReactionThermo > pThermo(rhoReactionThermo::New(mesh))
#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))
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.
IOdictionary additionalControlsDict(IOobject("additionalControls", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE))
IOerror FatalIOError