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 
51  volScalarField& p = thermo.p();
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;
volVectorField U(IOobject( "U", runTime.timeName(), runTime, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedVector("zero", dimVelocity, vector::zero), p.boundaryField().types())
#define readScalar
Definition: doubleScalar.C:38
fileName path() const
Return the path to the caseName.
Definition: argListI.H:60
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
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/dm2/henry/OpenFOAM/OpenFOAM-3.0.x/applications/solvers/combustion/chemFoam/createFields.H"2 Info<< nl<< "Reading thermophysicalProperties"<< endl;autoPtr< psiChemistryModel > pChemistry(psiChemistryModel::New(mesh))
const dimensionSet dimEnergy
messageStream Info
dynamicFvMesh & mesh
OFstream post(args.path()/"chemFoam.out")
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
rho
Definition: createFields.H:79
const word & executable() const
Name of executable without the path.
Definition: argListI.H:30
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
Foam::argList args(argc, argv)
error FatalError
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
psiChemistryModel & chemistry
Definition: createFields.H:29
volScalarField Rspecific(IOobject( "Rspecific", runTime.timeName(), runTime, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar( "zero", dimensionSet(dimEnergy/dimMass/dimTemperature), 0.0 ))
const dimensionSet dimVelocity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.