ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / applications / solvers / combustion / XiFoam / createFields.H
blobef16bd615c9bef3cfd86788e8fbd5a8a2bb879f3
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"
51     Info<< "Creating turbulence model\n" << endl;
52     autoPtr<compressible::turbulenceModel> turbulence
53     (
54         compressible::turbulenceModel::New
55         (
56             rho,
57             U,
58             phi,
59             thermo
60         )
61     );
63     Info<< "Creating field DpDt\n" << endl;
64     volScalarField DpDt =
65         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
68     Info<< "Creating field Xi\n" << endl;
69     volScalarField Xi
70     (
71         IOobject
72         (
73             "Xi",
74             runTime.timeName(),
75             mesh,
76             IOobject::MUST_READ,
77             IOobject::AUTO_WRITE
78         ),
79         mesh
80     );
83     Info<< "Creating the unstrained laminar flame speed\n" << endl;
84     autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
85     (
86         laminarFlameSpeed::New(thermo)
87     );
90     Info<< "Reading strained laminar flame speed field Su\n" << endl;
91     volScalarField Su
92     (
93         IOobject
94         (
95             "Su",
96             runTime.timeName(),
97             mesh,
98             IOobject::MUST_READ,
99             IOobject::AUTO_WRITE
100         ),
101         mesh
102     );
104     dimensionedScalar SuMin = 0.01*Su.average();
105     dimensionedScalar SuMax = 4*Su.average();
107     Info<< "Calculating turbulent flame speed field St\n" << endl;
108     volScalarField St
109     (
110         IOobject
111         (
112             "St",
113             runTime.timeName(),
114             mesh,
115             IOobject::NO_READ,
116             IOobject::AUTO_WRITE
117         ),
118         Xi*Su
119     );
122     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
124     if (composition.contains("ft"))
125     {
126         fields.add(composition.Y("ft"));
127     }
129     fields.add(b);
130     fields.add(h);
131     fields.add(hu);