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>
76 if ((fraction < 0) || (fraction > 1))
79 <<
"fraction should be in the range 0 < fraction < 1" 85 const label nParcel = this->size();
87 const label nParcelSum = globalParcels.
size();
109 scalar m = p.nParticle()*p.mass();
110 scalar d =
mag(p.position() - p.position0());
121 Pstream::gatherList(procMass);
122 Pstream::gatherList(procDist);
124 if (Pstream::master())
129 for (
label proci = 0; proci < Pstream::nProcs(); proci++)
135 globalParcels.
offset(proci)
143 globalParcels.
offset(proci)
153 const scalar mLimit = fraction*mSum;
156 if (mLimit > (mSum - allMass[indices.
last()]))
158 distance = allDist.
last();
164 const scalar mThreshold = (1.0 - fraction)*mSum;
165 scalar mCurrent = 0.0;
170 label indI = indices[i];
172 mCurrent += allMass[indI];
174 if (mCurrent > mThreshold)
181 if (i0 == indices.
size() - 1)
183 distance = allDist.
last();
188 scalar
alpha = (mCurrent - mThreshold)/allMass[indices[i0]];
190 allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]);
196 distance = allDist.
first();
200 Pstream::scatter(distance);
void sort()
(stable) sort the list (if changed after construction time)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
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.
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.