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.lookup<scalar>("p");
22  scalar T0 = initialConditions.lookup<scalar>("T");
23 
24  #include "createBaseFields.H"
25 
26  Info<< "Reading thermophysical properties\n" << endl;
27  autoPtr<fluidReactionThermo> pThermo(fluidReactionThermo::New(mesh));
28  fluidReactionThermo& thermo = pThermo();
29  thermo.validate(args.executable(), "h");
30 
31  autoPtr<basicChemistryModel> pChemistry(basicChemistryModel::New(thermo));
32 
34  (
35  IOobject
36  (
37  "rho",
38  runTime.timeName(),
39  mesh,
40  IOobject::NO_READ,
41  IOobject::AUTO_WRITE
42  ),
43  thermo.rho()
44  );
45 
47  (
48  IOobject
49  (
50  "Rspecific",
51  runTime.timeName(),
52  mesh,
53  IOobject::NO_READ,
54  IOobject::AUTO_WRITE
55  ),
56  mesh,
58  (
59  dimensionSet(dimEnergy/dimMass/dimTemperature),
60  0
61  )
62  );
63 
65  (
66  IOobject
67  (
68  "U",
69  runTime.timeName(),
70  mesh,
71  IOobject::NO_READ,
72  IOobject::NO_WRITE
73  ),
74  mesh,
76  );
77 
78  #include "createPhi.H"
79 
80  OFstream post(args.path()/"chemFoam.out");
81  post<< "# Time" << token::TAB << "Temperature [K]" << token::TAB
82  << "Pressure [Pa]" << endl;
const word & executable() const
Name of executable without the path.
Definition: argListI.H:36
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
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:306
OFstream post(args.path()/"chemFoam.out")
Info<< "Reading thermophysical properties\"<< endl;autoPtr< fluidReactionThermo > pThermo(fluidReactionThermo::New(mesh))
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
volScalarField Rspecific(IOobject("Rspecific", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimensionSet(dimEnergy/dimMass/dimTemperature), 0))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
fvMesh & mesh
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
rho
Definition: createFields.H:81
static const zero Zero
Definition: zero.H:97
const dimensionSet dimVelocity
const dimensionSet dimEnergy
const dimensionSet dimMass
fileName path() const
Return the path to the caseName.
Definition: argListI.H:66
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
autoPtr< basicChemistryModel > pChemistry(basicChemistryModel::New(thermo))
Foam::argList args(argc, argv)
const dimensionSet dimTemperature