FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1 Info<< "Reading thermophysical properties\n" << endl;
2 
3 autoPtr<hsCombustionThermo> pThermo
4 (
5  hsCombustionThermo::New(mesh)
6 );
7 
8 hsCombustionThermo& thermo = pThermo();
9 
10 basicMultiComponentMixture& composition = thermo.composition();
11 
13 (
14  IOobject
15  (
16  "rho",
17  runTime.timeName(),
18  mesh,
19  IOobject::NO_READ,
20  IOobject::AUTO_WRITE
21  ),
22  thermo.rho()
23 );
24 
26 (
27  thermo.lookup("stoichiometricAirFuelMassRatio")
28 );
29 
30 volScalarField& p = thermo.p();
31 volScalarField& hs = thermo.hs();
32 
33 const volScalarField& psi = thermo.psi();
34 
35 volScalarField& ft = composition.Y("ft");
36 volScalarField& fu = composition.Y("fu");
37 
38 
39 Info<< "Reading field U\n" << endl;
40 
42 (
43  IOobject
44  (
45  "U",
46  runTime.timeName(),
47  mesh,
48  IOobject::MUST_READ,
49  IOobject::AUTO_WRITE
50  ),
51  mesh
52 );
53 
55 
56 Info<< "Creating turbulence model\n" << endl;
57 autoPtr<compressible::turbulenceModel> turbulence
58 (
59  compressible::turbulenceModel::New(rho, U, phi, thermo)
60 );
61 
62 IOdictionary combustionProperties
63 (
64  IOobject
65  (
66  "combustionProperties",
67  runTime.constant(),
68  mesh,
69  IOobject::MUST_READ,
70  IOobject::NO_WRITE
71  )
72 );
73 
74 Info<< "Creating combustion model\n" << endl;
75 autoPtr<combustionModel> combustion
76 (
77  combustionModel::combustionModel::New
78  (
80  thermo,
81  turbulence(),
82  phi,
83  rho
84  )
85 );
86 
87 
88 Info<< "Calculating field g.h\n" << endl;
89 volScalarField gh("gh", g & mesh.C());
90 surfaceScalarField ghf("gh", g & mesh.Cf());
91 
92 Info<< "Reading field p_rgh\n" << endl;
94 (
95  IOobject
96  (
97  "p_rgh",
98  runTime.timeName(),
99  mesh,
100  IOobject::MUST_READ,
101  IOobject::AUTO_WRITE
102  ),
103  mesh
104 );
105 
106 // Force p_rgh to be consistent with p
107 p_rgh = p - rho*gh;
108 
109 
111 (
112  IOobject
113  (
114  "dQ",
115  runTime.timeName(),
116  mesh,
117  IOobject::NO_READ,
118  IOobject::AUTO_WRITE
119  ),
120  mesh,
122 );
123 
124 
125 Info<< "Creating field DpDt\n" << endl;
128 
129 
131 
132 
133 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
134 
135 if (composition.contains("ft"))
136 {
137  fields.add(composition.Y("ft"));
138 }
139 
140 if (composition.contains("fu"))
141 {
142  fields.add(composition.Y("fu"));
143 }
144 
145 fields.add(hs);