28 template<
class CloudType>
32 return cloudCopyPtr_();
36 template<
class CloudType>
40 return atomizationModel_;
44 template<
class CloudType>
48 return atomizationModel_();
52 template<
class CloudType>
60 template<
class CloudType>
64 return breakupModel_();
68 template<
class CloudType>
71 return averageParcelMass_;
75 template<
class CloudType>
81 if ((fraction < 0) || (fraction > 1))
84 <<
"fraction should be in the range 0 < fraction < 1" 90 const label nParcel = this->size();
92 const label nParcelSum = globalParcels.
size();
114 scalar m = p.nParticle()*p.mass();
115 scalar d =
mag(p.position() - p.position0());
126 Pstream::gatherList(procMass);
127 Pstream::gatherList(procDist);
129 if (Pstream::master())
134 for (
label proci = 0; proci < Pstream::nProcs(); proci++)
140 globalParcels.
offset(proci)
148 globalParcels.
offset(proci)
158 const scalar mLimit = fraction*mSum;
161 if (mLimit > (mSum - allMass[indices.
last()]))
163 distance = allDist.
last();
169 const scalar mThreshold = (1.0 - fraction)*mSum;
170 scalar mCurrent = 0.0;
175 label indI = indices[i];
177 mCurrent += allMass[indI];
179 if (mCurrent > mThreshold)
186 if (i0 == indices.
size() - 1)
188 distance = allDist.
last();
193 scalar
alpha = (mCurrent - mThreshold)/allMass[indices[i0]];
195 allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]);
201 distance = allDist.
first();
205 Pstream::scatter(distance);
scalar averageParcelMass() const
Return const-access to the average parcel mass.
void sort()
(stable) sort the list (if changed after construction time)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list that is sorted upon construction or when explicitly requested with the sort() method...
void size(const label)
Override size to be inconsistent with allocated storage.
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
Templated atomization model class.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
scalar distance(const vector &p1, const vector &p2)
T & first()
Return the first element of the list.
label offset(const label proci) const
Start of proci data.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A List obtained as a section of another List.
label size() const
Global sum of localSizes.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Templated base class for spray cloud.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void setSize(const label)
Reset size of List.
dimensioned< scalar > mag(const dimensioned< Type > &)
Templated break-up model class.
T & last()
Return the last element of the list.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
label localSize() const
My local size.