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"))
72 massEscape_(nEscape_.size()),
73 nStick_(nEscape_.size()),
74 massStick_(nEscape_.size()),
77 const bool outputByInjectorId =
78 this->coeffDict().getOrDefault(
"outputByInjectorId",
false);
84 const word interactionTypeName(this->coeffDict().getWord(
"type"));
87 <<
"Unknown interaction result type "
88 << interactionTypeName
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())
130 template<
class CloudType>
133 const StandardWallInteraction<CloudType>& pim
138 interactionType_(pim.interactionType_),
141 nEscape_(pim.nEscape_),
142 massEscape_(pim.massEscape_),
143 nStick_(pim.nStick_),
144 massStick_(pim.massStick_),
145 injIdToIndex_(pim.injIdToIndex_)
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);
214 if (
mag(Up) > 0 &&
mag(
U) < this->Urmax())
217 <<
"Particle U the same as patch "
218 <<
" The particle has been removed" <<
nl <<
endl;
220 keepParticle =
false;
231 U -= (1.0 + e_)*Un*nw;
245 <<
"Unknown interaction type "
246 << this->interactionTypeToWord(interactionType_)
247 <<
"(" << interactionType_ <<
")" <<
endl
259 template<
class CloudType>
271 label lsd = nEscape_[patchi].size();
272 npe0[patchi].setSize(lsd,
Zero);
273 mpe0[patchi].setSize(lsd,
Zero);
274 nps0[patchi].setSize(lsd,
Zero);
275 mps0[patchi].setSize(lsd,
Zero);
278 this->getModelProperty(
"nEscape", npe0);
279 this->getModelProperty(
"massEscape", mpe0);
280 this->getModelProperty(
"nStick", nps0);
281 this->getModelProperty(
"massStick", mps0);
289 npe[i] = npe[i] + npe0[i];
296 mpe[i] = mpe[i] + mpe0[i];
303 nps[i] = nps[i] + nps0[i];
310 mps[i] = mps[i] + mps0[i];
313 if (injIdToIndex_.size())
317 labelList indexToInjector(injIdToIndex_.size());
320 indexToInjector[iter.val()] = iter.key();
325 forAll(mpe[patchi], indexi)
327 const word& patchName = mesh_.boundary()[patchi].name() ;
329 os <<
" Parcel fate: patch " << patchName
330 <<
" (number, mass)" <<
nl
331 <<
" - escape (injector " << indexToInjector[indexi]
332 <<
") = " << npe[patchi][indexi]
333 <<
", " << mpe[patchi][indexi] <<
nl
334 <<
" - stick (injector " << indexToInjector[indexi]
335 <<
") = " << nps[patchi][indexi]
336 <<
", " << mps[patchi][indexi] <<
nl;
339 <<
tab << npe[patchi][indexi] <<
tab << mpe[patchi][indexi]
340 <<
tab << nps[patchi][indexi] <<
tab << mps[patchi][indexi];
344 this->file() <<
endl;
350 const word& patchName = mesh_.boundary()[patchi].name();
352 os <<
" Parcel fate: patch (number, mass) "
355 << npe[patchi][0] <<
", " << mpe[patchi][0] <<
nl
357 << nps[patchi][0] <<
", " << mps[patchi][0] <<
nl;
360 <<
tab << npe[patchi][0] <<
tab << mpe[patchi][0]
361 <<
tab << nps[patchi][0] <<
tab << mps[patchi][0];
364 this->file() <<
endl;
367 if (this->writeTime())
369 this->setModelProperty(
"nEscape", npe);
370 this->setModelProperty(
"massEscape", mpe);
371 this->setModelProperty(
"nStick", nps);
372 this->setModelProperty(
"massStick", mps);