34 template<
class CloudType>
43 positionsFile_(this->coeffDict().lookup(
"positionsFile")),
49 owner.db().time().constant(),
55 diameters_(positions_.size()),
56 injectorCells_(positions_.size(), -1),
57 injectorTetFaces_(positions_.size(), -1),
58 injectorTetPts_(positions_.size(), -1),
59 U0_(this->coeffDict().lookup(
"U0")),
64 this->coeffDict().subDict(
"sizeDistribution"),
70 this->coeffDict().lookupOrDefault(
"ignoreOutOfBounds",
false)
78 diameters_[i] = sizeDistribution_->sample();
82 this->volumeTotal_ =
sum(
pow3(diameters_))*
pi/6.0;
86 template<
class CloudType>
93 positionsFile_(im.positionsFile_),
94 positions_(im.positions_),
95 diameters_(im.diameters_),
96 injectorCells_(im.injectorCells_),
97 injectorTetFaces_(im.injectorTetFaces_),
98 injectorTetPts_(im.injectorTetPts_),
100 sizeDistribution_(im.sizeDistribution_().clone().ptr()),
101 ignoreOutOfBounds_(im.ignoreOutOfBounds_)
107 template<
class CloudType>
114 template<
class CloudType>
125 !this->findCellAtPosition
128 injectorTetFaces_[pI],
148 Info<<
" " << nRejected
149 <<
" particles ignored, out of bounds" <<
endl;
154 template<
class CloudType>
163 template<
class CloudType>
170 if ((0.0 >= time0) && (0.0 < time1))
172 return positions_.size();
181 template<
class CloudType>
189 if ((0.0 >= time0) && (0.0 < time1))
191 return this->volumeTotal_;
200 template<
class CloudType>
212 position = positions_[parcelI];
213 cellOwner = injectorCells_[parcelI];
214 tetFacei = injectorTetFaces_[parcelI];
215 tetPti = injectorTetPts_[parcelI];
219 template<
class CloudType>
232 parcel.d() = diameters_[parcelI];
236 template<
class CloudType>
243 template<
class CloudType>
void inplaceSubset(const UList< T > &select, const T &value, ListType &)
Inplace extract elements of List when select is a certain value.
ManualInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
#define forAll(list, i)
Loop across all elements in list.
virtual ~ManualInjection()
Destructor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Templated injection model class.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
A class for handling words, derived from string.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
dimensionedScalar pow3(const dimensionedScalar &ds)
static autoPtr< distributionModel > New(const dictionary &dict, Random &rndGen)
Selector.
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.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Templated base class for dsmc cloud.
scalar timeEnd() const
Return the end-of-injection time.