15template <MInt nDim,
class SysEqn>
36template <MInt nDim,
class SysEqn>
59template <MInt nDim,
class SysEqn>
65 m_sprayTimes[m_sprayDataStep][1] = fvSolver().physicalTime();
66 m_sprayTimes[m_sprayDataStep][2] = fvSolver().crankAngle(fvSolver().physicalTime(), 0);
68 fvSolver().stopLoadTimer(AT_);
69 if(lpt().isActive()) {
70 lpt().startLoadTimer(AT_);
72 this->particlePenetration();
73 this->parcelStatistics();
74 lpt().stopLoadTimer(AT_);
77 fvSolver().startLoadTimer(AT_);
79 if(fvSolver().isActive()) {
80 this->vapourMass(m_fvLPTSpeciesId);
81 this->vapourPenetration(lpt().m_spawnCoord);
85template <MInt nDim,
class SysEqn>
89 static MBool firstTime =
true;
91 if(this->m_finalTimeStep && fvSolver().domainId() == 0) {
92 cerr <<
"Writing final postProcessing Data" << endl;
95 if(firstTime && fvSolver().domainId() == 0) {
96 cerr0 <<
"Writing first postProcessing Data" << endl;
99 fvSolver().stopLoadTimer(AT_);
101 const MBool timerEnabled = fvSolver().dlbTimersEnabled();
107 const MBool hasInjection = lpt().m_sprayModel !=
nullptr ? true :
false;
108 MInt injDataSize = this->getInjectionData();
109 MPI_Allreduce(MPI_IN_PLACE, &injDataSize, 1, MPI_INT, MPI_MAX, fvSolver().mpiComm(), AT_,
"INPLACE",
"injDataSize");
110 const MInt dataSize = (this->m_finalTimeStep || firstTime) ? m_sprayDataStep : m_sprayDataSize;
111 const MInt vapourPenSize = nDim == 3 ? 16 : 12;
114 const MInt injectorCellId = lpt().isActive() ? lpt().injectorCellId() : -1;
116 if(hasInjection && injDataSize != dataSize) {
117 cerr0 <<
"Spray-PP data differs: " << injDataSize <<
" inj-Size " << dataSize <<
" sprayData-Size" << endl;
122 MPI_Allreduce(MPI_IN_PLACE, &m_particleCV[0][0], m_sprayDataSize * (2 + nDim), MPI_DOUBLE, MPI_SUM,
123 fvSolver().mpiComm(), AT_,
"INPLACE",
"m_particleCV");
125 MPI_Allreduce(MPI_IN_PLACE, &m_sprayStat[0][0], m_sprayDataSize * 5, MPI_DOUBLE, MPI_SUM, fvSolver().mpiComm(), AT_,
126 "INPLACE",
"m_sprayStat");
128 MPI_Allreduce(MPI_IN_PLACE, &m_particlePen[0][0], m_sprayDataSize * 19, MPI_DOUBLE, MPI_MAX, fvSolver().mpiComm(),
129 AT_,
"INPLACE",
"m_particlePen");
131 MPI_Allreduce(MPI_IN_PLACE, &m_vapourCV[0][0], m_sprayDataSize * (5 + 2 * nDim), MPI_DOUBLE, MPI_SUM,
132 fvSolver().mpiComm(), AT_,
"INPLACE",
"m_vapourCV");
134 MPI_Allreduce(MPI_IN_PLACE, &m_vapourPen[0][0], m_sprayDataSize * vapourPenSize, MPI_DOUBLE, MPI_MAX,
135 fvSolver().mpiComm(), AT_,
"INPLACE",
"m_vapourPen");
138 if(injectorCellId >= 0) {
145 MString fileNameCheck = lpt().outputDir() +
"sprayCons";
147 const MString fileName = lpt().outputDir() +
"sprayCons_" + to_string(lpt().m_restartTimeStep);
150 if(!lpt().m_restartFile) {
151 ofl.open(fileNameCheck, ios_base::out | ios_base::trunc);
152 ofl <<
"#0:ts 1:time 2:CAD 3:pMass 4:pEnergy 5-7:pMomentum 8:vMass 9:aMass 10:gMass 11:gEnergy 12:gMomX "
159 fileNameCheck = lpt().outputDir() +
"liquidPen";
161 const MString fileName = lpt().outputDir() +
"liquidPen_" + to_string(lpt().m_restartTimeStep);
164 if(!lpt().m_restartFile) {
165 ofl.open(fileNameCheck, ios_base::out | ios_base::trunc);
166 ofl <<
"#0:ts 1:time 2:CAD 3-5:liquidPen"
173 fileNameCheck = lpt().outputDir() +
"vapourPen";
175 const MString fileName = lpt().outputDir() +
"vapourPen_" + to_string(lpt().m_restartTimeStep);
178 if(!lpt().m_restartFile) {
179 ofl.open(fileNameCheck, ios_base::out | ios_base::trunc);
180 ofl <<
"#0:ts 1:time 2:CAD 3-5:v01Pen 6-8:v1Pen 9-11:v5Pen";
186 fileNameCheck = lpt().outputDir() +
"sprayStats";
188 const MString fileName = lpt().outputDir() +
"sprayStats_" + to_string(lpt().m_restartTimeStep);
192 if(!lpt().m_restartFile) {
193 ofl.open(fileNameCheck, ios_base::out | ios_base::trunc);
194 ofl <<
"#0:ts 1:time 2:CAD 3:noParcles 4:noDroplets 5:SMS 6:avgDiameter";
201 fileNameCheck = lpt().outputDir() +
"injStats";
203 const MString fileName = lpt().outputDir() +
"injStats_" + to_string(lpt().m_restartTimeStep);
206 if(!lpt().m_restartFile) {
207 ofl.open(fileNameCheck, ios_base::out | ios_base::trunc);
208 ofl <<
"#0:ts 1:timeSinceSOI 2:injProgress 3:rampFactor 4:noInjPart 5:noInjDrop 6:injDiameter 7:injMass "
209 "8:injXMom 9:injYMom 10:injZMom 11:injEnergy";
215 fileNameCheck = lpt().outputDir() +
"injSums";
217 const MString fileName = lpt().outputDir() +
"injSums_" + to_string(lpt().m_restartTimeStep);
220 if(!lpt().m_restartFile) {
221 ofl.open(fileNameCheck, ios_base::out | ios_base::trunc);
222 ofl <<
"#0:ts 1:injMass 2-4:injMomentum 5:injEnergy 6:evapMass";
230 MString fileName = lpt().outputDir() +
"sprayCons";
231 ofl.open(fileName, ios_base::out | ios_base::app);
233 if(ofl.is_open() && ofl.good()) {
234 for(
MInt i = 0; i < dataSize; i++) {
235 ofl << m_sprayTimes[i][0] << setprecision(7) <<
" " << m_sprayTimes[i][1] <<
" " << m_sprayTimes[i][2] <<
" "
237 for(
MInt v = 0; v < 2 + nDim; v++) {
238 ofl << m_particleCV[i][v] <<
" ";
240 for(
MInt v = 0; v < 5 + 2 * nDim; v++) {
241 ofl << m_vapourCV[i][v] <<
" ";
248 fileName = lpt().outputDir() +
"liquidPen";
249 ofl.open(fileName, ios_base::out | ios_base::app);
250 if(ofl.is_open() && ofl.good()) {
251 for(
MInt i = 0; i < dataSize; i++) {
252 ofl << m_sprayTimes[i][0] << setprecision(7) <<
" " << m_sprayTimes[i][1] <<
" " << setprecision(7)
253 << m_sprayTimes[i][2] <<
" " << setprecision(8);
254 for(
MInt j = 0; j < 19; j++) {
255 ofl << m_particlePen[i][j] <<
" ";
262 fileName = lpt().outputDir() +
"vapourPen";
263 ofl.open(fileName, ios_base::out | ios_base::app);
264 if(ofl.is_open() && ofl.good()) {
265 for(
MInt i = 0; i < dataSize; i++) {
266 ofl << m_sprayTimes[i][0] << setprecision(7) <<
" " << m_sprayTimes[i][1] <<
" " << setprecision(7)
267 << m_sprayTimes[i][2] <<
" " << setprecision(8);
268 for(
MInt j = 0; j < vapourPenSize; j++) {
269 ofl << m_vapourPen[i][j] <<
" ";
276 fileName = lpt().outputDir() +
"sprayStats";
277 ofl.open(fileName, ios_base::out | ios_base::app);
278 if(ofl.is_open() && ofl.good()) {
279 for(
MInt i = 0; i < dataSize; i++) {
280 ofl << m_sprayTimes[i][0] << setprecision(7) <<
" " << m_sprayTimes[i][1] <<
" " << m_sprayTimes[i][2] <<
" "
282 for(
MInt j = 0; j < 5; j++) {
283 ofl << m_sprayStat[i][j] <<
" ";
291 fileName = lpt().outputDir() +
"injStats";
292 ofl.open(fileName, ios_base::out | ios_base::app);
293 if(ofl.is_open() && ofl.good()) {
294 for(
MInt i = 0; i < injDataSize; i++) {
295 ofl << setprecision(12);
296 for(
MInt j = 0; j < 15; j++) {
297 ofl << m_injectionData[i][j] <<
" ";
304 fileName = lpt().outputDir() +
"injSums";
305 ofl.open(fileName, ios_base::out | ios_base::app);
306 if(ofl.is_open() && ofl.good()) {
307 for(
MInt i = 0; i < injDataSize; i++) {
308 ofl << m_injectionData[i][0] <<
" " << setprecision(12);
309 for(
MInt j = 0; j < nDim + 5; j++) {
310 ofl << m_cInjData[i][j] <<
" ";
321 for(
MInt i = 0; i < m_sprayDataSize; i++) {
322 for(
MInt j = 0; j < 5; j++) {
323 m_sprayStat[i][j] = 0;
325 for(
MInt j = 0; j < 2 + nDim; j++) {
326 m_particleCV[i][j] = 0;
328 for(
MInt j = 0; j < 19; j++) {
329 m_particlePen[i][j] = 0;
332 for(
MInt j = 0; j < 15; j++) {
333 m_injectionData[i][j] = 0;
341 fvSolver().startLoadTimer(AT_);
void enableAllDlbTimers(const MBool *const wasEnabled=nullptr)
Enable all DLB timers (or those given by the array wasEnabled)
void disableAllDlbTimers(MBool *const wasEnabled=nullptr)
Disable all (enabled) DLB timers.
void writeSprayData() override
lptSolver * m_ppSolverLpt
PostProcessingFvLPT(MInt postprocessingId_, PostData< nDim > *data, fv *ppFvSolver_, lptSolver *ppLptSolver_)
void computeSprayData() override
base function which is called every time-Step in postprocessInSolve
void updateData()
updates all post-processing data from postprocessing-fv or postprocessing-lpt
MInt copyFile(const MString &fromName, const MString &toName)
Copies file fromName to file toName.
MBool fileExists(const MString &fileName)
Returns true if the file fileName exists, false otherwise.
std::basic_string< char > MString
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce
DlbTimerController g_dlbTimerController