37template<
class CloudType>
46 factor_(this->coeffDict().getScalar(
"factor")),
51 this->coeffDict().getWord(
"referenceField")
58 this->coeffDict().getWord(
"thresholdField")
61 positionsFile_(this->coeffDict().getWord(
"positionsFile")),
73 injectorCells_(positions_.size()),
74 injectorTetFaces_(positions_.size()),
75 injectorTetPts_(positions_.size()),
78 this->coeffDict().getLabel(
"parcelsPerInjector")
83 this->coeffDict().template get<
vector>(
"U0")
90 this->coeffDict().subDict(
"sizeDistribution"),
103 diameters_[i] = sizeDistribution_->sample();
108 nParcelsPerInjector_*
sum(
pow3(diameters_))*
pi/6.0;
112template<
class CloudType>
120 referenceField_(im.referenceField_),
121 thresholdField_(im.thresholdField_),
122 positionsFile_(im.positionsFile_),
123 positions_(im.positions_),
124 injectorCells_(im.injectorCells_),
125 injectorTetFaces_(im.injectorTetFaces_),
126 injectorTetPts_(im.injectorTetPts_),
127 nParcelsPerInjector_(im.nParcelsPerInjector_),
128 nParcelsInjected_(im.nParcelsInjected_),
130 diameters_(im.diameters_),
131 sizeDistribution_(im.sizeDistribution_.clone())
137template<
class CloudType>
140 bitSet reject(positions_.size());
147 !this->findCellAtPosition
150 injectorTetFaces_[i],
153 !this->ignoreOutOfBounds_
162 const label nRejected = reject.
count();
172 Info<<
" " << nRejected
173 <<
" positions rejected, out of bounds" <<
endl;
178template<
class CloudType>
185template<
class CloudType>
192 if (
sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
194 return positions_.size();
201template<
class CloudType>
208 if (
sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
210 return this->volumeTotal_/nParcelsPerInjector_;
217template<
class CloudType>
229 position = positions_[parcelI];
230 cellOwner = injectorCells_[parcelI];
231 tetFacei = injectorTetFaces_[parcelI];
232 tetPti = injectorTetPts_[parcelI];
236template<
class CloudType>
249 parcel.d() = diameters_[parcelI];
253template<
class CloudType>
260template<
class CloudType>
266 const label celli = injectorCells_[parcelI];
270 nParcelsInjected_[parcelI] < nParcelsPerInjector_
271 && factor_*referenceField_[celli] > thresholdField_[celli]
274 nParcelsInjected_[parcelI]++;
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Conditional injection at specified positions.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
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.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
scalar timeEnd() const
Return the end-of-injection time.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Templated injection model class.
void setSize(const label n)
Alias for resize()
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
unsigned int count(const bool on=true) const
Count number of bits set.
void flip()
Invert all bits in the addressable region.
void set(const bitSet &bitset)
Set specified bits from another bitset.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...
Registry of regIOobjects.
constant condensation/saturation model.
A class for handling words, derived from Foam::string.
constexpr scalar pi(M_PI)
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define forAll(list, i)
Loop across all elements in list.