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 (t1 >= 0 && t0 < duration_)
174 return parcelsPerSecond_->integral(
max(t0, 0),
min(t1, duration_));
183 template<
class CloudType>
190 if (t1 >= 0 && t0 < duration_)
192 return massFlowRate_->integral(
max(t0, 0),
min(t1, duration_));
201 template<
class CloudType>
216 this->owner().
mesh(),
227 template<
class CloudType>
233 typename CloudType::parcelType::trackingData& td,
240 ? U0InterpPtr_().interpolate
242 parcel.coordinates(),
243 parcel.currentTetIndices(td.mesh)
248 parcel.d() = sizeDistribution_->sample();
252 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 scalar nParcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
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 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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
barycentric coordinates(const polyMesh &mesh, const point &position, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the coordinates given the position and tet topology.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet dimLength
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Vector< scalar > vector
A scalar version of the templated Vector.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
randomGenerator rndGen(653213)