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 scalar distance = 0.0;
87 const label nParcel = this->size();
89 const label nParcelSum = globalParcels.
size();
111 scalar m =
p.nParticle()*
p.mass();
112 scalar d =
mag(
p.position(mesh) -
p.position0());
123 Pstream::gatherList(procMass);
124 Pstream::gatherList(procDist);
126 if (Pstream::master())
131 for (
label proci = 0; proci < Pstream::nProcs(); proci++)
137 globalParcels.
offset(proci)
145 globalParcels.
offset(proci)
155 const scalar mLimit = fraction*mSum;
158 if (mLimit > (mSum - allMass[indices.
last()]))
160 distance = allDist.
last();
166 const scalar mThreshold = (1.0 - fraction)*mSum;
167 scalar mCurrent = 0.0;
172 label indI = indices[i];
174 mCurrent += allMass[indI];
176 if (mCurrent > mThreshold)
183 if (i0 == indices.
size() - 1)
185 distance = allDist.
last();
190 scalar
alpha = (mCurrent - mThreshold)/allMass[indices[i0]];
192 allDist[i0] +
alpha*(allDist[i0+1] - allDist[i0]);
198 distance = allDist.
first();
202 Pstream::scatter(distance);
#define forAllReverse(list, i)
Reverse loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Templated atomisation model class.
Templated break-up model class.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A list that is sorted upon construction or when explicitly requested with the sort() method.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
void sort()
(stable) sort the list (if changed after construction time)
Templated base class for spray cloud.
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup 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.
const AtomisationModel< SprayCloud< CloudType > > & atomisation() const
Return const-access to the atomisation model.
A List obtained as a section of another List.
T & first()
Return the first element of the list.
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...
label localSize() const
My local size.
label size() const
Global sum of localSizes.
label offset(const label proci) const
Start of proci data.
Mesh consisting of general polyhedral cells.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensioned< scalar > mag(const dimensioned< Type > &)