39 template<
class CloudType>
42 "absorb",
"bounce",
"splashBai"
48 template<
class CloudType>
52 forAll(interactionTypeNames_, i)
54 if (interactionTypeNames_[i] == it)
56 return interactionType(i);
61 <<
"Unknown interaction type " << it
62 <<
". Valid interaction types include: " << interactionTypeNames_
69 template<
class CloudType>
72 const interactionType& it
75 if (it >= interactionTypeNames_.size())
81 return interactionTypeNames_[it];
87 template<
class CloudType>
94 scalar magTangent = 0.0;
96 while (magTangent < SMALL)
99 tangent = vTest - (vTest & v)*v;
100 magTangent =
mag(tangent);
103 return tangent/magTangent;
107 template<
class CloudType>
116 const scalar phiSi =
twoPi*rndGen_.sample01<scalar>();
119 const scalar thetaSi =
degToRad(rndGen_.sample01<scalar>()*(50 - 5) + 5);
123 const scalar dcorr =
cos(thetaSi);
128 return dirVec/
mag(dirVec);
132 template<
class CloudType>
141 const_cast<regionFilm*
>
143 mesh.
time().objectRegistry::template findObject
148 "surfaceFilmProperties"
153 if (areaFilms_.size() == 0)
157 mesh.
time().objectRegistry::template
158 sortedNames<regionModels::regionFaModel>();
163 mesh.
time().objectRegistry::template findObject
168 if (regionFa && isA<areaFilm>(*regionFa))
171 const_cast<areaFilm&
>(refCast<const areaFilm>(*regionFa));
172 areaFilms_.append(&film);
179 template<
class CloudType>
184 this->coeffDict().readEntry(
"pRef", pRef_);
185 this->coeffDict().readEntry(
"TRef", TRef_);
191 template<
class CloudType>
192 template<
class filmType>
205 Info<<
"Parcel " <<
p.origId() <<
" absorbInteraction" <<
endl;
212 const vector& Up = this->owner().U().boundaryField()[pp.
index()][facei];
233 this->nParcelsTransferred()++;
235 this->totalMassTransferred() += mass;
237 keepParticle =
false;
241 template<
class CloudType>
252 Info<<
"Parcel " <<
p.origId() <<
" bounceInteraction" <<
endl;
259 const vector& Up = this->owner().U().boundaryField()[pp.
index()][facei];
265 p.U() -= 2.0*nf*(
Urel & nf);
271 template<
class CloudType>
272 template<
class filmType>
286 Info<<
"Parcel " <<
p.origId() <<
" drySplashInteraction" <<
endl;
290 const vector& Up = this->owner().U().boundaryField()[pp.
index()][facei];
297 const scalar m =
p.mass()*
p.nParticle();
298 const scalar
rho =
p.rho();
299 const scalar d =
p.d();
310 const scalar Wec = Adry_*
pow(La, -0.183);
314 absorbInteraction<filmType>
315 (filmModel,
p, pp, facei, m, keepParticle);
320 const scalar mRatio = 0.2 + 0.6*rndGen_.sample01<scalar>();
321 splashInteraction<filmType>
322 (filmModel,
p, pp, facei, mRatio, We, Wec,
sigma, keepParticle);
327 template<
class CloudType>
328 template<
class filmType>
342 Info<<
"Parcel " <<
p.origId() <<
" wetSplashInteraction" <<
endl;
346 const vector& Up = this->owner().U().boundaryField()[pp.
index()][facei];
350 const scalar m =
p.mass()*
p.nParticle();
351 const scalar
rho =
p.rho();
352 const scalar d =
p.d();
365 const scalar Wec = Awet_*
pow(La, -0.183);
369 absorbInteraction<filmType>
370 (filmModel,
p, pp, facei, m, keepParticle);
372 else if ((We >= 2) && (We < 20))
378 const scalar
epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));
386 else if ((We >= 20) && (We < Wec))
388 absorbInteraction<filmType>
389 (filmModel,
p, pp, facei, m, keepParticle);
395 const scalar mRatio = 0.2 + 0.9*rndGen_.sample01<scalar>();
396 splashInteraction<filmType>
397 (filmModel,
p, pp, facei, mRatio, We, Wec,
sigma, keepParticle);
402 template<
class CloudType>
403 template<
class filmType>
419 const vector& Up = this->owner().U().boundaryField()[pp.
index()][facei];
423 const vector tanVec1(tangentVector(nf));
424 const vector tanVec2(nf^tanVec1);
427 const scalar np =
p.nParticle();
428 const scalar m =
p.mass()*np;
429 const scalar d =
p.d();
437 const scalar mSplash = m*mRatio;
440 const scalar Ns = 5.0*(We/Wec - 1.0);
443 const scalar dBarSplash = 1/
cbrt(6.0)*
cbrt(mRatio/Ns)*d + ROOTVSMALL;
446 const scalar dMax = 0.9*
cbrt(mRatio)*d;
447 const scalar dMin = 0.1*dMax;
448 const scalar
K =
exp(-dMin/dBarSplash) -
exp(-dMax/dBarSplash);
451 scalar ESigmaSec = 0;
458 const scalar
y = rndGen_.sample01<scalar>();
459 dNew[i] = -dBarSplash*
log(
exp(-dMin/dBarSplash) -
y*
K);
460 npNew[i] = mRatio*np*
pow3(d)/
pow3(dNew[i])/parcelsPerSplash_;
461 ESigmaSec += npNew[i]*
sigma*
p.areaS(dNew[i]);
465 const scalar EKIn = 0.5*m*
magSqr(Un);
468 const scalar ESigmaIn = np*
sigma*
p.areaS(d);
474 const scalar EKs = EKIn + ESigmaIn - ESigmaSec - Ed;
479 absorbInteraction<filmType>
480 (filmModel,
p, pp, facei, m, keepParticle);
485 const scalar logD =
log(d);
486 const scalar coeff2 =
log(dNew[0]) - logD + ROOTVSMALL;
490 coeff1 +=
sqr(
log(dNew[i]) - logD);
494 const scalar magUns0 =
495 sqrt(2.0*parcelsPerSplash_*EKs/mSplash/(1.0 + coeff1/
sqr(coeff2)));
500 const vector dirVec = splashDirection(tanVec1, tanVec2, -nf);
503 parcelType* pPtr =
new parcelType(
p);
505 pPtr->origId() = pPtr->getNewParticleID();
509 if (splashParcelType_ >= 0)
511 pPtr->typeId() = splashParcelType_;
515 pPtr->track(0.5*rndGen_.sample01<scalar>()*(posC - posCf), 0);
517 pPtr->nParticle() = npNew[i];
521 pPtr->U() = dirVec*(
mag(Cf_*Ut) + magUns0*(
log(dNew[i]) - logD)/coeff2);
534 const scalar mDash = m - mSplash;
535 absorbInteraction<filmType>
536 (filmModel,
p, pp, facei, mDash, keepParticle);
542 template<
class CloudType>
558 interactionTypeEnum(this->coeffDict().getWord(
"interactionType"))
561 splashParcelType_(0),
562 parcelsPerSplash_(0),
569 <<
" interaction model" <<
endl;
573 this->coeffDict().readEntry(
"deltaWet",
deltaWet_);
575 this->coeffDict().getOrDefault(
"splashParcelType", -1);
577 this->coeffDict().getOrDefault(
"parcelsPerSplash", 2);
578 this->coeffDict().readEntry(
"Adry",
Adry_);
579 this->coeffDict().readEntry(
"Awet",
Awet_);
580 this->coeffDict().readEntry(
"Cf",
Cf_);
586 template<
class CloudType>
594 rndGen_(sfm.rndGen_),
598 interactionType_(sfm.interactionType_),
599 deltaWet_(sfm.deltaWet_),
600 splashParcelType_(sfm.splashParcelType_),
601 parcelsPerSplash_(sfm.parcelsPerSplash_),
605 nParcelsSplashed_(sfm.nParcelsSplashed_)
616 template<
class CloudType>
624 const label patchi = pp.
index();
626 bool bInteraction(
false);
633 if (filmModel_->isRegionPatch(patchi))
637 switch (interactionType_)
641 bounceInteraction(
p, pp, facei, keepParticle);
647 const scalar m =
p.nParticle()*
p.mass();
649 absorbInteraction<regionFilm>
650 (*filmModel_,
p, pp, facei, m, keepParticle);
656 bool dry = this->deltaFilmPatch_[patchi][facei] < deltaWet_;
659 const scalar
mu = thermo_->mu(pRef_, TRef_, X);
660 const scalar
sigma = thermo_->sigma(pRef_, TRef_, X);
664 drySplashInteraction<regionFilm>
665 (*filmModel_,
sigma,
mu,
p, pp, facei, keepParticle);
669 wetSplashInteraction<regionFilm>
670 (*filmModel_,
sigma,
mu,
p, pp, facei, keepParticle);
678 <<
"Unknown interaction type enumeration"
689 for (areaFilm& film : areaFilms_)
691 if (patchi == film.patchID())
695 switch (interactionType_)
700 const scalar m =
p.nParticle()*
p.mass();
702 absorbInteraction<areaFilm>
704 film,
p, pp, facei, m, keepParticle
710 bounceInteraction(
p, pp, facei, keepParticle);
716 bool dry = film.h()[facei] < deltaWet_;
724 const scalar pRef = film.pRef();
733 drySplashInteraction<areaFilm>
734 (film,
sigma,
mu,
p, pp, facei, keepParticle);
738 wetSplashInteraction<areaFilm>
739 (film,
sigma,
mu,
p, pp, facei, keepParticle);
747 <<
"Unknown interaction type enumeration"
761 template<
class CloudType>
764 const label filmPatchi,
765 const label primaryPatchi,
778 template<
class CloudType>
781 const label filmPatchi,
782 const areaFilm& filmModel
793 template<
class CloudType>
797 const label filmFacei
804 template<
class CloudType>
809 label nSplash0 = this->
template getModelProperty<label>(
"nParcelsSplashed");
813 os <<
" - new splash parcels = " << nSplashTotal <<
endl;
815 if (this->writeTime())
817 this->setModelProperty(
"nParcelsSplashed", nSplashTotal);
818 nParcelsSplashed_ = 0;