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(),
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.name(),
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.name(),
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.name(),
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.name(),
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.name(),
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.name(),
185  mesh,
186  IOobject::NO_READ,
187  IOobject::AUTO_WRITE
188  ),
189  mesh,
191 );
192 
193 /*---------------------------------------------------------------------------*\
194  Kinetic temperature
195 \*---------------------------------------------------------------------------*/
196 
197 PtrList<volScalarField> allSpeciesTemperature
198 (
199  molecules.potential().nIds()
200 );
201 
203 {
204  Info<< " Creating temperature field for "
205  << molecules.potential().idList()[t] << endl;
206 
208  (
209  t,
210  new volScalarField
211  (
212  IOobject
213  (
214  "temperature_" + molecules.potential().idList()[t],
215  runTime.name(),
216  mesh,
217  IOobject::NO_READ,
218  IOobject::AUTO_WRITE
219  ),
220  mesh,
222  "zeroGradient"
223  )
224  );
225  allSpeciesTemperature[t].primitiveFieldRef() = 0;
226  allSpeciesTemperature[t].correctBoundaryConditions();
227 }
228 
229 Info << " Creating total temperature field" << endl;
230 
231 volScalarField totalTemperature
232 (
233  IOobject
234  (
235  "temperature_total",
236  runTime.name(),
237  mesh,
238  IOobject::NO_READ,
239  IOobject::AUTO_WRITE
240  ),
241  mesh,
243  "zeroGradient"
244 );
245 totalTemperature.primitiveFieldRef() = 0;
246 totalTemperature.correctBoundaryConditions();
247 
248 /*---------------------------------------------------------------------------*\
249  Mean kinetic energy
250 \*---------------------------------------------------------------------------*/
251 
252 
253 PtrList<volScalarField> allSpeciesMeanKE
254 (
255  molecules.potential().nIds()
256 );
257 
259 {
260  Info<< " Creating mean kinetic energy field for "
261  << molecules.potential().idList()[mKE] << endl;
262 
263  allSpeciesMeanKE.set
264  (
265  mKE,
266  new volScalarField
267  (
268  IOobject
269  (
270  "meanKE_" + molecules.potential().idList()[mKE],
271  runTime.name(),
272  mesh,
273  IOobject::NO_READ,
274  IOobject::AUTO_WRITE
275  ),
276  mesh,
277  dimensionSet(1, 2, -2, 0, 0, 0, 0),
278  "zeroGradient"
279  )
280  );
281  allSpeciesMeanKE[mKE].primitiveFieldRef() = 0;
282  allSpeciesMeanKE[mKE].correctBoundaryConditions();
283 }
284 
285 Info << " Creating total mean kinetic energy field" << endl;
286 
287 volScalarField totalMeanKE
288 (
289  IOobject
290  (
291  "meanKE_total",
292  runTime.name(),
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 totalMeanKE.primitiveFieldRef() = 0;
302 totalMeanKE.correctBoundaryConditions();
Motion of the mesh specified as a list of pointMeshMovers.
label nCells() const
forAll(allSpeciesRhoN, rN)
Info<< " Creating total velocity field"<< endl;volVectorField totalVelocity(IOobject("velocity_total", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedVector(dimVelocity, Zero));PtrList< volScalarField > allSpeciesTemperature(molecules.potential().nIds())
List< scalarField > allSpeciesVelocityMagSquaredSum_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
Info<< nl<< "Creating fields."<< endl;PtrList< volScalarField > allSpeciesRhoN(molecules.potential().nIds())
Info<< " Creating total mass density field"<< endl;volScalarField totalRhoM(IOobject("rhoM_total", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimMass/dimVolume, "zeroGradient");totalRhoM.primitiveFieldRef()=0;totalRhoM.correctBoundaryConditions();PtrList< volVectorField > allSpeciesVelocity(molecules.potential().nIds())
List< scalarField > allSpeciesN_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
Info<< " Creating total temperature field"<< endl;volScalarField totalTemperature(IOobject("temperature_total", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimTemperature, "zeroGradient");totalTemperature.primitiveFieldRef()=0;totalTemperature.correctBoundaryConditions();PtrList< volScalarField > allSpeciesMeanKE(molecules.potential().nIds())
List< scalarField > allSpeciesM_RU(molecules.potential().nIds(), scalarField(mesh.nCells(), 0.0))
List< vectorField > allSpeciesVelocitySum_RU(molecules.potential().nIds(), vectorField(mesh.nCells(), Zero))
Info<< " Creating total number density field"<< endl;volScalarField totalRhoN(IOobject("rhoN_total", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimless/dimVolume, "zeroGradient");totalRhoN.primitiveFieldRef()=0;totalRhoN.correctBoundaryConditions();PtrList< volScalarField > allSpeciesRhoM(molecules.potential().nIds())
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volScalarField scalarField(fieldObject, mesh)
volVectorField vectorField(fieldObject, mesh)
const dimensionSet dimless
static const zero Zero
Definition: zero.H:97
VolField< vector > volVectorField
Definition: volFieldsFwd.H:63
const dimensionSet & dimMass
Definition: dimensions.C:275
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
messageStream Info
const dimensionSet & dimVolume
Definition: dimensions.C:282
const dimensionSet & dimVelocity
Definition: dimensions.C:286
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
static const char nl
Definition: Ostream.H:297
const dimensionSet & dimTemperature
Definition: dimensions.C:278