BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / lagrangian / molecularDynamics / molecule / mdTools / createMDFields.H
blob6d6617d652084e773ca496e7bdcafa61e9cdaec5
1 // Fields for data gathering
3 List< scalarField > allSpeciesN_RU
5     molecules.potential().nIds(),
6     scalarField (mesh.nCells(), 0.0)
7 );
9 List< scalarField > allSpeciesM_RU
11     molecules.potential().nIds(),
12     scalarField (mesh.nCells(), 0.0)
15 List< vectorField > allSpeciesVelocitySum_RU
17     molecules.potential().nIds(),
18     vectorField (mesh.nCells(), vector::zero)
21 List< scalarField > allSpeciesVelocityMagSquaredSum_RU
23     molecules.potential().nIds(),
24     scalarField (mesh.nCells(), 0.0)
27 // Geometric Fields for IO
29 Info << nl << "Creating fields." << endl;
31 /*---------------------------------------------------------------------------*\
32     Number density
33 \*---------------------------------------------------------------------------*/
35 PtrList<volScalarField> allSpeciesRhoN
37     molecules.potential().nIds()
40 forAll(allSpeciesRhoN, rN)
42     Info<< "    Creating number density field for "
43         << molecules.potential().idList()[rN] << endl;
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,
59             dimless/dimVolume,
60             "zeroGradient"
61         )
62     );
63     allSpeciesRhoN[rN].internalField() = scalarField (mesh.nCells(), 0.0);
64     allSpeciesRhoN[rN].correctBoundaryConditions();
67 Info << "    Creating total number density field" << endl;
69 volScalarField totalRhoN
71     IOobject
72     (
73         "rhoN_total",
74         runTime.timeName(),
75         mesh,
76         IOobject::NO_READ,
77         IOobject::AUTO_WRITE
78     ),
79     mesh,
80     dimless/dimVolume,
81     "zeroGradient"
83 totalRhoN.internalField() = scalarField (mesh.nCells(), 0.0);
84 totalRhoN.correctBoundaryConditions();
86 /*---------------------------------------------------------------------------*\
87     Mass density
88 \*---------------------------------------------------------------------------*/
90 PtrList<volScalarField> allSpeciesRhoM
92     molecules.potential().nIds()
95 forAll(allSpeciesRhoM, rM)
97     Info<< "    Creating mass density field for "
98         << molecules.potential().idList()[rM] << endl;
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,
114             dimMass/dimVolume,
115             "zeroGradient"
116         )
117     );
118     allSpeciesRhoM[rM].internalField() = scalarField (mesh.nCells(), 0.0);
119     allSpeciesRhoM[rM].correctBoundaryConditions();
122 Info << "    Creating total mass density field" << endl;
124 volScalarField totalRhoM
126     IOobject
127     (
128         "rhoM_total",
129         runTime.timeName(),
130         mesh,
131         IOobject::NO_READ,
132         IOobject::AUTO_WRITE
133     ),
134     mesh,
135     dimMass/dimVolume,
136     "zeroGradient"
138 totalRhoM.internalField() = scalarField (mesh.nCells(), 0.0);
139 totalRhoM.correctBoundaryConditions();
141 /*---------------------------------------------------------------------------*\
142     Bulk velocity
143 \*---------------------------------------------------------------------------*/
145 PtrList<volVectorField> allSpeciesVelocity
147     molecules.potential().nIds()
150 forAll(allSpeciesVelocity, v)
152     Info<< "    Creating velocity field for "
153         << molecules.potential().idList()[v] << endl;
155     allSpeciesVelocity.set
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();
178 Info << "    Creating total velocity field" << endl;
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();
198 volVectorField totalVelocity
201     IOobject
202     (
204     "velocity_total",
205     runTime.timeName(),
206     mesh,
207     IOobject::NO_READ,
208     IOobject::AUTO_WRITE
210     ),
211     mesh,
212     dimensionedVector("zero", dimVelocity, vector::zero)
215 /*---------------------------------------------------------------------------*\
216     Kinetic temperature
217 \*---------------------------------------------------------------------------*/
219 PtrList<volScalarField> allSpeciesTemperature
221     molecules.potential().nIds()
224 forAll(allSpeciesTemperature, t)
226     Info<< "    Creating temperature field for "
227         << molecules.potential().idList()[t] << endl;
229     allSpeciesTemperature.set
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,
243             dimTemperature,
244             "zeroGradient"
245         )
246     );
247     allSpeciesTemperature[t].internalField() = scalarField (mesh.nCells(), 0.0);
248     allSpeciesTemperature[t].correctBoundaryConditions();
251 Info << "    Creating total temperature field" << endl;
253 volScalarField totalTemperature
255     IOobject
256     (
257         "temperature_total",
258         runTime.timeName(),
259         mesh,
260         IOobject::NO_READ,
261         IOobject::AUTO_WRITE
262     ),
263     mesh,
264     dimTemperature,
265     "zeroGradient"
267 totalTemperature.internalField() = scalarField (mesh.nCells(), 0.0);
268 totalTemperature.correctBoundaryConditions();
270 /*---------------------------------------------------------------------------*\
271     Mean kinetic energy
272 \*---------------------------------------------------------------------------*/
275 PtrList<volScalarField> allSpeciesMeanKE
277     molecules.potential().nIds()
280 forAll(allSpeciesMeanKE, mKE)
282     Info<< "    Creating mean kinetic energy field for "
283         << molecules.potential().idList()[mKE] << endl;
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();
307 Info << "    Creating total mean kinetic energy field" << endl;
309 volScalarField totalMeanKE
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"
323 totalMeanKE.internalField() = scalarField (mesh.nCells(), 0.0);
324 totalMeanKE.correctBoundaryConditions();