30 template<
class CloudType>
34 return cloudCopyPtr_();
38 template<
class CloudType>
42 return atomisationModel_;
46 template<
class CloudType>
50 return atomisationModel_();
54 template<
class CloudType>
62 template<
class CloudType>
66 return breakupModel_();
70 template<
class CloudType>
73 return averageParcelMass_;
77 template<
class CloudType>
83 if ((fraction < 0) || (fraction > 1))
86 <<
"fraction should be in the range 0 < fraction < 1" 92 const label nParcel = this->size();
94 const label nParcelSum = globalParcels.
size();
116 scalar m = p.nParticle()*p.mass();
117 scalar d =
mag(p.position() - p.position0());
128 Pstream::gatherList(procMass);
129 Pstream::gatherList(procDist);
131 if (Pstream::master())
136 for (
label proci = 0; proci < Pstream::nProcs(); proci++)
142 globalParcels.
offset(proci)
150 globalParcels.
offset(proci)
160 const scalar mLimit = fraction*mSum;
163 if (mLimit > (mSum - allMass[indices.
last()]))
165 distance = allDist.
last();
171 const scalar mThreshold = (1.0 - fraction)*mSum;
172 scalar mCurrent = 0.0;
177 label indI = indices[i];
179 mCurrent += allMass[indI];
181 if (mCurrent > mThreshold)
188 if (i0 == indices.
size() - 1)
190 distance = allDist.
last();
195 scalar
alpha = (mCurrent - mThreshold)/allMass[indices[i0]];
197 allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]);
203 distance = allDist.
first();
207 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.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const AtomisationModel< SprayCloud< CloudType > > & atomisation() const
Return const-access to the atomisation model.
#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.
Templated atomisation model class.
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.
label localSize() const
My local size.