31 template<
class CloudType>
40 inputFileName_(this->coeffDict().lookup(
"inputFile")),
41 duration_(this->readDuration(
dict, owner)),
42 parcelsPerSecond_(this->readParcelsPerSecond(
dict, owner)),
43 randomise_(
readBool(this->coeffDict().lookup(
"randomise"))),
49 owner.db().time().constant(),
55 injectorCoordinates_(0),
61 injectorCells_.
setSize(injectors_.size());
62 injectorTetFaces_.
setSize(injectors_.size());
63 injectorTetPts_.
setSize(injectors_.size());
69 template<
class CloudType>
76 inputFileName_(im.inputFileName_),
77 duration_(im.duration_),
78 parcelsPerSecond_(im.parcelsPerSecond_, false),
79 randomise_(im.randomise_),
80 injectors_(im.injectors_),
81 injectorCoordinates_(im.injectorCoordinates_),
82 injectorCells_(im.injectorCells_),
83 injectorTetFaces_(im.injectorTetFaces_),
84 injectorTetPts_(im.injectorTetPts_)
90 template<
class CloudType>
97 template<
class CloudType>
103 this->findCellAtPosition
106 injectorCoordinates_[i],
108 injectorTetFaces_[i],
115 template<
class CloudType>
118 return this->SOI_ + duration_;
122 template<
class CloudType>
129 if (time0 >= 0 && time0 < duration_)
134 injectorCells_.size()
135 *parcelsPerSecond_->integral(time0, time1)
145 template<
class CloudType>
154 if (time0 >= 0 && time0 < duration_)
158 mass += injectors_[i].mDot()*(time1 - time0);
166 template<
class CloudType>
170 const label nParcels,
187 injectorI = int64_t(parcelI)*int64_t(injectors_.size())/nParcels;
190 coordinates = injectorCoordinates_[injectorI];
191 celli = injectorCells_[injectorI];
192 tetFacei = injectorTetFaces_[injectorI];
193 tetPti = injectorTetPts_[injectorI];
197 template<
class CloudType>
201 const label nParcels,
203 typename CloudType::parcelType::trackingData& td,
207 label injectorI = int64_t(parcelI)*int64_t(injectors_.size())/nParcels;
210 parcel.U() = injectors_[injectorI].U();
213 parcel.d() = injectors_[injectorI].d();
216 parcel.rho() = injectors_[injectorI].rho();
220 template<
class CloudType>
#define forAll(list, i)
Loop across all elements in list.
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Templated injection model class.
void setSize(const label)
Reset size of List.
Particle injection sources read from look-up table. Each row corresponds to an injection site.
virtual void topoChange()
Set injector locations when mesh is updated.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType::trackingData &td, typename CloudType::parcelType &parcel)
Set the parcel properties.
virtual void setPositionAndCell(const label parcelI, const label nParcels, const scalar time, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
MomentumLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual ~MomentumLookupTableInjection()
Destructor.
virtual label nParcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
virtual scalar timeEnd() const
Return the end-of-injection time.
virtual scalar massToInject(const scalar time0, const scalar time1)
Parcel mass to introduce relative to SOI.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Type sampleAB(const Type &a, const Type &b)
Return a type with components uniformly distributed between two.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
randomGenerator rndGen(653213)