createMDFields.H
Go to the documentation of this file.
1 // Fields for data gathering
2 
3 List<scalarField> allSpeciesN_RU
4 (
5  molecules.potential().nIds(),
6  scalarField(mesh.nCells(), 0.0)
7 );
8 
9 List<scalarField> allSpeciesM_RU
10 (
11  molecules.potential().nIds(),
12  scalarField(mesh.nCells(), 0.0)
13 );
14 
15 List<vectorField> allSpeciesVelocitySum_RU
16 (
17  molecules.potential().nIds(),
18  vectorField(mesh.nCells(), Zero)
19 );
20 
21 List<scalarField> allSpeciesVelocityMagSquaredSum_RU
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].primitiveFieldRef() = 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.primitiveFieldRef() = 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].primitiveFieldRef() = 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.primitiveFieldRef() = 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].primitiveFieldRef() = Zero;
174  allSpeciesVelocity[v].correctBoundaryConditions();
175 }
176 
177 Info << " Creating total velocity field" << endl;
178 
179 // volVectorField totalVelocity
180 // (
181 // IOobject
182 // (
183 // "velocity_total",
184 // runTime.timeName(),
185 // mesh,
186 // IOobject::NO_READ,
187 // IOobject::AUTO_WRITE
188 // ),
189 // mesh,
190 // dimVelocity,
191 // "zeroGradient"
192 // );
193 // totalVelocity.primitiveFieldRef() = Zero;
194 // totalVelocity.correctBoundaryConditions();
195 
196 
197 volVectorField totalVelocity
198 
199 (
200  IOobject
201  (
202 
203  "velocity_total",
204  runTime.timeName(),
205  mesh,
206  IOobject::NO_READ,
207  IOobject::AUTO_WRITE
208 
209  ),
210  mesh,
212 );
213 
214 /*---------------------------------------------------------------------------*\
215  Kinetic temperature
216 \*---------------------------------------------------------------------------*/
217 
218 PtrList<volScalarField> allSpeciesTemperature
219 (
220  molecules.potential().nIds()
221 );
222 
224 {
225  Info<< " Creating temperature field for "
226  << molecules.potential().idList()[t] << endl;
227 
229  (
230  t,
231  new volScalarField
232  (
233  IOobject
234  (
235  "temperature_" + molecules.potential().idList()[t],
236  runTime.timeName(),
237  mesh,
238  IOobject::NO_READ,
239  IOobject::AUTO_WRITE
240  ),
241  mesh,
243  "zeroGradient"
244  )
245  );
246  allSpeciesTemperature[t].primitiveFieldRef() = 0;
247  allSpeciesTemperature[t].correctBoundaryConditions();
248 }
249 
250 Info << " Creating total temperature field" << endl;
251 
252 volScalarField totalTemperature
253 (
254  IOobject
255  (
256  "temperature_total",
257  runTime.timeName(),
258  mesh,
259  IOobject::NO_READ,
260  IOobject::AUTO_WRITE
261  ),
262  mesh,
264  "zeroGradient"
265 );
266 totalTemperature.primitiveFieldRef() = 0;
267 totalTemperature.correctBoundaryConditions();
268 
269 /*---------------------------------------------------------------------------*\
270  Mean kinetic energy
271 \*---------------------------------------------------------------------------*/
272 
273 
274 PtrList<volScalarField> allSpeciesMeanKE
275 (
276  molecules.potential().nIds()
277 );
278 
280 {
281  Info<< " Creating mean kinetic energy field for "
282  << molecules.potential().idList()[mKE] << endl;
283 
284  allSpeciesMeanKE.set
285  (
286  mKE,
287  new volScalarField
288  (
289  IOobject
290  (
291  "meanKE_" + molecules.potential().idList()[mKE],
292  runTime.timeName(),
293  mesh,
294  IOobject::NO_READ,
295  IOobject::AUTO_WRITE
296  ),
297  mesh,
298  dimensionSet(1, 2, -2, 0, 0, 0, 0),
299  "zeroGradient"
300  )
301  );
302  allSpeciesMeanKE[mKE].primitiveFieldRef() = 0;
303  allSpeciesMeanKE[mKE].correctBoundaryConditions();
304 }
305 
306 Info << " Creating total mean kinetic energy field" << endl;
307 
308 volScalarField totalMeanKE
309 (
310  IOobject
311  (
312  "meanKE_total",
313  runTime.timeName(),
314  mesh,
315  IOobject::NO_READ,
316  IOobject::AUTO_WRITE
317  ),
318  mesh,
319  dimensionSet(1, 2, -2, 0, 0, 0, 0),
320  "zeroGradient"
321 );
322 totalMeanKE.primitiveFieldRef() = 0;
323 totalMeanKE.correctBoundaryConditions();
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.primitiveFieldRef()=0;totalRhoM.correctBoundaryConditions();PtrList< volVectorField > allSpeciesVelocity(molecules.potential().nIds())
List< scalarField > allSpeciesM_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
forAll(allSpeciesRhoN, rN)
volVectorField vectorField(fieldObject, mesh)
List< scalarField > allSpeciesVelocityMagSquaredSum_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
List< vectorField > allSpeciesVelocitySum_RU(molecules.potential().nIds(), vectorField(mesh.nCells(), Zero))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
Info<< " Creating total temperature field"<< endl;volScalarField totalTemperature(IOobject("temperature_total", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimTemperature, "zeroGradient");totalTemperature.primitiveFieldRef()=0;totalTemperature.correctBoundaryConditions();PtrList< volScalarField > allSpeciesMeanKE(molecules.potential().nIds())
Info<< " Creating total velocity field"<< endl;volVectorField totalVelocity(IOobject("velocity_total", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero));PtrList< volScalarField > allSpeciesTemperature(molecules.potential().nIds())
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
List< scalarField > allSpeciesN_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
static const zero Zero
Definition: zero.H:91
volScalarField scalarField(fieldObject, mesh)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
static const char nl
Definition: Ostream.H:262
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.primitiveFieldRef()=0;totalRhoN.correctBoundaryConditions();PtrList< volScalarField > allSpeciesRhoM(molecules.potential().nIds())
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
messageStream Info
Info<< nl<< "Creating fields."<< endl;PtrList< volScalarField > allSpeciesRhoN(molecules.potential().nIds())
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
const dimensionSet dimVelocity