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  runTime,
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<< nl << "Reading thermophysicalProperties" << endl;
27  autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
28 
29  psiChemistryModel& chemistry = pChemistry();
30  scalar dtChem = refCast<const psiChemistryModel>(chemistry).deltaTChem()[0];
31 
32  psiReactionThermo& thermo = chemistry.thermo();
33  thermo.validate(args.executable(), "h");
34 
35  basicMultiComponentMixture& composition = thermo.composition();
36  PtrList<volScalarField>& Y = composition.Y();
37 
39  (
40  IOobject
41  (
42  "rho",
43  runTime.timeName(),
44  runTime,
45  IOobject::NO_READ,
46  IOobject::AUTO_WRITE
47  ),
48  thermo.rho()
49  );
50 
52 
54  (
55  IOobject
56  (
57  "Rspecific",
58  runTime.timeName(),
59  runTime,
60  IOobject::NO_READ,
61  IOobject::AUTO_WRITE
62  ),
63  mesh,
65  (
66  "zero",
67  dimensionSet(dimEnergy/dimMass/dimTemperature),
68  0.0
69  )
70  );
71 
73  (
74  IOobject
75  (
76  "U",
77  runTime.timeName(),
78  runTime,
79  IOobject::NO_READ,
80  IOobject::NO_WRITE
81  ),
82  mesh,
83  dimensionedVector("zero", dimVelocity, vector::zero),
84  p.boundaryField().types()
85  );
86 
87  #include "createPhi.H"
88 
89  OFstream post(args.path()/"chemFoam.out");
90  post<< "# Time" << token::TAB << "Temperature [K]" << token::TAB
91  << "Pressure [Pa]" << endl;
Foam::compressible::New
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Definition: turbulentFluidThermoModel.C:36
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:79
pChemistry
Info<< "Reading initial conditions.\n"<< endl;IOdictionary initialConditions(IOobject("initialConditions", runTime.constant(), runTime, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE));scalar p0=readScalar(initialConditions.lookup("p"));scalar T0=readScalar(initialConditions.lookup("T"));# 24 "/home/chenjia/OpenFOAM/OpenFOAM-v3.0plus/applications/solvers/combustion/chemFoam/createFields.H" 2 Info<< nl<< "Reading thermophysicalProperties"<< endl;autoPtr< psiChemistryModel > pChemistry(psiChemistryModel::New(mesh))
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
chemistry
psiChemistryModel & chemistry
Definition: createFields.H:29
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:48
Foam::argList::executable
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dtChem
scalar dtChem
Definition: createFields.H:30
Foam::argList::path
fileName path() const
Return the path to the caseName.
Definition: argListI.H:60
Foam::FatalError
error FatalError
post
OFstream post(args.path()/"chemFoam.out")
p
volScalarField & p
Definition: createFields.H:51
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
readScalar
#define readScalar
Definition: doubleScalar.C:38
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
createBaseFields.H
composition
basicMultiComponentMixture & composition
Definition: createFields.H:35
Foam::dimTemperature
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
Rspecific
volScalarField Rspecific(IOobject("Rspecific", runTime.timeName(), runTime, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimensionSet(dimEnergy/dimMass/dimTemperature), 0.0))
args
Foam::argList args(argc, argv)
U
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), Urel+SRF->U())
Y
PtrList< volScalarField > & Y
Definition: createFields.H:36