Go to the documentation of this file.
35 template<
class CloudType>
45 duration_(this->coeffDict().getScalar(
"duration")),
48 this->coeffDict().getScalar(
"parcelsPerSecond")
50 U0_(this->coeffDict().lookup(
"U0")),
64 this->coeffDict().subDict(
"sizeDistribution"),
69 duration_ = owner.db().time().userTimeToTime(duration_);
71 patchInjectionBase::updateMesh(owner.
mesh());
74 this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_);
78 template<
class CloudType>
86 duration_(im.duration_),
87 parcelsPerSecond_(im.parcelsPerSecond_),
89 flowRateProfile_(im.flowRateProfile_),
90 sizeDistribution_(im.sizeDistribution_.clone())
96 template<
class CloudType>
103 template<
class CloudType>
106 patchInjectionBase::updateMesh(this->owner().
mesh());
110 template<
class CloudType>
113 return this->SOI_ + duration_;
117 template<
class CloudType>
124 if ((time0 >= 0.0) && (time0 < duration_))
126 scalar nParcels = (time1 - time0)*parcelsPerSecond_;
129 label nParcelsToInject = floor(nParcels);
136 && (nParcels - scalar(nParcelsToInject) > rndPos)
142 return nParcelsToInject;
149 template<
class CloudType>
156 if ((time0 >= 0.0) && (time0 < duration_))
158 return flowRateProfile_.integrate(time0, time1);
165 template<
class CloudType>
177 patchInjectionBase::setPositionAndCell
179 this->owner().
mesh(),
189 template<
class CloudType>
202 parcel.d() = sizeDistribution_->sample();
206 template<
class CloudType>
213 template<
class CloudType>
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
A class for handling words, derived from Foam::string.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Templated injection model class.
Random & rndGen()
Return reference to the random object.
PatchInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
const fvMesh & mesh() const
Return reference to the mesh.
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.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
word getWord(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Same as get< word >(const word&, keyType::option)
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)
Global function forwards to reuseTmpDimensionedField::New.
virtual ~PatchInjection()
Destructor.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
virtual void updateMesh()
Set injector locations when mesh is updated.
Type globalPosition(const Type &start, const Type &end)
Return a sample on the interval [start,end].