31 template<
class CloudType>
34 typename CloudType::parcelType::trackingData& td
39 if (U0Name_ == word::null)
43 else if (U0Name_ == this->owner().
U().
name())
54 this->owner().
solution().interpolationSchemes(),
55 this->owner().mesh().
template lookupObject<volVectorField>
65 template<
class CloudType>
68 const label parcelsAdded,
69 const scalar massAdded,
70 typename CloudType::parcelType::trackingData& td
81 template<
class CloudType>
91 duration_(this->readDuration(
dict, owner)),
92 massFlowRate_(this->readMassFlowRate(
dict, owner, duration_)),
93 parcelsPerSecond_(this->readParcelsPerSecond(
dict, owner)),
96 U0InterpPtr_(nullptr),
102 this->coeffDict().subDict(
"sizeDistribution"),
104 owner.
rndGen().generator()
124 template<
class CloudType>
132 duration_(im.duration_),
133 massFlowRate_(im.massFlowRate_, false),
134 parcelsPerSecond_(im.parcelsPerSecond_, false),
137 U0InterpPtr_(nullptr),
138 sizeDistribution_(im.sizeDistribution_, false)
144 template<
class CloudType>
151 template<
class CloudType>
158 template<
class CloudType>
161 return this->SOI_ + duration_;
165 template<
class CloudType>
172 if (time0 >= 0 && time0 < duration_)
174 scalar nParcels = parcelsPerSecond_->integral(time0, time1);
178 label nParcelsToInject = floor(nParcels);
182 if (nParcels - scalar(nParcelsToInject) > this->globalScalar01(
rndGen))
187 return nParcelsToInject;
196 template<
class CloudType>
203 if (time0 >= 0 && time0 < duration_)
205 return massFlowRate_->integral(time0, time1);
214 template<
class CloudType>
229 this->owner().mesh(),
240 template<
class CloudType>
246 typename CloudType::parcelType::trackingData& td,
253 ? U0InterpPtr_().interpolate
255 parcel.coordinates(),
256 parcel.currentTetIndices(td.mesh)
261 parcel.d() = sizeDistribution_->sample();
265 template<
class CloudType>
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Templated injection model class.
void putBack(const token &)
Put back token.
virtual void topoChange()
Set injector locations when mesh is updated.
virtual ~PatchInjection()
Destructor.
virtual void preInject(typename CloudType::parcelType::trackingData &td)
Pre injection hook.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType::trackingData &td, typename CloudType::parcelType &parcel)
virtual void postInject(const label parcelsAdded, const scalar massAdded, typename CloudType::parcelType::trackingData &td)
Post injection hook.
PatchInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual label nParcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual void setPositionAndCell(const fvMesh &mesh, randomGenerator &rndGen, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Inherit setPositionAndCell from patchInjectionBase.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
virtual scalar timeEnd() const
Return the end-of-injection time.
virtual scalar massToInject(const scalar time0, const scalar time1)
Parcel mass to introduce relative to SOI.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Base class for statistical distributions.
Base class for patch-based injection models.
virtual void topoChange(const polyMesh &mesh)
Update patch geometry and derived info for injection locations.
virtual void setPositionAndCell(const fvMesh &mesh, randomGenerator &rndGen, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
Selector class for relaxation factors, solver type and solution.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
A class for managing temporary objects without reference counting.
A token holds items read from Istream.
A class for handling words, derived from string.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimLength
Vector< scalar > vector
A scalar version of the templated Vector.
randomGenerator rndGen(653213)