32 template<
class CloudType>
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_.integrate(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_;
127 label nParcelsToInject = floor(nParcels);
135 nParcels - scalar(nParcelsToInject)
143 return nParcelsToInject;
152 template<
class CloudType>
159 if ((time0 >= 0.0) && (time0 < duration_))
161 return flowRateProfile_.integrate(time0, time1);
170 template<
class CloudType>
182 patchInjectionBase::setPositionAndCell
184 this->owner().
mesh(),
194 template<
class CloudType>
207 parcel.d() = sizeDistribution_->sample();
211 template<
class CloudType>
218 template<
class CloudType>
cachedRandom rndGen(label(0),-1)
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.
Type globalPosition(const Type &start, const Type &end)
Return a sample between start and end.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual scalar timeEnd() const
Return the end-of-injection time.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
stressControl lookup("compactNormalStress") >> compactNormalStress
A class for handling words, derived from string.
virtual ~PatchInjection()
Destructor.
PatchInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
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.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Templated base class for dsmc cloud.