33 template<
class CloudType>
40 const word& patchName = mesh_.boundary()[patchi].name();
42 forAll(nEscape_[patchi], injectori)
45 this->writeTabbed(os, patchName +
"_nEscape_" + suffix);
46 this->writeTabbed(os, patchName +
"_massEscape_" + suffix);
47 this->writeTabbed(os, patchName +
"_nStick_" + suffix);
48 this->writeTabbed(os, patchName +
"_massStick_" + suffix);
56 template<
class CloudType>
67 this->wordToInteractionType(this->coeffDict().getWord(
"type"))
71 nEscape_(mesh_.boundaryMesh().nNonProcessor()),
72 massEscape_(nEscape_.size()),
73 nStick_(nEscape_.size()),
74 massStick_(nEscape_.size()),
77 const bool outputByInjectorId =
78 this->coeffDict().getOrDefault(
"outputByInjectorId",
false);
80 switch (interactionType_)
84 const word interactionTypeName(this->coeffDict().getWord(
"type"));
87 <<
"Unknown interaction result type "
88 << interactionTypeName
89 <<
". Valid selections are:" << this->interactionTypeNames_
96 e_ = this->coeffDict().getOrDefault(
"e", 1.0);
97 mu_ = this->coeffDict().getOrDefault(
"mu", 0.0);
105 label nInjectors = 0;
106 if (outputByInjectorId)
108 for (
const auto& inj :
cloud.injectors())
110 injIdToIndex_.insert(inj.injectorID(), nInjectors++);
115 if (injIdToIndex_.empty())
122 nEscape_[patchi].setSize(nInjectors,
Zero);
123 massEscape_[patchi].setSize(nInjectors,
Zero);
124 nStick_[patchi].setSize(nInjectors,
Zero);
125 massStick_[patchi].setSize(nInjectors,
Zero);
130 template<
class CloudType>
151 template<
class CloudType>
161 if (isA<wallPolyPatch>(pp))
167 ? injIdToIndex_.lookup(
p.typeId(), 0)
171 switch (interactionType_)
179 keepParticle =
false;
183 const scalar dm =
p.nParticle()*
p.mass();
185 nEscape_[pp.
index()][idx]++;
186 massEscape_[pp.
index()][idx] += dm;
195 const scalar dm =
p.nParticle()*
p.mass();
197 nStick_[pp.
index()][idx]++;
198 massStick_[pp.
index()][idx] += dm;
209 this->owner().patchData(
p, pp, nw, Up);
219 U -= (1.0 + e_)*Un*nw;
232 <<
"Unknown interaction type "
233 << this->interactionTypeToWord(interactionType_)
234 <<
"(" << interactionType_ <<
")" <<
endl
246 template<
class CloudType>
258 label lsd = nEscape_[patchi].size();
259 npe0[patchi].setSize(lsd,
Zero);
260 mpe0[patchi].setSize(lsd,
Zero);
261 nps0[patchi].setSize(lsd,
Zero);
262 mps0[patchi].setSize(lsd,
Zero);
265 this->getModelProperty(
"nEscape", npe0);
266 this->getModelProperty(
"massEscape", mpe0);
267 this->getModelProperty(
"nStick", nps0);
268 this->getModelProperty(
"massStick", mps0);
276 npe[i] = npe[i] + npe0[i];
283 mpe[i] = mpe[i] + mpe0[i];
290 nps[i] = nps[i] + nps0[i];
297 mps[i] = mps[i] + mps0[i];
300 if (injIdToIndex_.size())
304 labelList indexToInjector(injIdToIndex_.size());
307 indexToInjector[iter.val()] = iter.key();
312 forAll(mpe[patchi], indexi)
314 const word& patchName = mesh_.boundary()[patchi].name() ;
316 os <<
" Parcel fate: patch " << patchName
317 <<
" (number, mass)" <<
nl
318 <<
" - escape (injector " << indexToInjector[indexi]
319 <<
") = " << npe[patchi][indexi]
320 <<
", " << mpe[patchi][indexi] <<
nl
321 <<
" - stick (injector " << indexToInjector[indexi]
322 <<
") = " << nps[patchi][indexi]
323 <<
", " << mps[patchi][indexi] <<
nl;
326 <<
tab << npe[patchi][indexi] <<
tab << mpe[patchi][indexi]
327 <<
tab << nps[patchi][indexi] <<
tab << mps[patchi][indexi];
331 this->file() <<
endl;
337 const word& patchName = mesh_.boundary()[patchi].name();
339 os <<
" Parcel fate: patch (number, mass) "
342 << npe[patchi][0] <<
", " << mpe[patchi][0] <<
nl
344 << nps[patchi][0] <<
", " << mps[patchi][0] <<
nl;
347 <<
tab << npe[patchi][0] <<
tab << mpe[patchi][0]
348 <<
tab << nps[patchi][0] <<
tab << mps[patchi][0];
351 this->file() <<
endl;
354 if (this->writeTime())
356 this->setModelProperty(
"nEscape", npe);
357 this->setModelProperty(
"massEscape", mpe);
358 this->setModelProperty(
"nStick", nps);
359 this->setModelProperty(
"massStick", mps);