createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 #include "readGravitationalAcceleration.H"
4 
5 Info<< "Reading thermophysical properties\n" << endl;
6 autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
7 psiReactionThermo& thermo = pThermo();
8 thermo.validate(args.executable(), "h", "e");
9 
10 SLGThermo slgThermo(mesh, thermo);
11 
12 basicSpecieMixture& composition = thermo.composition();
13 PtrList<volScalarField>& Y = composition.Y();
14 
15 const word inertSpecie(thermo.lookup("inertSpecie"));
16 if (!composition.species().found(inertSpecie))
17 {
19  << "Inert specie " << inertSpecie << " not found in available species "
20  << composition.species()
21  << exit(FatalIOError);
22 }
23 
24 volScalarField& p = thermo.p();
25 const volScalarField& T = thermo.T();
26 const volScalarField& psi = thermo.psi();
27 
28 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
29 
30 forAll(Y, i)
31 {
32  fields.add(Y[i]);
33 }
34 fields.add(thermo.he());
35 
37 (
38  IOobject
39  (
40  "rho",
41  runTime.timeName(),
42  mesh,
43  IOobject::NO_READ,
44  IOobject::AUTO_WRITE
45  ),
46  thermo.rho()
47 );
48 
49 // lagrangian effective density field - used externally (optional)
51 (
52  IOobject
53  (
54  "rhoEffLagrangian",
55  runTime.timeName(),
56  mesh,
57  IOobject::NO_READ,
58  IOobject::AUTO_WRITE
59  ),
60  mesh,
62 );
63 
64 // dynamic pressure field - used externally (optional)
66 (
67  IOobject
68  (
69  "pDyn",
70  runTime.timeName(),
71  mesh,
72  IOobject::NO_READ,
73  IOobject::AUTO_WRITE
74  ),
75  mesh,
77 );
78 
79 
80 Info<< "\nReading field U\n" << endl;
82 (
83  IOobject
84  (
85  "U",
86  runTime.timeName(),
87  mesh,
88  IOobject::MUST_READ,
89  IOobject::AUTO_WRITE
90  ),
91  mesh
92 );
93 
94 #include "compressibleCreatePhi.H"
95 
96 mesh.setFluxRequired(p.name());
97 
98 Info<< "Creating turbulence model\n" << endl;
99 autoPtr<compressible::turbulenceModel> turbulence
100 (
102  (
103  rho,
104  U,
105  phi,
106  thermo
107  )
108 );
109 
110 Info<< "Creating combustion model\n" << endl;
111 autoPtr<CombustionModel<psiReactionThermo>> combustion
112 (
114 );
115 
116 Info<< "Creating field dpdt\n" << endl;
118 (
119  IOobject
120  (
121  "dpdt",
122  runTime.timeName(),
123  mesh
124  ),
125  mesh,
126  dimensionedScalar(p.dimensions()/dimTime, 0)
127 );
128 
129 Info<< "Creating field kinetic energy K\n" << endl;
130 volScalarField K("K", 0.5*magSqr(U));
131 
132 #include "createMRF.H"
133 #include "createClouds.H"
134 #include "createRadiationModel.H"
135 #include "createFvOptions.H"
forAll(Y, i)
Definition: createFields.H:99
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-7/applications/solvers/combustion/chemFoam/createFields.H" 2 Info<< "Reading thermophysical properties\"<< endl;autoPtr< rhoReactionThermo > pThermo(rhoReactionThermo::New(mesh))
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
SLGThermo slgThermo(mesh, thermo)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
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::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
CGAL::Exact_predicates_exact_constructions_kernel K
volScalarField rhoEffLagrangian(IOobject("rhoEffLagrangian", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimDensity, 0))
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
dynamicFvMesh & mesh
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimPressure, 0))
const dimensionSet dimPressure
dimensioned< scalar > magSqr(const dimensioned< Type > &)
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:325
const dimensionSet dimDensity
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.
IOerror FatalIOError