37 template<
class CloudType>
46 positionsFile_(this->coeffDict().
lookup(
"positionsFile")),
52 owner.db().time().constant(),
58 diameters_(positions_.size()),
59 injectorCells_(positions_.size(), -1),
60 injectorTetFaces_(positions_.size(), -1),
61 injectorTetPts_(positions_.size(), -1),
62 U0_(this->coeffDict().
lookup(
"U0")),
67 this->coeffDict().subDict(
"sizeDistribution"),
73 this->coeffDict().getOrDefault(
"ignoreOutOfBounds", false)
81 diameters_[i] = sizeDistribution_->sample();
89 template<
class CloudType>
96 positionsFile_(im.positionsFile_),
97 positions_(im.positions_),
98 diameters_(im.diameters_),
99 injectorCells_(im.injectorCells_),
100 injectorTetFaces_(im.injectorTetFaces_),
101 injectorTetPts_(im.injectorTetPts_),
103 sizeDistribution_(im.sizeDistribution_.clone()),
104 ignoreOutOfBounds_(im.ignoreOutOfBounds_)
110 template<
class CloudType>
117 template<
class CloudType>
122 bitSet keep(positions_.size(),
true);
128 !this->findCellAtPosition
131 injectorTetFaces_[pI],
152 <<
" particles ignored, out of bounds" <<
endl;
157 template<
class CloudType>
162 return this->SOI_ + SMALL;
166 template<
class CloudType>
173 if ((0.0 >= time0) && (0.0 < time1))
175 return positions_.size();
182 template<
class CloudType>
190 if ((0.0 >= time0) && (0.0 < time1))
192 return this->volumeTotal_;
199 template<
class CloudType>
211 position = positions_[parcelI];
212 cellOwner = injectorCells_[parcelI];
213 tetFacei = injectorTetFaces_[parcelI];
214 tetPti = injectorTetPts_[parcelI];
218 template<
class CloudType>
231 parcel.d() = diameters_[parcelI];
235 template<
class CloudType>
242 template<
class CloudType>
ManualInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
virtual ~ManualInjection()
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Templated injection model class.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
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.
Lookup type of boundary radiation properties.
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
#define forAll(list, i)
Loop across all elements in list.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
A class for handling words, derived from Foam::string.
constexpr scalar pi(M_PI)
ParcelType parcelType
Type of parcel the cloud was instantiated for.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
dimensionedScalar pow3(const dimensionedScalar &ds)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...
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.
messageStream Info
Information stream (stdout output on master, null elsewhere)
scalar volumeTotal_
Total volume of particles introduced by this injector [m^3] Note: scaled to ensure massTotal is achie...
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Templated base class for dsmc cloud.
scalar timeEnd() const
Return the end-of-injection time.