34 template<
class CloudType>
43 factor_(this->coeffDict().template lookup<scalar>(
"factor")),
46 owner.db().objectRegistry::template lookupObject<volScalarField>
48 this->coeffDict().lookup(
"referenceField")
53 owner.db().objectRegistry::template lookupObject<volScalarField>
55 this->coeffDict().lookup(
"thresholdField")
58 positionsFile_(this->coeffDict().
lookup(
"positionsFile")),
64 owner.db().time().constant(),
70 injectorCells_(positions_.size()),
71 injectorTetFaces_(positions_.size()),
72 injectorTetPts_(positions_.size()),
75 this->coeffDict().template lookup<label>(
"parcelsPerInjector")
77 nParcelsInjected_(positions_.size(), 0),
78 U0_(this->coeffDict().lookup(
"U0")),
79 diameters_(positions_.size()),
84 this->coeffDict().subDict(
"sizeDistribution"),
92 diameters_[i] = sizeDistribution_->sample();
97 nParcelsPerInjector_*
sum(
pow3(diameters_))*
pi/6.0;
103 template<
class CloudType>
111 referenceField_(im.referenceField_),
112 thresholdField_(im.thresholdField_),
113 positionsFile_(im.positionsFile_),
114 positions_(im.positions_),
115 injectorCells_(im.injectorCells_),
116 injectorTetFaces_(im.injectorTetFaces_),
117 injectorTetPts_(im.injectorTetPts_),
118 nParcelsPerInjector_(im.nParcelsPerInjector_),
119 nParcelsInjected_(im.nParcelsInjected_),
121 diameters_(im.diameters_),
122 sizeDistribution_(im.sizeDistribution_().clone().ptr())
128 template<
class CloudType>
135 template<
class CloudType>
141 this->findCellAtPosition
144 injectorTetFaces_[i],
152 template<
class CloudType>
159 template<
class CloudType>
166 if (
sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
168 return positions_.size();
177 template<
class CloudType>
184 if (
sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
186 return this->volumeTotal_/nParcelsPerInjector_;
195 template<
class CloudType>
207 position = positions_[parcelI];
208 cellOwner = injectorCells_[parcelI];
209 tetFacei = injectorTetFaces_[parcelI];
210 tetPti = injectorTetPts_[parcelI];
214 template<
class CloudType>
227 parcel.d() = diameters_[parcelI];
231 template<
class CloudType>
238 template<
class CloudType>
244 const label celli = injectorCells_[parcelI];
248 nParcelsInjected_[parcelI] < nParcelsPerInjector_
249 && factor_*referenceField_[celli] > thresholdField_[celli]
252 nParcelsInjected_[parcelI]++;
scalar timeEnd() const
Return the end-of-injection time.
#define forAll(list, i)
Loop across all elements in list.
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.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
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 ~FieldActivatedInjection()
Destructor.
stressControl lookup("compactNormalStress") >> compactNormalStress
A class for handling words, derived from string.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Injection at specified positions, with the conditions:
dimensionedScalar pow3(const dimensionedScalar &ds)
static autoPtr< distributionModel > New(const dictionary &dict, Random &rndGen)
Selector.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
FieldActivatedInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Templated base class for dsmc cloud.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.