28 #include "distribution.H"
32 template<
class CloudType>
42 duration_(this->readDuration(
dict, owner)),
43 massFlowRate_(this->readMassFlowRate(
dict, owner, duration_)),
44 parcelsPerSecond_(this->readParcelsPerSecond(
dict, owner)),
45 U0_(this->coeffDict().lookup(
"U0")),
50 this->coeffDict().subDict(
"sizeDistribution"),
58 template<
class CloudType>
66 duration_(im.duration_),
67 massFlowRate_(im.massFlowRate_),
68 parcelsPerSecond_(im.parcelsPerSecond_),
70 sizeDistribution_(im.sizeDistribution_().
clone().ptr())
76 template<
class CloudType>
83 template<
class CloudType>
90 template<
class CloudType>
93 return this->SOI_ + duration_;
97 template<
class CloudType>
104 if (time0 >= 0 && time0 < duration_)
106 scalar nParcels = parcelsPerSecond_.integral(time0, time1);
108 Random& rnd = this->owner().rndGen();
110 label nParcelsToInject = floor(nParcels);
123 return nParcelsToInject;
132 template<
class CloudType>
139 if (time0 >= 0 && time0 < duration_)
141 return massFlowRate_.integral(time0, time1);
150 template<
class CloudType>
165 this->owner().mesh(),
176 template<
class CloudType>
189 parcel.d() = sizeDistribution_->sample();
193 template<
class CloudType>
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Templated injection model class.
virtual void topoChange()
Set injector locations when mesh is updated.
virtual ~PatchInjection()
Destructor.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
PatchInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual void setPositionAndCell(const fvMesh &mesh, Random &rnd, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Inherit setPositionAndCell from patchInjectionBase.
virtual label nParcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
virtual scalar timeEnd() const
Return the end-of-injection time.
virtual scalar massToInject(const scalar time0, const scalar time1)
Parcel mass to introduce relative to SOI.
scalar globalScalar01()
Advance the state and return a scalar sample from a uniform.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Accumulating histogram of values. Specified bin resolution automatic generation of bins.
Base class for patch-based injection models.
virtual void setPositionAndCell(const fvMesh &mesh, Random &rnd, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
virtual void topoChange(const polyMesh &mesh)
Update patch geometry and derived info for injection locations.
A class for handling words, derived from string.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.