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 (
33 BasicChemistryModel<psiReactionThermo>::New(thermo)
34 );
35
36 volScalarField rho
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
49 volScalarField Rspecific
50 (
51 IOobject
52 (
53 "Rspecific",
54 runTime.timeName(),
55 mesh,
56 IOobject::NO_READ,
57 IOobject::AUTO_WRITE
58 ),
59 mesh,
60 dimensionedScalar(dimEnergy/dimMass/dimTemperature, Zero)
61 );
62
63 volVectorField U
64 (
65 IOobject
66 (
67 "U",
68 runTime.timeName(),
69 mesh,
70 IOobject::NO_READ,
71 IOobject::NO_WRITE
72 ),
73 mesh,
74 dimensionedVector(dimVelocity, Zero)
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;
fileName path() const
Return the full path to the (processor local) case.
Definition: argListI.H:81
const word & executable() const noexcept
Name of executable without the path.
Definition: argListI.H:51
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
U
Definition: pEqn.H:72
const volScalarField & p0
Definition: EEqn.H:36
dynamicFvMesh & mesh
engineTime & runTime
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
Rspecific[0]
Foam::argList args(argc, argv)
autoPtr< BasicChemistryModel< psiReactionThermo > > pChemistry(BasicChemistryModel< psiReactionThermo >::New(thermo))
Info<< "Reading thermophysical properties\n"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))
OFstream post(args.path()/"chemFoam.out")
scalar T0
Definition: createFields.H:22