30 template<
class CloudType>
39 inputFileName_(this->coeffDict().lookup(
"inputFile")),
40 duration_(this->readDuration(
dict, owner)),
41 parcelsPerSecond_(this->readParcelsPerSecond(
dict, owner)),
42 randomise_(
readBool(this->coeffDict().lookup(
"randomise"))),
48 owner.db().time().constant(),
54 injectorCoordinates_(0),
60 injectorCoordinates_.setSize(injectors_.size());
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_),
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,
182 Random& rnd = this->owner().rndGen();
187 injectorI = parcelI*injectorCells_.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,
206 label injectorI = parcelI*injectorCells_.size()/nParcels;
209 parcel.U() = injectors_[injectorI].U();
212 parcel.d() = injectors_[injectorI].d();
215 parcel.rho() = injectors_[injectorI].rho();
218 parcel.T() = injectors_[injectorI].T();
221 parcel.Cp() = injectors_[injectorI].Cp();
224 parcel.Y() = injectors_[injectorI].Y();
228 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.
Type sampleAB(const Type &a, const Type &b)
Advance the state and return a sample of a given type from a.
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.
ReactingLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
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.
virtual ~ReactingLookupTableInjection()
Destructor.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
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.
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....
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.