31 template<
class CloudType>
40 inputFileName_(this->coeffDict().lookup(
"inputFile")),
41 duration_(this->coeffDict().template lookup<scalar>(
"duration")),
44 this->coeffDict().
template lookup<scalar>(
"parcelsPerSecond")
52 owner.db().time().constant(),
62 duration_ = owner.db().time().userTimeToTime(duration_);
65 injectorCells_.setSize(injectors_.size());
66 injectorTetFaces_.setSize(injectors_.size());
67 injectorTetPts_.setSize(injectors_.size());
72 this->volumeTotal_ = 0.0;
75 this->volumeTotal_ += injectors_[i].mDot()/injectors_[i].rho();
77 this->volumeTotal_ *= duration_;
81 template<
class CloudType>
88 inputFileName_(im.inputFileName_),
89 duration_(im.duration_),
90 parcelsPerSecond_(im.parcelsPerSecond_),
91 randomise_(im.randomise_),
92 injectors_(im.injectors_),
93 injectorCells_(im.injectorCells_),
94 injectorTetFaces_(im.injectorTetFaces_),
95 injectorTetPts_(im.injectorTetPts_)
101 template<
class CloudType>
108 template<
class CloudType>
114 this->findCellAtPosition
117 injectorTetFaces_[i],
125 template<
class CloudType>
128 return this->SOI_ + duration_;
132 template<
class CloudType>
139 if ((time0 >= 0.0) && (time0 < duration_))
141 return floor(injectorCells_.size()*(time1 - time0)*parcelsPerSecond_);
150 template<
class CloudType>
158 if ((time0 >= 0.0) && (time0 < duration_))
162 volume += injectors_[i].mDot()/injectors_[i].rho()*(time1 - time0);
170 template<
class CloudType>
174 const label nParcels,
185 Random& rnd = this->owner().rndGen();
190 injectorI = int64_t(parcelI)*int64_t(injectors_.size())/nParcels;
193 position = injectors_[injectorI].
x();
194 cellOwner = injectorCells_[injectorI];
195 tetFacei = injectorTetFaces_[injectorI];
196 tetPti = injectorTetPts_[injectorI];
200 template<
class CloudType>
204 const label nParcels,
209 label injectorI = int64_t(parcelI)*int64_t(injectors_.size())/nParcels;
212 parcel.U() = injectors_[injectorI].U();
215 parcel.d() = injectors_[injectorI].d();
218 parcel.rho() = injectors_[injectorI].rho();
222 template<
class CloudType>
229 template<
class CloudType>
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.
Type sampleAB(const Type &a, const Type &b)
Advance the state and return a sample of a given type from a.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
virtual ~MomentumLookupTableInjection()
Destructor.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
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.
stressControl lookup("compactNormalStress") >> compactNormalStress
A class for handling words, derived from string.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Particle injection sources read from look-up table. Each row corresponds to an injection site...
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.
MomentumLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Templated base class for dsmc cloud.