initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / lagrangian / coalChemistryFoam / createFields.H
blobbba39fe8627d330b08eab8f586835fbe37449e39
1     Info<< "Reading thermophysical properties\n" << endl;
3     autoPtr<psiChemistryModel> pChemistry
4     (
5         psiChemistryModel::New(mesh)
6     );
7     psiChemistryModel& chemistry = pChemistry();
9     hCombustionThermo& thermo = chemistry.thermo();
11     basicMultiComponentMixture& composition = thermo.composition();
12     PtrList<volScalarField>& Y = composition.Y();
14     word inertSpecie(thermo.lookup("inertSpecie"));
16     volScalarField& p = thermo.p();
17     volScalarField& h = thermo.h();
18     const volScalarField& T = thermo.T();
19     const volScalarField& psi = thermo.psi();
21     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
23     forAll (Y, i)
24     {
25         fields.add(Y[i]);
26     }
27     fields.add(h);
29     volScalarField rho
30     (
31         IOobject
32         (
33             "rho",
34             runTime.timeName(),
35             mesh,
36             IOobject::NO_READ,
37             IOobject::AUTO_WRITE
38         ),
39         thermo.rho()
40     );
42     // lagrangian effective density field - used externally (optional)
43     volScalarField rhoEffLagrangian
44     (
45         IOobject
46         (
47             "rhoEffLagrangian",
48             runTime.timeName(),
49             mesh,
50             IOobject::NO_READ,
51             IOobject::AUTO_WRITE
52         ),
53         mesh,
54         dimensionedScalar("zero", dimDensity, 0.0)
55     );
57     // dynamic pressure field - used externally (optional)
58     volScalarField pDyn
59     (
60         IOobject
61         (
62             "pDyn",
63             runTime.timeName(),
64             mesh,
65             IOobject::NO_READ,
66             IOobject::AUTO_WRITE
67         ),
68         mesh,
69         dimensionedScalar("zero", dimPressure, 0.0)
70     );
73     Info<< "\nReading field U\n" << endl;
74     volVectorField U
75     (
76         IOobject
77         (
78             "U",
79             runTime.timeName(),
80             mesh,
81             IOobject::MUST_READ,
82             IOobject::AUTO_WRITE
83         ),
84         mesh
85     );
87     #include "compressibleCreatePhi.H"
89     DimensionedField<scalar, volMesh> kappa
90     (
91         IOobject
92         (
93             "kappa",
94             runTime.timeName(),
95             mesh,
96             IOobject::NO_READ,
97             IOobject::AUTO_WRITE
98         ),
99         mesh,
100         dimensionedScalar("zero", dimless, 0.0)
101     );
103     Info<< "Creating turbulence model\n" << endl;
104     autoPtr<compressible::turbulenceModel> turbulence
105     (
106         compressible::turbulenceModel::New
107         (
108             rho,
109             U,
110             phi,
111             thermo
112         )
113     );
115     Info<< "Creating field DpDt\n" << endl;
116     volScalarField DpDt
117     (
118         "DpDt",
119         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
120     );
122     Info<< "\nConstructing explicit enthalpy cell source" << endl;
123     timeActivatedExplicitCellSource enthalpySource
124     (
125         "enthalpySource",
126         mesh,
127         h.dimensions()*phi.dimensions()/mesh.V().dimensions()
128     );