34 template<
class CloudType>
44 phiName_(this->coeffDict().template lookupOrDefault<word>(
"phi",
"phi")),
45 rhoName_(this->coeffDict().
template lookupOrDefault<word>(
"rho",
"rho")),
46 duration_(this->coeffDict().
template lookup<scalar>(
"duration")),
58 this->coeffDict().
template lookup<scalar>(
"parcelConcentration")
64 this->coeffDict().subDict(
"sizeDistribution"),
69 duration_ = owner.db().time().userTimeToTime(duration_);
71 patchInjectionBase::topoChange(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::topoChange(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;
165 Random& rnd = this->owner().rndGen();
167 label nParcelsToInject = floor(nParcels);
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>
220 template<
class CloudType>
232 patchInjectionBase::setPositionAndCell
234 this->owner().
mesh(),
244 template<
class CloudType>
254 parcel.U() = this->owner().U()[parcel.cell()];
257 parcel.d() = sizeDistribution_->sample();
261 template<
class CloudType>
268 template<
class CloudType>
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
A list of keyword definitions, which are a keyword followed by any number of values (e...
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Templated injection model class.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
const dimensionedScalar c
Speed of light in a vacuum.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const dimensionSet & dimensions() const
Return dimensions.
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 dimFlux
Base class for patch-based injection models.
const Type & value() const
Return const reference to value.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
scalar globalScalar01()
Advance the state and return a scalar sample from a uniform.
virtual scalar averageParcelMass()
Return the average parcel mass over the injection period.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
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.
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.
scalar timeEnd() const
Return the end-of-injection time.
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.
Mesh consisting of general polyhedral cells.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Templated base class for dsmc cloud.
virtual void topoChange()
Set injector locations when mesh is updated.
virtual scalar flowRate() const
Return the total volumetric flow rate across the patch [m^3/s].
virtual ~PatchFlowRateInjection()
Destructor.