Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / applications / solvers / combustion / PDRFoam / createFields.H
blob15a0ecafea7dd4bca89b0f84d13e876ed5995e49
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();
33     Info<< "\nReading field U\n" << endl;
34     volVectorField U
35     (
36         IOobject
37         (
38             "U",
39             runTime.timeName(),
40             mesh,
41             IOobject::MUST_READ,
42             IOobject::AUTO_WRITE
43         ),
44         mesh
45     );
47 #   include "compressibleCreatePhi.H"
49     Info<< "Creating turbulence model\n" << endl;
50     autoPtr<compressible::RASModel> turbulence
51     (
52         compressible::RASModel::New
53         (
54             rho,
55             U,
56             phi,
57             thermo
58         )
59     );
61     Info<< "Creating field DpDt\n" << endl;
62     volScalarField DpDt
63     (
64         "DpDt",
65         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
66     );
69     Info<< "Creating the unstrained laminar flame speed\n" << endl;
70     autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
71     (
72         laminarFlameSpeed::New(thermo)
73     );
76     Info<< "Reading strained laminar flame speed field Su\n" << endl;
77     volScalarField Su
78     (
79         IOobject
80         (
81             "Su",
82             runTime.timeName(),
83             mesh,
84             IOobject::MUST_READ,
85             IOobject::AUTO_WRITE
86         ),
87         mesh
88     );
90     Info<< "Reading field betav\n" << endl;
91     volScalarField betav
92     (
93         IOobject
94         (
95             "betav",
96             mesh.facesInstance(),
97             mesh,
98             IOobject::MUST_READ,
99             IOobject::NO_WRITE
100         ),
101         mesh
102     );
104     Info<< "Reading field Lobs\n" << endl;
105     volScalarField Lobs
106     (
107         IOobject
108         (
109             "Lobs",
110             mesh.facesInstance(),
111             mesh,
112             IOobject::MUST_READ,
113             IOobject::NO_WRITE
114         ),
115         mesh
116     );
118     Info<< "Reading field CT\n" << endl;
119     volSymmTensorField CT
120     (
121         IOobject
122         (
123             "CT",
124             mesh.facesInstance(),
125             mesh,
126             IOobject::MUST_READ,
127             IOobject::NO_WRITE
128         ),
129         mesh
130     );
132     IOdictionary PDRProperties
133     (
134         IOobject
135         (
136             "PDRProperties",
137             runTime.constant(),
138             mesh,
139             IOobject::MUST_READ_IF_MODIFIED,
140             IOobject::NO_WRITE
141         )
142     );
144     //- Create the drag model
145     autoPtr<PDRDragModel> drag = PDRDragModel::New
146     (
147         PDRProperties,
148         turbulence,
149         rho,
150         U,
151         phi
152     );
154     //- Create the flame-wrinkling model
155     autoPtr<XiModel> flameWrinkling = XiModel::New
156     (
157         PDRProperties,
158         thermo,
159         turbulence,
160         Su,
161         rho,
162         b,
163         phi
164     );
166     Info<< "Calculating turbulent flame speed field St\n" << endl;
167     volScalarField St
168     (
169         IOobject
170         (
171             "St",
172             runTime.timeName(),
173             mesh,
174             IOobject::NO_READ,
175             IOobject::AUTO_WRITE
176         ),
177         flameWrinkling->Xi()*Su
178     );
181     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
183     if (composition.contains("ft"))
184     {
185         fields.add(composition.Y("ft"));
186     }
188     fields.add(b);
189     fields.add(h);
190     fields.add(hu);
191     flameWrinkling->addXi(fields);