createMDFields.H
Go to the documentation of this file.
1 // Fields for data gathering
2 
4 (
5  molecules.potential().nIds(),
6  scalarField (mesh.nCells(), 0.0)
7 );
8 
10 (
11  molecules.potential().nIds(),
12  scalarField (mesh.nCells(), 0.0)
13 );
14 
16 (
17  molecules.potential().nIds(),
18  vectorField (mesh.nCells(), vector::zero)
19 );
20 
22 (
23  molecules.potential().nIds(),
24  scalarField (mesh.nCells(), 0.0)
25 );
26 
27 // Geometric Fields for IO
28 
29 Info << nl << "Creating fields." << endl;
30 
31 /*---------------------------------------------------------------------------*\
32  Number density
33 \*---------------------------------------------------------------------------*/
34 
35 PtrList<volScalarField> allSpeciesRhoN
36 (
37  molecules.potential().nIds()
38 );
39 
41 {
42  Info<< " Creating number density field for "
43  << molecules.potential().idList()[rN] << endl;
44 
45  allSpeciesRhoN.set
46  (
47  rN,
48  new volScalarField
49  (
50  IOobject
51  (
52  "rhoN_" + molecules.potential().idList()[rN],
53  runTime.timeName(),
54  mesh,
55  IOobject::NO_READ,
56  IOobject::AUTO_WRITE
57  ),
58  mesh,
60  "zeroGradient"
61  )
62  );
63  allSpeciesRhoN[rN].internalField() = scalarField (mesh.nCells(), 0.0);
64  allSpeciesRhoN[rN].correctBoundaryConditions();
65 }
66 
67 Info << " Creating total number density field" << endl;
68 
69 volScalarField totalRhoN
70 (
71  IOobject
72  (
73  "rhoN_total",
74  runTime.timeName(),
75  mesh,
76  IOobject::NO_READ,
77  IOobject::AUTO_WRITE
78  ),
79  mesh,
81  "zeroGradient"
82 );
83 totalRhoN.internalField() = scalarField (mesh.nCells(), 0.0);
84 totalRhoN.correctBoundaryConditions();
85 
86 /*---------------------------------------------------------------------------*\
87  Mass density
88 \*---------------------------------------------------------------------------*/
89 
90 PtrList<volScalarField> allSpeciesRhoM
91 (
92  molecules.potential().nIds()
93 );
94 
96 {
97  Info<< " Creating mass density field for "
98  << molecules.potential().idList()[rM] << endl;
99 
100  allSpeciesRhoM.set
101  (
102  rM,
103  new volScalarField
104  (
105  IOobject
106  (
107  "rhoM_" + molecules.potential().idList()[rM],
108  runTime.timeName(),
109  mesh,
110  IOobject::NO_READ,
111  IOobject::AUTO_WRITE
112  ),
113  mesh,
115  "zeroGradient"
116  )
117  );
118  allSpeciesRhoM[rM].internalField() = scalarField (mesh.nCells(), 0.0);
119  allSpeciesRhoM[rM].correctBoundaryConditions();
120 }
121 
122 Info << " Creating total mass density field" << endl;
123 
124 volScalarField totalRhoM
125 (
126  IOobject
127  (
128  "rhoM_total",
129  runTime.timeName(),
130  mesh,
131  IOobject::NO_READ,
132  IOobject::AUTO_WRITE
133  ),
134  mesh,
136  "zeroGradient"
137 );
138 totalRhoM.internalField() = scalarField (mesh.nCells(), 0.0);
139 totalRhoM.correctBoundaryConditions();
140 
141 /*---------------------------------------------------------------------------*\
142  Bulk velocity
143 \*---------------------------------------------------------------------------*/
144 
145 PtrList<volVectorField> allSpeciesVelocity
146 (
147  molecules.potential().nIds()
148 );
149 
151 {
152  Info<< " Creating velocity field for "
153  << molecules.potential().idList()[v] << endl;
154 
156  (
157  v,
158  new volVectorField
159  (
160  IOobject
161  (
162  "velocity_" + molecules.potential().idList()[v],
163  runTime.timeName(),
164  mesh,
165  IOobject::NO_READ,
166  IOobject::AUTO_WRITE
167  ),
168  mesh,
169  dimVelocity,
170  "zeroGradient"
171  )
172  );
173  allSpeciesVelocity[v].internalField() =
174  vectorField (mesh.nCells(), vector::zero);
175  allSpeciesVelocity[v].correctBoundaryConditions();
176 }
177 
178 Info << " Creating total velocity field" << endl;
179 
180 // volVectorField totalVelocity
181 // (
182 // IOobject
183 // (
184 // "velocity_total",
185 // runTime.timeName(),
186 // mesh,
187 // IOobject::NO_READ,
188 // IOobject::AUTO_WRITE
189 // ),
190 // mesh,
191 // dimVelocity,
192 // "zeroGradient"
193 // );
194 // totalVelocity.internalField() = vectorField (mesh.nCells(), vector::zero);
195 // totalVelocity.correctBoundaryConditions();
196 
197 
198 volVectorField totalVelocity
199 
200 (
201  IOobject
202  (
203 
204  "velocity_total",
205  runTime.timeName(),
206  mesh,
207  IOobject::NO_READ,
208  IOobject::AUTO_WRITE
209 
210  ),
211  mesh,
212  dimensionedVector("zero", dimVelocity, vector::zero)
213 );
214 
215 /*---------------------------------------------------------------------------*\
216  Kinetic temperature
217 \*---------------------------------------------------------------------------*/
218 
219 PtrList<volScalarField> allSpeciesTemperature
220 (
221  molecules.potential().nIds()
222 );
223 
225 {
226  Info<< " Creating temperature field for "
227  << molecules.potential().idList()[t] << endl;
228 
230  (
231  t,
232  new volScalarField
233  (
234  IOobject
235  (
236  "temperature_" + molecules.potential().idList()[t],
237  runTime.timeName(),
238  mesh,
239  IOobject::NO_READ,
240  IOobject::AUTO_WRITE
241  ),
242  mesh,
244  "zeroGradient"
245  )
246  );
247  allSpeciesTemperature[t].internalField() = scalarField (mesh.nCells(), 0.0);
248  allSpeciesTemperature[t].correctBoundaryConditions();
249 }
250 
251 Info << " Creating total temperature field" << endl;
252 
253 volScalarField totalTemperature
254 (
255  IOobject
256  (
257  "temperature_total",
258  runTime.timeName(),
259  mesh,
260  IOobject::NO_READ,
261  IOobject::AUTO_WRITE
262  ),
263  mesh,
265  "zeroGradient"
266 );
267 totalTemperature.internalField() = scalarField (mesh.nCells(), 0.0);
268 totalTemperature.correctBoundaryConditions();
269 
270 /*---------------------------------------------------------------------------*\
271  Mean kinetic energy
272 \*---------------------------------------------------------------------------*/
273 
274 
275 PtrList<volScalarField> allSpeciesMeanKE
276 (
277  molecules.potential().nIds()
278 );
279 
281 {
282  Info<< " Creating mean kinetic energy field for "
283  << molecules.potential().idList()[mKE] << endl;
284 
285  allSpeciesMeanKE.set
286  (
287  mKE,
288  new volScalarField
289  (
290  IOobject
291  (
292  "meanKE_" + molecules.potential().idList()[mKE],
293  runTime.timeName(),
294  mesh,
295  IOobject::NO_READ,
296  IOobject::AUTO_WRITE
297  ),
298  mesh,
299  dimensionSet(1, 2, -2, 0, 0, 0, 0),
300  "zeroGradient"
301  )
302  );
303  allSpeciesMeanKE[mKE].internalField() = scalarField (mesh.nCells(), 0.0);
304  allSpeciesMeanKE[mKE].correctBoundaryConditions();
305 }
306 
307 Info << " Creating total mean kinetic energy field" << endl;
308 
309 volScalarField totalMeanKE
310 (
311  IOobject
312  (
313  "meanKE_total",
314  runTime.timeName(),
315  mesh,
316  IOobject::NO_READ,
317  IOobject::AUTO_WRITE
318  ),
319  mesh,
320  dimensionSet(1, 2, -2, 0, 0, 0, 0),
321  "zeroGradient"
322 );
323 totalMeanKE.internalField() = scalarField (mesh.nCells(), 0.0);
324 totalMeanKE.correctBoundaryConditions();
Info<< " Creating total number density field"<< endl;volScalarField totalRhoN(IOobject("rhoN_total", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimless/dimVolume,"zeroGradient");totalRhoN.internalField()=scalarField(mesh.nCells(), 0.0);totalRhoN.correctBoundaryConditions();PtrList< volScalarField > allSpeciesRhoM(molecules.potential().nIds())
Info<< nl<< "Creating fields."<< endl;PtrList< volScalarField > allSpeciesRhoN(molecules.potential().nIds())
List< scalarField > allSpeciesM_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
InternalField & internalField()
Return internal field.
messageStream Info
dynamicFvMesh & mesh
List< scalarField > allSpeciesN_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
Info<< " Creating total temperature field"<< endl;volScalarField totalTemperature(IOobject("temperature_total", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimTemperature,"zeroGradient");totalTemperature.internalField()=scalarField(mesh.nCells(), 0.0);totalTemperature.correctBoundaryConditions();PtrList< volScalarField > allSpeciesMeanKE(molecules.potential().nIds())
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
volVectorField vectorField(fieldObject, mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
forAll(allSpeciesRhoN, rN)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
List< vectorField > allSpeciesVelocitySum_RU(molecules.potential().nIds(), vectorField(mesh.nCells(), vector::zero))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
List< scalarField > allSpeciesVelocityMagSquaredSum_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
Info<< " Creating total velocity field"<< endl;volVectorField totalVelocity(IOobject("velocity_total", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedVector("zero", dimVelocity, vector::zero));PtrList< volScalarField > allSpeciesTemperature(molecules.potential().nIds())
Info<< " Creating total mass density field"<< endl;volScalarField totalRhoM(IOobject("rhoM_total", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimMass/dimVolume,"zeroGradient");totalRhoM.internalField()=scalarField(mesh.nCells(), 0.0);totalRhoM.correctBoundaryConditions();PtrList< volVectorField > allSpeciesVelocity(molecules.potential().nIds())
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
volScalarField scalarField(fieldObject, mesh)
const dimensionSet dimVelocity