34 template<
class CloudType>
44 phiName_(this->coeffDict().template lookupOrDefault<word>(
"phi",
"phi")),
45 rhoName_(this->coeffDict().
template lookupOrDefault<word>(
"rho",
"rho")),
64 this->coeffDict().subDict(
"sizeDistribution"),
69 duration_ = owner.db().time().userTimeToTime(duration_);
71 patchInjectionBase::updateMesh(owner.mesh());
75 this->volumeTotal_ = 0.0;
76 this->massTotal_ = 0.0;
80 template<
class CloudType>
88 phiName_(im.phiName_),
89 rhoName_(im.rhoName_),
90 duration_(im.duration_),
91 concentration_(im.concentration_),
92 parcelConcentration_(im.parcelConcentration_),
93 sizeDistribution_(im.sizeDistribution_().clone().ptr())
99 template<
class CloudType>
106 template<
class CloudType>
109 patchInjectionBase::updateMesh(this->owner().
mesh());
113 template<
class CloudType>
116 return this->SOI_ + duration_;
120 template<
class CloudType>
130 scalar flowRateIn = 0.0;
133 flowRateIn =
max(0.0, -
sum(phip));
141 flowRateIn =
max(0.0, -
sum(phip/rhop));
150 template<
class CloudType>
157 if ((time0 >= 0.0) && (time0 < duration_))
159 scalar dt = time1 - time0;
161 scalar
c = concentration_.
value(0.5*(time0 + time1));
163 scalar nParcels = parcelConcentration_*c*flowRate()*dt;
167 label nParcelsToInject = floor(nParcels);
175 nParcels - scalar(nParcelsToInject)
183 return nParcelsToInject;
192 template<
class CloudType>
201 if ((time0 >= 0.0) && (time0 < duration_))
203 scalar
c = concentration_.
value(0.5*(time0 + time1));
205 volume = c*(time1 - time0)*flowRate();
208 this->volumeTotal_ = volume;
209 this->massTotal_ = volume*this->owner().constProps().rho0();
215 template<
class CloudType>
227 patchInjectionBase::setPositionAndCell
229 this->owner().
mesh(),
239 template<
class CloudType>
249 parcel.U() = this->owner().U()[parcel.cell()];
252 parcel.d() = sizeDistribution_->sample();
256 template<
class CloudType>
263 template<
class CloudType>
cachedRandom rndGen(label(0),-1)
virtual scalar flowRate() const
Return the total volumetric flow rate across the patch [m3/s].
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
scalar timeEnd() const
Return the end-of-injection time.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Templated injection model class.
Type globalPosition(const Type &start, const Type &end)
Return a sample between start and end.
const Type & value() const
Return const reference to value.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
virtual void updateMesh()
Set injector locations when mesh is updated.
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.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
stressControl lookup("compactNormalStress") >> compactNormalStress
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A class for handling words, derived from string.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
const dimensionSet & dimensions() const
Return dimensions.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Patch injection, by using patch flow rate to determine concentration and velocity.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
PatchFlowRateInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
const dimensionedScalar c
Speed of light in a vacuum.
Mesh consisting of general polyhedral cells.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Templated base class for dsmc cloud.
virtual ~PatchFlowRateInjection()
Destructor.
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity