diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index e284299f32b6e098640ab26bc8cbb9c04ad1a0da..2bf5f06066d4b9c43eddd785ddd1af6d3d8f26df 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -462,6 +462,12 @@ public: //- Total rotational kinetic energy in the system inline scalar rotationalKineticEnergyOfSystem() const; + //- Penetration for percentage of the current total mass + inline scalar penetration(const scalar& prc) const; + + //- Mean diameter Dij + inline scalar Dij(const label i, const label j) const; + // Fields diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index 6522aa2cad7732642c3fc42f30be606339fe1e2c..92b9040ebd477a863a11699fdb5072e59daf35f5 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -278,6 +278,131 @@ Foam::KinematicCloud<CloudType>::rotationalKineticEnergyOfSystem() const } +template<class CloudType> +inline Foam::scalar Foam::KinematicCloud<CloudType>::Dij +( + const label i, + const label j +) const +{ + scalar si = 0.0; + scalar sj = 0.0; + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) + { + const parcelType& p = iter(); + si += p.nParticle()*pow(p.d(), i); + sj += p.nParticle()*pow(p.d(), j); + } + + reduce(si, sumOp<scalar>()); + reduce(sj, sumOp<scalar>()); + sj = max(sj, VSMALL); + + return si/sj; +} + + +template<class CloudType> +inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration +( + const scalar& prc +) const +{ + scalar distance = 0.0; + scalar mTot = 0.0; + + label np = this->size(); + + // arrays containing the parcels mass and + // distance from injector in ascending order + scalarField mass(np); + scalarField dist(np); + + if (np > 0) + { + label n = 0; + + // first arrange the parcels in ascending order + // the first parcel is closest to its injection position + // and the last one is most far away. + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) + { + const parcelType& p = iter(); + scalar mi = p.nParticle()*p.mass(); + scalar di = mag(p.position() - p.position0()); + mTot += mi; + + // insert at the last place + mass[n] = mi; + dist[n] = di; + + label i = 0; + bool found = false; + + // insert the parcel in the correct place + // and move the others + while ((i < n) && (!found)) + { + if (di < dist[i]) + { + found = true; + for (label j=n; j>i; j--) + { + mass[j] = mass[j-1]; + dist[j] = dist[j-1]; + } + mass[i] = mi; + dist[i] = di; + } + i++; + } + n++; + } + } + + reduce(mTot, sumOp<scalar>()); + + if (np > 0) + { + scalar mLimit = prc*mTot; + scalar mOff = (1.0 - prc)*mTot; + + if (np > 1) + { + // 'prc' is large enough that the parcel most far + // away will be used, no need to loop... + if (mLimit > mTot - mass[np-1]) + { + distance = dist[np-1]; + } + else + { + scalar mOffSum = 0.0; + label i = np; + + while ((mOffSum < mOff) && (i>0)) + { + i--; + mOffSum += mass[i]; + } + distance = + dist[i+1] + + (dist[i] - dist[i+1])*(mOffSum - mOff) + /mass[i+1] ; + } + } + else + { + distance = dist[0]; + } + } + + reduce(distance, maxOp<scalar>()); + + return distance; +} + + template<class CloudType> inline Foam::cachedRandom& Foam::KinematicCloud<CloudType>::rndGen() { diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C index 987bd0f770cdb72ba4abd8c4ff2b95eb99c83a4e..346a2dccc21829949bdfe314035c4ee951fd6db9 100644 --- a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C @@ -185,9 +185,10 @@ void Foam::SprayCloud<CloudType>::checkParcelProperties parcel.position0() = parcel.position(); parcel.d0() = parcel.d(); - parcel.y() = breakup().y0(); parcel.yDot() = breakup().yDot0(); + + parcel.liquidCore() = atomization().initLiquidCore(); } @@ -337,137 +338,12 @@ void Foam::SprayCloud<CloudType>::motion(TrackData& td) } -template<class CloudType> -Foam::scalar Foam::SprayCloud<CloudType>::D -( - const label i, - const label j -) const -{ - scalar si = 0.0; - scalar sj = 0.0; - forAllConstIter(typename SprayCloud<CloudType>, *this, iter) - { - const parcelType& p = iter(); - si += p.nParticle()*pow(p.d(), i); - sj += p.nParticle()*pow(p.d(), j); - } - - reduce(si, sumOp<scalar>()); - reduce(sj, sumOp<scalar>()); - sj = max(sj, VSMALL); - - return si/sj; -} - - -template<class CloudType> -Foam::scalar Foam::SprayCloud<CloudType>::liquidPenetration -( - const scalar& prc -) const -{ - scalar distance = 0.0; - scalar mTot = 0.0; - - label np = this->size(); - - // arrays containing the parcels mass and - // distance from injector in ascending order - scalarField mass(np); - scalarField dist(np); - - if (np > 0) - { - label n = 0; - - // first arrange the parcels in ascending order - // the first parcel is closest to its injection position - // and the last one is most far away. - forAllConstIter(typename SprayCloud<CloudType>, *this, iter) - { - const parcelType& p = iter(); - scalar mi = p.nParticle()*p.mass(); - scalar di = mag(p.position() - p.position0()); - mTot += mi; - - // insert at the last place - mass[n] = mi; - dist[n] = di; - - label i = 0; - bool found = false; - - // insert the parcel in the correct place - // and move the others - while (( i < n ) && (!found)) - { - if (di < dist[i]) - { - found = true; - for (label j=n; j>i; j--) - { - mass[j] = mass[j-1]; - dist[j] = dist[j-1]; - } - mass[i] = mi; - dist[i] = di; - } - i++; - } - n++; - } - } - - reduce(mTot, sumOp<scalar>()); - - if (np > 0) - { - scalar mLimit = prc*mTot; - scalar mOff = (1.0 - prc)*mTot; - - if (np > 1) - { - // 'prc' is large enough that the parcel most far - // away will be used, no need to loop... - if (mLimit > mTot - mass[np-1]) - { - distance = dist[np-1]; - } - else - { - scalar mOffSum = 0.0; - label i = np; - - while ((mOffSum < mOff) && (i>0)) - { - i--; - mOffSum += mass[i]; - } - distance = - dist[i+1] - + (dist[i] - dist[i+1])*(mOffSum - mOff) - /mass[i+1] ; - } - } - else - { - distance = dist[0]; - } - } - - reduce(distance, maxOp<scalar>()); - - return distance; -} - - template<class CloudType> void Foam::SprayCloud<CloudType>::info() const { CloudType::info(); - scalar d32 = 1.0e+6*D(3, 2); - scalar pen = liquidPenetration(0.95); + scalar d32 = 1.0e+6*this->Dij(3, 2); + scalar pen = this->penetration(0.95); Info << " D32 (mu) = " << d32 << endl; Info << " Liquid penetration 95% mass (m) = " << pen << endl; diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H index 24f9a6f1fd2a8f6e9b2443998b3f78f549d83f30..21fa515e7b69f9510fb3f981c69f2e0c1d7e4a2d 100644 --- a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H @@ -203,12 +203,6 @@ public: // Check - //- Calculate the liquid penetration for prc % of the mass - scalar liquidPenetration(const scalar& prc) const; - - //- Calculate the diameter Dij - scalar D(const label i, const label j) const; - //- Print cloud information void info() const; diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H index 9e8984132e5f607e141a076c0f9a7e40d5baf2a6..da87dc91fccbf16be2d4199d115aa011fd807e5b 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H @@ -38,7 +38,6 @@ inline Foam::SprayParcel<ParcelType>::SprayParcel ParcelType(mesh, position, cellI, tetFaceI, tetPtI), d0_(this->d()), position0_(position), -// liquidCore_(owner.atomization().initLiquidCore()), liquidCore_(0.0), KHindex_(0.0), y_(0.0),