32 template<
class CloudType>
42 duration_(this->coeffDict().template lookup<scalar>(
"duration")),
45 this->coeffDict().
template lookup<scalar>(
"parcelsPerSecond")
47 U0_(this->coeffDict().
lookup(
"U0")),
61 this->coeffDict().subDict(
"sizeDistribution"),
66 duration_ = owner.db().time().userTimeToTime(duration_);
68 patchInjectionBase::updateMesh(owner.mesh());
71 this->volumeTotal_ = flowRateProfile_.integral(0.0, duration_);
75 template<
class CloudType>
83 duration_(im.duration_),
84 parcelsPerSecond_(im.parcelsPerSecond_),
86 flowRateProfile_(im.flowRateProfile_),
87 sizeDistribution_(im.sizeDistribution_().clone().ptr())
93 template<
class CloudType>
100 template<
class CloudType>
103 patchInjectionBase::updateMesh(this->owner().
mesh());
107 template<
class CloudType>
110 return this->SOI_ + duration_;
114 template<
class CloudType>
121 if ((time0 >= 0.0) && (time0 < duration_))
123 scalar nParcels = (time1 - time0)*parcelsPerSecond_;
125 Random& rnd = this->owner().rndGen();
127 label nParcelsToInject = floor(nParcels);
140 return nParcelsToInject;
149 template<
class CloudType>
156 if ((time0 >= 0.0) && (time0 < duration_))
158 return flowRateProfile_.integral(time0, time1);
167 template<
class CloudType>
179 patchInjectionBase::setPositionAndCell
181 this->owner().
mesh(),
191 template<
class CloudType>
204 parcel.d() = sizeDistribution_->sample();
208 template<
class CloudType>
215 template<
class CloudType>
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Templated injection model class.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual scalar timeEnd() const
Return the end-of-injection time.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
stressControl lookup("compactNormalStress") >> compactNormalStress
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
A class for handling words, derived from string.
virtual ~PatchInjection()
Destructor.
Base class for patch-based injection models.
scalar globalScalar01()
Advance the state and return a scalar sample from a uniform.
PatchInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual void setPositionAndCell(const label parcelI, const label nParcels, const scalar time, vector &position, label &cellOwner, label &tetFacei, label &tetPti)
Set the injection position and owner cell, tetFace and tetPt.
Templated base class for dsmc cloud.