1 if (runTime.outputTime())
3 /*-----------------------------------------------------------------------*\
5 \*-----------------------------------------------------------------------*/
7 scalarField totalRhoN_sum(mesh.nCells(), 0.0);
9 forAll(allSpeciesRhoN, rN)
11 allSpeciesRhoN[rN].internalField() =
16 totalRhoN_sum += allSpeciesRhoN[rN].internalField();
19 totalRhoN.internalField() = totalRhoN_sum;
22 /*-----------------------------------------------------------------------*\
24 \*-----------------------------------------------------------------------*/
26 scalarField totalRhoM_sum(mesh.nCells(), 0.0);
28 forAll(allSpeciesRhoM, rM)
30 allSpeciesRhoM[rM].internalField() =
35 totalRhoM_sum += allSpeciesRhoM[rM].internalField();
38 totalRhoM.internalField() = totalRhoM_sum;
40 /*-----------------------------------------------------------------------*\
42 \*-----------------------------------------------------------------------*/
44 vectorField totalMomentum_sum(mesh.nCells(), vector::zero);
46 scalarField totalMass_sum(mesh.nCells(), 0.0);
48 forAll(allSpeciesVelocity, v)
50 // A check for 1/0 molecules is required.
52 vectorField& singleSpeciesVelocity
54 allSpeciesVelocity[v].internalField()
57 forAll(singleSpeciesVelocity, sSV)
59 if (allSpeciesN_RU[v][sSV])
61 singleSpeciesVelocity[sSV] =
62 allSpeciesVelocitySum_RU[v][sSV]
63 /allSpeciesN_RU[v][sSV];
65 totalMomentum_sum[sSV] +=
66 allSpeciesM_RU[v][sSV]
67 /allSpeciesN_RU[v][sSV]
68 *allSpeciesVelocitySum_RU[v][sSV];
70 totalMass_sum[sSV] += allSpeciesM_RU[v][sSV];
74 singleSpeciesVelocity[sSV] = vector::zero;
79 forAll(totalVelocity.internalField(), tV)
81 if (totalMass_sum[tV] > VSMALL)
83 totalVelocity.internalField()[tV] =
89 totalVelocity.internalField()[tV] =
94 /*-----------------------------------------------------------------------*\
96 \*-----------------------------------------------------------------------*/
98 scalarField totalTemperatureVTerms_sum(mesh.nCells(), 0.0);
100 scalarField totalN_sum(mesh.nCells(), 0.0);
102 forAll(allSpeciesTemperature, t)
104 // A check for 1/0 molecules is required.
106 scalarField& singleSpeciesTemp
108 allSpeciesTemperature[t].internalField()
111 forAll(singleSpeciesTemp, sST)
113 if (allSpeciesN_RU[t][sST])
115 singleSpeciesTemp[sST] =
116 allSpeciesM_RU[t][sST]
117 /allSpeciesN_RU[t][sST]
118 /(3.0 * moleculeCloud::kb * allSpeciesN_RU[t][sST])
120 allSpeciesVelocityMagSquaredSum_RU[t][sST]
123 allSpeciesVelocitySum_RU[t][sST]
125 allSpeciesVelocitySum_RU[t][sST]
127 /allSpeciesN_RU[t][sST]
130 totalTemperatureVTerms_sum[sST] +=
131 allSpeciesM_RU[t][sST]
132 /allSpeciesN_RU[t][sST]
134 allSpeciesVelocityMagSquaredSum_RU[t][sST]
137 allSpeciesVelocitySum_RU[t][sST]
139 allSpeciesVelocitySum_RU[t][sST]
141 /allSpeciesN_RU[t][sST]
144 totalN_sum[sST] += allSpeciesN_RU[t][sST];
148 singleSpeciesTemp[sST] = 0.0;
153 forAll(totalTemperature.internalField(), tT)
155 if (totalN_sum[tT] > 0)
157 totalTemperature.internalField()[tT] =
158 totalTemperatureVTerms_sum[tT]
159 /(3.0 * moleculeCloud::kb * totalN_sum[tT]);
163 totalTemperature.internalField()[tT] = 0.0;
167 /*-----------------------------------------------------------------------*\
169 \*-----------------------------------------------------------------------*/
171 scalarField totalKE_sum(mesh.nCells(), 0.0);
173 forAll(allSpeciesMeanKE, mKE)
175 // A check for 1/0 molecules is required.
177 scalarField& singleSpeciesMeanKE
179 allSpeciesMeanKE[mKE].internalField()
182 forAll(singleSpeciesMeanKE, sSMKE)
184 if (allSpeciesN_RU[mKE][sSMKE])
186 singleSpeciesMeanKE[sSMKE] =
187 allSpeciesM_RU[mKE][sSMKE]
188 /allSpeciesN_RU[mKE][sSMKE]
189 /(2.0*allSpeciesN_RU[mKE][sSMKE])
191 allSpeciesVelocityMagSquaredSum_RU[mKE][sSMKE]
194 totalKE_sum[sSMKE] +=
195 allSpeciesM_RU[mKE][sSMKE]
196 /allSpeciesN_RU[mKE][sSMKE]
199 allSpeciesVelocityMagSquaredSum_RU[mKE][sSMKE]
204 singleSpeciesMeanKE[sSMKE] = 0.0;
209 forAll(totalMeanKE.internalField(), tMKE)
211 if (totalN_sum[tMKE] > 0)
213 totalMeanKE.internalField()[tMKE] =
219 totalMeanKE.internalField()[tMKE] = 0.0;