initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / combustion / PDRFoam / createFields.H
blob74a18ab6f5affe39d56ff90d41f084cd6e09e4f3
1     Info<< "Reading thermophysical properties\n" << endl;
3     autoPtr<hhuCombustionThermo> pThermo
4     (
5         hhuCombustionThermo::New(mesh)
6     );
7     hhuCombustionThermo& thermo = pThermo();
8     basicMultiComponentMixture& composition = thermo.composition();
10     volScalarField rho
11     (
12         IOobject
13         (
14             "rho",
15             runTime.timeName(),
16             mesh,
17             IOobject::NO_READ,
18             IOobject::AUTO_WRITE
19         ),
20         thermo.rho()
21     );
23     volScalarField& p = thermo.p();
24     const volScalarField& psi = thermo.psi();
25     volScalarField& h = thermo.h();
26     volScalarField& hu = thermo.hu();
28     volScalarField& b = composition.Y("b");
29     Info<< "min(b) = " << min(b).value() << endl;
31     //const volScalarField& T = thermo->T();
34     Info<< "\nReading field U\n" << endl;
35     volVectorField U
36     (
37         IOobject
38         (
39             "U",
40             runTime.timeName(),
41             mesh,
42             IOobject::MUST_READ,
43             IOobject::AUTO_WRITE
44         ),
45         mesh
46     );
48 #   include "compressibleCreatePhi.H"
50     Info<< "Creating turbulence model\n" << endl;
51     autoPtr<compressible::RASModel> turbulence
52     (
53         compressible::RASModel::New
54         (
55             rho,
56             U,
57             phi,
58             thermo
59         )
60     );
62     Info<< "Creating field DpDt\n" << endl;
63     volScalarField DpDt
64     (
65         "DpDt",
66         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
67     );
70     Info<< "Creating the unstrained laminar flame speed\n" << endl;
71     autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
72     (
73         laminarFlameSpeed::New(thermo)
74     );
77     Info<< "Reading strained laminar flame speed field Su\n" << endl;
78     volScalarField Su
79     (
80         IOobject
81         (
82             "Su",
83             runTime.timeName(),
84             mesh,
85             IOobject::MUST_READ,
86             IOobject::AUTO_WRITE
87         ),
88         mesh
89     );
91     Info<< "Reading field betav\n" << endl;
92     volScalarField betav
93     (
94         IOobject
95         (
96             "betav",
97             runTime.findInstance(polyMesh::meshSubDir, "betav"),
98             polyMesh::meshSubDir,
99             mesh,
100             IOobject::MUST_READ,
101             IOobject::NO_WRITE
102         ),
103         mesh
104     );
106     IOdictionary PDRProperties
107     (
108         IOobject
109         (
110             "PDRProperties",
111             runTime.constant(),
112             mesh,
113             IOobject::MUST_READ,
114             IOobject::NO_WRITE
115         )
116     );
118     //- Create the drag model
119     autoPtr<PDRDragModel> drag = PDRDragModel::New
120     (
121         PDRProperties,
122         turbulence,
123         rho,
124         U,
125         phi
126     );
128     //- Create the flame-wrinkling model
129     autoPtr<XiModel> flameWrinkling = XiModel::New
130     (
131         PDRProperties,
132         thermo,
133         turbulence,
134         Su,
135         rho,
136         b,
137         phi
138     );
140     Info<< "Calculating turbulent flame speed field St\n" << endl;
141     volScalarField St
142     (
143         IOobject
144         (
145             "St",
146             runTime.timeName(),
147             mesh,
148             IOobject::NO_READ,
149             IOobject::AUTO_WRITE
150         ),
151         flameWrinkling->Xi()*Su
152     );
155     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
157     if (composition.contains("ft"))
158     {
159         fields.add(composition.Y("ft"));
160     }
162     fields.add(b);
163     fields.add(h);
164     fields.add(hu);
165     flameWrinkling->addXi(fields);