32 template<
class CloudType>
39 if ((time0 >= 0.0) && (time0 < duration_))
41 return round(fraction_*(time1 - time0)*parcelsPerSecond_);
50 template<
class CloudType>
57 if ((time0 >= 0.0) && (time0 < duration_))
59 return fraction_*volumeFlowRate_().integrate(time0, time1);
70 template<
class CloudType>
78 patchName_(this->coeffDict().lookup(
"patchName")),
79 duration_(
readScalar(this->coeffDict().lookup(
"duration"))),
82 readScalar(this->coeffDict().lookup(
"parcelsPerSecond"))
84 U0_(this->coeffDict().lookup(
"U0")),
97 this->coeffDict().subDict(
"parcelPDF"),
104 label patchId = owner.mesh().boundaryMesh().findPatchID(patchName_);
110 "PatchInjection<CloudType>::PatchInjection"
112 "const dictionary&, "
115 ) <<
"Requested patch " << patchName_ <<
" not found" <<
nl
116 <<
"Available patches are: " << owner.mesh().boundaryMesh().names()
120 const polyPatch& patch = owner.mesh().boundaryMesh()[patchId];
124 label patchSize = cellOwners_.
size();
125 label totalPatchSize = patchSize;
127 fraction_ = scalar(patchSize)/totalPatchSize;
130 this->volumeTotal_ = fraction_*volumeFlowRate_().integrate(0.0, duration_);
131 this->massTotal_ *= fraction_;
137 template<
class CloudType>
144 template<
class CloudType>
151 template<
class CloudType>
154 return this->SOI_ + duration_;
158 template<
class CloudType>
168 if (cellOwners_.size() > 0)
170 label cellI = this->owner().rndGen().integer(0, cellOwners_.size() - 1);
172 cellOwner = cellOwners_[cellI];
173 position = this->owner().mesh().C()[cellOwner];
184 template<
class CloudType>
190 typename CloudType::parcelType&
parcel
197 parcel.d() = parcelPDF_->sample();
201 template<
class CloudType>
208 template<
class CloudType>