createFields.H
Go to the documentation of this file.
1  if (mesh.nCells() != 1)
2  {
4  << "Solver only applicable to single cell cases"
5  << exit(FatalError);
6  }
7 
8  Info<< "Reading initial conditions.\n" << endl;
9  IOdictionary initialConditions
10  (
11  IOobject
12  (
13  "initialConditions",
14  runTime.constant(),
15  mesh,
16  IOobject::MUST_READ_IF_MODIFIED,
17  IOobject::NO_WRITE
18  )
19  );
20 
21  scalar p0 = initialConditions.get<scalar>("p");
22  scalar T0 = initialConditions.get<scalar>("T");
23 
24  #include "createBaseFields.H"
25 
26  Info<< "Reading thermophysical properties\n" << endl;
27  autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
28  psiReactionThermo& thermo = pThermo();
29  thermo.validate(args.executable(), "h");
30 
31  autoPtr<BasicChemistryModel<psiReactionThermo>> pChemistry
32  (
34  );
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 
50  (
51  IOobject
52  (
53  "Rspecific",
54  runTime.timeName(),
55  mesh,
56  IOobject::NO_READ,
57  IOobject::AUTO_WRITE
58  ),
59  mesh,
61  );
62 
64  (
65  IOobject
66  (
67  "U",
68  runTime.timeName(),
69  mesh,
70  IOobject::NO_READ,
71  IOobject::NO_WRITE
72  ),
73  mesh,
75  );
76 
77  #include "createPhi.H"
78 
79  OFstream post(args.path()/"chemFoam.out");
80  post<< "# Time" << token::TAB << "Temperature [K]" << token::TAB
81  << "Pressure [Pa]" << endl;
runTime
engineTime & runTime
Definition: createEngineTime.H:13
U
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::dimVelocity
const dimensionSet dimVelocity
Foam::dimEnergy
const dimensionSet dimEnergy
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
rho
rho
Definition: createFields.H:81
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
Foam::argList::executable
const word & executable() const
Name of executable without the path.
Definition: argListI.H:51
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
pChemistry
autoPtr< BasicChemistryModel< psiReactionThermo > > pChemistry(BasicChemistryModel< psiReactionThermo >::New(thermo))
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::argList::path
fileName path() const
Return the full path to the (processor local) case.
Definition: argListI.H:81
Foam::FatalError
error FatalError
post
OFstream post(args.path()/"chemFoam.out")
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:60
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:372
createBaseFields.H
Rspecific
volScalarField Rspecific(IOobject("Rspecific", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimEnergy/dimMass/dimTemperature, Zero))
Foam::dimTemperature
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:55
p0
const volScalarField & p0
Definition: EEqn.H:36
args
Foam::argList args(argc, argv)
T0
scalar T0
Definition: createFields.H:22
pThermo
Info<< "Reading thermophysical properties\n"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))