Initial release of the new fireFoam solver and ancillary libraries.
[OpenFOAM-1.6.x.git] / applications / solvers / combustion / fireFoam / createFields.H
blob13c43fdbf777f2c5e5811abd73cf50e0b04eae7c
1 Info<< "Reading thermophysical properties\n" << endl;
3 autoPtr<hsCombustionThermo> pThermo
5     hsCombustionThermo::New(mesh)
6 );
8 hsCombustionThermo& thermo = pThermo();
10 basicMultiComponentMixture& composition = thermo.composition();
12 volScalarField rho
14     IOobject
15     (
16         "rho",
17         runTime.timeName(),
18         mesh,
19         IOobject::NO_READ,
20         IOobject::AUTO_WRITE
21     ),
22     thermo.rho()
25 dimensionedScalar stoicRatio
27     thermo.lookup("stoichiometricAirFuelMassRatio")
30 volScalarField& p = thermo.p();
31 volScalarField& hs = thermo.hs();
33 const volScalarField& psi = thermo.psi();
35 volScalarField& ft = composition.Y("ft");
36 volScalarField& fu = composition.Y("fu");
38 Info<< "Reading field U\n" << endl;
40 volVectorField U
42     IOobject
43     (
44         "U",
45         runTime.timeName(),
46         mesh,
47         IOobject::MUST_READ,
48         IOobject::AUTO_WRITE
49     ),
50     mesh
53 #include "compressibleCreatePhi.H"
55 Info<< "Creating turbulence model\n" << endl;
56 autoPtr<compressible::turbulenceModel> turbulence
58     compressible::turbulenceModel::New(rho, U, phi, thermo)
61 IOdictionary combustionProperties
63     IOobject
64     (
65         "combustionProperties",
66         runTime.constant(),
67         mesh,
68         IOobject::MUST_READ,
69         IOobject::NO_WRITE
70     )
73 Info<< "Creating combustion model\n" << endl;
74 autoPtr<combustionModel::combustionModel> combustion
76     combustionModel::combustionModel::New
77     (
78         combustionProperties,
79         thermo,
80         turbulence(),
81         phi,
82         rho
83     )
86 volScalarField dQ
88     IOobject
89     (
90         "dQ",
91         runTime.timeName(),
92         mesh,
93         IOobject::NO_READ,
94         IOobject::AUTO_WRITE
95     ),
96     mesh,
97     dimensionedScalar("dQ", dimMass/pow3(dimTime)/dimLength, 0.0)
100 Info<< "Creating field dpdt\n" << endl;
101 volScalarField dpdt = fvc::ddt(p);
104 Info<< "Calculating field g.h\n" << endl;
105 volScalarField gh("gh", g & mesh.C());
107 surfaceScalarField ghf("gh", g & mesh.Cf());
109 p += rho*gh;
111 thermo.correct();
113 dimensionedScalar initialMass = fvc::domainIntegrate(rho);
116 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
118 if (composition.contains("ft"))
120     fields.add(composition.Y("ft"));
123 if (composition.contains("fu"))
125     fields.add(composition.Y("fu"));
128 fields.add(hs);