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  IOobject
200  (
201  "velocity_total",
202  runTime.timeName(),
203  mesh,
204  IOobject::NO_READ,
205  IOobject::AUTO_WRITE
206  ),
207  mesh,
209 );
210 
211 /*---------------------------------------------------------------------------*\
212  Kinetic temperature
213 \*---------------------------------------------------------------------------*/
214 
215 PtrList<volScalarField> allSpeciesTemperature
216 (
217  molecules.potential().nIds()
218 );
219 
221 {
222  Info<< " Creating temperature field for "
223  << molecules.potential().idList()[t] << endl;
224 
226  (
227  t,
228  new volScalarField
229  (
230  IOobject
231  (
232  "temperature_" + molecules.potential().idList()[t],
233  runTime.timeName(),
234  mesh,
235  IOobject::NO_READ,
236  IOobject::AUTO_WRITE
237  ),
238  mesh,
240  "zeroGradient"
241  )
242  );
243  allSpeciesTemperature[t].primitiveFieldRef() = 0;
244  allSpeciesTemperature[t].correctBoundaryConditions();
245 }
246 
247 Info << " Creating total temperature field" << endl;
248 
249 volScalarField totalTemperature
250 (
251  IOobject
252  (
253  "temperature_total",
254  runTime.timeName(),
255  mesh,
256  IOobject::NO_READ,
257  IOobject::AUTO_WRITE
258  ),
259  mesh,
261  "zeroGradient"
262 );
263 totalTemperature.primitiveFieldRef() = 0;
264 totalTemperature.correctBoundaryConditions();
265 
266 /*---------------------------------------------------------------------------*\
267  Mean kinetic energy
268 \*---------------------------------------------------------------------------*/
269 
270 
271 PtrList<volScalarField> allSpeciesMeanKE
272 (
273  molecules.potential().nIds()
274 );
275 
277 {
278  Info<< " Creating mean kinetic energy field for "
279  << molecules.potential().idList()[mKE] << endl;
280 
281  allSpeciesMeanKE.set
282  (
283  mKE,
284  new volScalarField
285  (
286  IOobject
287  (
288  "meanKE_" + molecules.potential().idList()[mKE],
289  runTime.timeName(),
290  mesh,
291  IOobject::NO_READ,
292  IOobject::AUTO_WRITE
293  ),
294  mesh,
295  dimensionSet(1, 2, -2, 0, 0, 0, 0),
296  "zeroGradient"
297  )
298  );
299  allSpeciesMeanKE[mKE].primitiveFieldRef() = 0;
300  allSpeciesMeanKE[mKE].correctBoundaryConditions();
301 }
302 
303 Info << " Creating total mean kinetic energy field" << endl;
304 
305 volScalarField totalMeanKE
306 (
307  IOobject
308  (
309  "meanKE_total",
310  runTime.timeName(),
311  mesh,
312  IOobject::NO_READ,
313  IOobject::AUTO_WRITE
314  ),
315  mesh,
316  dimensionSet(1, 2, -2, 0, 0, 0, 0),
317  "zeroGradient"
318 );
319 totalMeanKE.primitiveFieldRef() = 0;
320 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:251
forAll(allSpeciesRhoN, rN)
volVectorField vectorField(fieldObject, mesh)
List< scalarField > allSpeciesVelocityMagSquaredSum_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
const dimensionSet dimless
List< vectorField > allSpeciesVelocitySum_RU(molecules.potential().nIds(), vectorField(mesh.nCells(), Zero))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
fvMesh & mesh
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())
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
Info<< " Creating total velocity field"<< endl;volVectorField totalVelocity(IOobject("velocity_total", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedVector(dimVelocity, Zero));PtrList< volScalarField > allSpeciesTemperature(molecules.potential().nIds())
List< scalarField > allSpeciesN_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
static const zero Zero
Definition: zero.H:97
volScalarField scalarField(fieldObject, mesh)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
static const char nl
Definition: Ostream.H:260
const dimensionSet dimVelocity
const dimensionSet dimMass
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 dimVolume
messageStream Info
Info<< nl<< "Creating fields."<< endl;PtrList< volScalarField > allSpeciesRhoN(molecules.potential().nIds())
const dimensionSet dimTemperature