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;
164 label nParcelsToInject = floor(nParcels);
172 nParcels - scalar(nParcelsToInject)
173 > this->owner().
rndGen().position(scalar(0), scalar(1))
180 return nParcelsToInject;
189 template<
class CloudType>
198 if ((time0 >= 0.0) && (time0 < duration_))
200 scalar
c = concentration_.
value(0.5*(time0 + time1));
202 volume = c*(time1 - time0)*flowRate();
205 this->volumeTotal_ = volume;
206 this->massTotal_ = volume*this->owner().constProps().rho0();
212 template<
class CloudType>
224 patchInjectionBase::setPositionAndCell
226 this->owner().
mesh(),
236 template<
class CloudType>
246 parcel.U() = this->owner().U()[parcel.cell()];
249 parcel.d() = sizeDistribution_->sample();
253 template<
class CloudType>
260 template<
class CloudType>
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
PatchFlowRateInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
cachedRandom rndGen(label(0),-1)
virtual ~PatchFlowRateInjection()
Destructor.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
scalar timeEnd() const
Return the end-of-injection time.
const dimensionSet dimArea(sqr(dimLength))
A class for handling words, derived from string.
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 flowRate() const
Return the total volumetric flow rate across the patch [m3/s].
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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
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.
stressControl lookup("compactNormalStress") >> compactNormalStress
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
virtual void updateMesh()
Set injector locations when mesh is updated.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Templated injection model class.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const dimensionSet & dimensions() const
Return dimensions.
Mesh consisting of general polyhedral cells.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
const dimensionedScalar c
Speed of light in a vacuum.
Templated base class for dsmc cloud.
const dimensionSet dimVelocity
const Type & value() const
Return const reference to value.