BUGFIX: Uninitialised member variables
[foam-extend-3.2.git] / applications / solvers / lagrangian / coalChemistryFoam / createFields.H
blob65be09775caccc5a228e74991dcdaf5bc150c368
1     Info<< "Reading thermophysical properties\n" << endl;
3     autoPtr<psiChemistryModel> pChemistry
4     (
5         psiChemistryModel::New(mesh)
6     );
7     psiChemistryModel& chemistry = pChemistry();
9     hsCombustionThermo& thermo = chemistry.thermo();
11     basicMultiComponentMixture& composition = thermo.composition();
12     PtrList<volScalarField>& Y = composition.Y();
14     word inertSpecie(thermo.lookup("inertSpecie"));
16     if (!composition.contains(inertSpecie))
17     {
18         FatalErrorIn(args.executable())
19             << "Specified inert specie '" << inertSpecie << "' not found in "
20             << "species list. Available species:" << composition.species()
21             << exit(FatalError);
22     }
24     volScalarField& p = thermo.p();
25     volScalarField& hs = thermo.hs();
26     const volScalarField& T = thermo.T();
27     const volScalarField& psi = thermo.psi();
29     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
31     forAll(Y, i)
32     {
33         fields.add(Y[i]);
34     }
35     fields.add(hs);
37     volScalarField rho
38     (
39         IOobject
40         (
41             "rho",
42             runTime.timeName(),
43             mesh,
44             IOobject::NO_READ,
45             IOobject::AUTO_WRITE
46         ),
47         thermo.rho()
48     );
50     // lagrangian effective density field - used externally (optional)
51     volScalarField rhoEffLagrangian
52     (
53         IOobject
54         (
55             "rhoEffLagrangian",
56             runTime.timeName(),
57             mesh,
58             IOobject::NO_READ,
59             IOobject::AUTO_WRITE
60         ),
61         mesh,
62         dimensionedScalar("zero", dimDensity, 0.0)
63     );
65     // dynamic pressure field - used externally (optional)
66     volScalarField pDyn
67     (
68         IOobject
69         (
70             "pDyn",
71             runTime.timeName(),
72             mesh,
73             IOobject::NO_READ,
74             IOobject::AUTO_WRITE
75         ),
76         mesh,
77         dimensionedScalar("zero", dimPressure, 0.0)
78     );
81     Info<< "\nReading field U\n" << endl;
82     volVectorField U
83     (
84         IOobject
85         (
86             "U",
87             runTime.timeName(),
88             mesh,
89             IOobject::MUST_READ,
90             IOobject::AUTO_WRITE
91         ),
92         mesh
93     );
95     #include "compressibleCreatePhi.H"
97     DimensionedField<scalar, volMesh> kappa
98     (
99         IOobject
100         (
101             "kappa",
102             runTime.timeName(),
103             mesh,
104             IOobject::NO_READ,
105             IOobject::AUTO_WRITE
106         ),
107         mesh,
108         dimensionedScalar("zero", dimless, 0.0)
109     );
111     Info<< "Creating turbulence model\n" << endl;
112     autoPtr<compressible::turbulenceModel> turbulence
113     (
114         compressible::turbulenceModel::New
115         (
116             rho,
117             U,
118             phi,
119             thermo
120         )
121     );
123     Info<< "Creating field DpDt\n" << endl;
124     volScalarField DpDt
125     (
126         "DpDt",
127         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
128     );
130     Info<< "\nConstructing explicit enthalpy source" << endl;
131     scalarTimeActivatedExplicitSourceList enthalpySource
132     (
133         "energy",
134         mesh,
135         dimEnergy/dimTime/dimVolume,
136         "hs"
137     );
139     DimensionedField<scalar, volMesh> chemistrySh
140     (
141         IOobject
142         (
143             "chemistry::Sh",
144             runTime.timeName(),
145             mesh,
146             IOobject::NO_READ,
147             IOobject::NO_WRITE
148         ),
149         mesh,
150         dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
151     );