createFields.H
Go to the documentation of this file.
1 Info<< "Creating combustion model\n" << endl;
2 
3 autoPtr<combustionModels::psiCombustionModel> combustion
4 (
6 );
7 
8 psiReactionThermo& thermo = combustion->thermo();
9 thermo.validate(args.executable(), "h", "e");
10 
11 SLGThermo slgThermo(mesh, thermo);
12 
13 basicSpecieMixture& composition = thermo.composition();
14 PtrList<volScalarField>& Y = composition.Y();
15 
16 const word inertSpecie(thermo.lookup("inertSpecie"));
17 
18 if (!composition.contains(inertSpecie))
19 {
21  << "Specified inert specie '" << inertSpecie << "' not found in "
22  << "species list. Available species:" << composition.species()
23  << exit(FatalError);
24 }
25 
26 volScalarField& p = thermo.p();
27 const volScalarField& T = thermo.T();
28 const volScalarField& psi = thermo.psi();
29 
30 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
31 
32 forAll(Y, i)
33 {
34  fields.add(Y[i]);
35 }
36 fields.add(thermo.he());
37 
39 (
40  IOobject
41  (
42  "rho",
43  runTime.timeName(),
44  mesh,
45  IOobject::NO_READ,
46  IOobject::AUTO_WRITE
47  ),
48  thermo.rho()
49 );
50 
51 // lagrangian effective density field - used externally (optional)
53 (
54  IOobject
55  (
56  "rhoEffLagrangian",
57  runTime.timeName(),
58  mesh,
59  IOobject::NO_READ,
60  IOobject::AUTO_WRITE
61  ),
62  mesh,
63  dimensionedScalar("zero", dimDensity, 0.0)
64 );
65 
66 // dynamic pressure field - used externally (optional)
68 (
69  IOobject
70  (
71  "pDyn",
72  runTime.timeName(),
73  mesh,
74  IOobject::NO_READ,
75  IOobject::AUTO_WRITE
76  ),
77  mesh,
78  dimensionedScalar("zero", dimPressure, 0.0)
79 );
80 
81 
82 Info<< "\nReading field U\n" << endl;
84 (
85  IOobject
86  (
87  "U",
88  runTime.timeName(),
89  mesh,
90  IOobject::MUST_READ,
91  IOobject::AUTO_WRITE
92  ),
93  mesh
94 );
95 
96 #include "compressibleCreatePhi.H"
97 
98 mesh.setFluxRequired(p.name());
99 
100 Info<< "Creating turbulence model\n" << endl;
101 autoPtr<compressible::turbulenceModel> turbulence
102 (
104  (
105  rho,
106  U,
107  phi,
108  thermo
109  )
110 );
111 
112 // Set the turbulence into the combustion model
113 combustion->setTurbulence(turbulence());
114 
115 Info<< "Creating field dpdt\n" << endl;
117 (
118  IOobject
119  (
120  "dpdt",
121  runTime.timeName(),
122  mesh
123  ),
124  mesh,
125  dimensionedScalar("dpdt", 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  IOobject
134  (
135  "dQ",
136  runTime.timeName(),
137  mesh,
138  IOobject::NO_READ,
139  IOobject::AUTO_WRITE
140  ),
141  mesh,
143 );
volScalarField & dpdt
const dimensionSet dimPressure
volVectorField U(IOobject( "U", runTime.timeName(), runTime, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedVector("zero", dimVelocity, vector::zero), p.boundaryField().types())
surfaceScalarField & phi
Definition: createFields.H:13
volScalarField rhoEffLagrangian(IOobject( "rhoEffLagrangian", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero", dimDensity, 0.0))
Info<< "Creating combustion model\n"<< endl;autoPtr< combustionModels::psiCombustionModel > combustion(combustionModels::psiCombustionModel::New( mesh ))
Info<< "Creating field dpdt\n"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar("dpdt", p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\n"<< endl;volScalarField K("K", 0.5 *magSqr(U));volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);p_rgh=p-rho *gh;mesh.setFluxRequired(p_rgh.name());multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:127
CGAL::Exact_predicates_exact_constructions_kernel K
const word inertSpecie(thermo.lookup("inertSpecie"))
volScalarField pDyn(IOobject( "pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero", dimPressure, 0.0))
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Creates and initialises the face-flux field phi.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
const dimensionSet dimEnergy
messageStream Info
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
dynamicFvMesh & mesh
const dimensionSet dimDensity
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
volScalarField dQ(IOobject( "dQ", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("dQ", dimEnergy/dimTime, 0.0))
rho
Definition: createFields.H:79
SLGThermo slgThermo(mesh, thermo)
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
Foam::argList args(argc, argv)
error FatalError
forAll(Y, i)
Definition: createFields.H:129
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.