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 = readScalar(initialConditions.lookup("p"));
22  scalar T0 = readScalar(initialConditions.lookup("T"));
23 
24  #include "createBaseFields.H"
25 
26  Info<< "Reading thermophysical properties\n" << endl;
27  autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
28  rhoReactionThermo& thermo = pThermo();
29  thermo.validate(args.executable(), "h");
30 
31  autoPtr<BasicChemistryModel<rhoReactionThermo>> 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  "zero",
63  dimensionSet(dimEnergy/dimMass/dimTemperature),
64  0.0
65  )
66  );
67 
69  (
70  IOobject
71  (
72  "U",
73  runTime.timeName(),
74  mesh,
75  IOobject::NO_READ,
76  IOobject::NO_WRITE
77  ),
78  mesh,
80  );
81 
82  #include "createPhi.H"
83 
84  OFstream post(args.path()/"chemFoam.out");
85  post<< "# Time" << token::TAB << "Temperature [K]" << token::TAB
86  << "Pressure [Pa]" << endl;
#define readScalar
Definition: doubleScalar.C:38
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
OFstream post(args.path()/"chemFoam.out")
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-6/applications/solvers/combustion/chemFoam/createFields.H" 2 Info<< "Reading thermophysical properties\"<< endl;autoPtr< rhoReactionThermo > pThermo(rhoReactionThermo::New(mesh))
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
volScalarField Rspecific(IOobject("Rspecific", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimensionSet(dimEnergy/dimMass/dimTemperature), 0.0))
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
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
static const zero Zero
Definition: zero.H:97
autoPtr< BasicChemistryModel< rhoReactionThermo > > pChemistry(BasicChemistryModel< rhoReactionThermo >::New(thermo))
const dimensionSet dimEnergy
fileName path() const
Return the path to the caseName.
Definition: argListI.H:60
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
messageStream Info
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
Foam::argList args(argc, argv)
const dimensionSet dimVelocity