37template<
class CloudType>
58 diameters_(positions_.size()),
59 injectorCells_(positions_.size(), -1),
60 injectorTetFaces_(positions_.size(), -1),
61 injectorTetPts_(positions_.size(), -1),
67 this->
coeffDict().subDict(
"sizeDistribution"),
73 this->
coeffDict().getOrDefault(
"ignoreOutOfBounds", false)
81 diameters_[i] = sizeDistribution_->sample();
89template<
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_)
110template<
class CloudType>
117template<
class CloudType>
122 bitSet keep(positions_.size(),
true);
128 !this->findCellAtPosition
131 injectorTetFaces_[pI],
152 <<
" particles ignored, out of bounds" <<
endl;
157template<
class CloudType>
162 return this->
SOI_ + SMALL;
166template<
class CloudType>
173 if ((0.0 >= time0) && (0.0 < time1))
175 return positions_.size();
182template<
class CloudType>
190 if ((0.0 >= time0) && (0.0 < time1))
192 return this->volumeTotal_;
199template<
class CloudType>
211 position = positions_[parcelI];
212 cellOwner = injectorCells_[parcelI];
213 tetFacei = injectorTetFaces_[parcelI];
214 tetPti = injectorTetPts_[parcelI];
218template<
class CloudType>
231 parcel.d() = diameters_[parcelI];
235template<
class CloudType>
242template<
class CloudType>
const CloudType & owner() const
Return const access to the owner cloud.
const vector & U() const
Return const access to velocity.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Templated injection model class.
static autoPtr< InjectionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector with lookup from dictionary.
scalar volumeTotal_
Total volume of particles introduced by this injector [m^3] Note: scaled to ensure massTotal is achie...
InjectionModel(CloudType &owner)
Construct null from owner.
virtual bool findCellAtPosition(label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
Find the cell that contains the supplied position.
scalar SOI_
Start of injection [s].
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
virtual ~ManualInjection()
Destructor.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
ManualInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
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.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bitSet & unset(const bitSet &other)
Unset (subtract) the bits specified in the other bitset, which is a set difference corresponds to the...
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...
Lookup type of boundary radiation properties.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
const word & modelName() const
Return const access to the name of the sub-model.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
constexpr scalar pi(M_PI)
Different types of constants.
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
DSMCCloud< dsmcParcel > CloudType
dimensionedScalar pow3(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere).
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
#define forAll(list, i)
Loop across all elements in list.