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;
Info<< "Reading thermophysical properties\"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
OFstream post(args.path()/"chemFoam.out")
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
psiReactionThermo & thermo
Definition: createFields.H:28
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
const word & executable() const noexcept
Name of executable without the path.
Definition: argListI.H:44
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
autoPtr< BasicChemistryModel< psiReactionThermo > > pChemistry(BasicChemistryModel< psiReactionThermo >::New(thermo))
const dimensionSet dimEnergy
fileName path() const
Return the full path to the (processor local) case.
Definition: argListI.H:74
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.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
volScalarField Rspecific(IOobject("Rspecific", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimEnergy/dimMass/dimTemperature, Zero))
Foam::argList args(argc, argv)
const volScalarField & p0
Definition: EEqn.H:36
scalar T0
Definition: createFields.H:22
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
const dimensionSet dimVelocity