createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 Info<< "Reading thermophysical properties\n" << endl;
4 autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
5 psiReactionThermo& 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() << exit(FatalIOError);
17 }
18 
20 (
21  IOobject
22  (
23  "rho",
24  runTime.timeName(),
25  mesh
26  ),
27  thermo.rho()
28 );
29 
30 Info<< "Reading field U\n" << endl;
32 (
33  IOobject
34  (
35  "U",
36  runTime.timeName(),
37  mesh,
38  IOobject::MUST_READ,
39  IOobject::AUTO_WRITE
40  ),
41  mesh
42 );
43 
44 volScalarField& p = thermo.p();
45 
46 #include "compressibleCreatePhi.H"
47 
48 pressureControl pressureControl(p, rho, pimple.dict(), false);
49 
50 mesh.setFluxRequired(p.name());
51 
52 Info << "Creating turbulence model.\n" << nl;
53 autoPtr<compressible::turbulenceModel> turbulence
54 (
56  (
57  rho,
58  U,
59  phi,
60  thermo
61  )
62 );
63 
64 Info<< "Creating reaction model\n" << endl;
65 autoPtr<CombustionModel<psiReactionThermo>> reaction
66 (
68 );
69 
70 Info<< "Creating field dpdt\n" << endl;
72 (
73  IOobject
74  (
75  "dpdt",
76  runTime.timeName(),
77  mesh
78  ),
79  mesh,
80  dimensionedScalar(p.dimensions()/dimTime, 0)
81 );
82 
83 Info<< "Creating field kinetic energy K\n" << endl;
84 volScalarField K("K", 0.5*magSqr(U));
85 
86 
87 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
88 
89 forAll(Y, i)
90 {
91  fields.add(Y[i]);
92 }
93 fields.add(thermo.he());
94 
95 #include "createMRF.H"
96 #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
pimpleNoLoopControl & pimple
surfaceScalarField & phi
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
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
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
pressureControl & pressureControl
Info<< "Creating reaction model\"<< endl;autoPtr< CombustionModel< psiReactionThermo > > reaction(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
dimensioned< scalar > magSqr(const dimensioned< Type > &)
static const char nl
Definition: Ostream.H:265
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:325
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
messageStream Info
Foam::argList args(argc, argv)
const word inertSpecie(thermo.lookup("inertSpecie"))
Creates and initialises the face-flux field phi.
IOerror FatalIOError