31template<
class CloudType>
35 return *cloudCopyPtr_;
39template<
class CloudType>
43 return atomizationModel_;
47template<
class CloudType>
51 return *atomizationModel_;
55template<
class CloudType>
63template<
class CloudType>
67 return *breakupModel_;
71template<
class CloudType>
74 return averageParcelMass_;
78template<
class CloudType>
84 if ((fraction < 0) || (fraction > 1))
87 <<
"fraction should be in the range 0 < fraction < 1"
91 const label nParcel = this->size();
93 const label nTotParcel = globalParcels.
totalSize();
109 scalar m =
p.nParticle()*
p.mass();
110 scalar d =
mag(
p.position() -
p.position0());
125 if (Pstream::master())
138 const scalar mLimit = fraction*mTotal;
141 if (mLimit > (mTotal - mass[indices.
last()]))
149 const scalar mThreshold = (1.0 - fraction)*mTotal;
155 label indI = indices[i];
157 mCurrent += mass[indI];
159 if (mCurrent > mThreshold)
166 if (i0 == indices.
size() - 1)
173 scalar
alpha = (mCurrent - mThreshold)/mass[indices[i0]];
177 +
alpha*(sortedDist[i0+1] - sortedDist[i0])
184 Pstream::scatter(distance);
reduce(hasMovingMesh, orOp< bool >())
Templated atomization model class.
Templated break-up model class.
const T & last() const
The last element of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An indirect list with addressing based on sorting. The list is sorted upon construction or when expli...
const labelUList & indices() const noexcept
Return the list of sorted indices (updated every sort).
Templated base class for spray cloud.
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
scalar averageParcelMass() const
Return const-access to the average parcel mass.
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
void gatherInplace(List< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const
Inplace collect data in processor order on master (in serial: a no-op).
label totalSize() const
Global sum of localSizes.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar distance(const vector &p1, const vector &p2)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAllReverse(list, i)
Reverse loop across all elements in list.