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 injectorCoordinates_.setSize(injectors_.size());
62 injectorCells_.
setSize(injectors_.size());
63 injectorTetFaces_.
setSize(injectors_.size());
64 injectorTetPts_.
setSize(injectors_.size());
70 template<
class CloudType>
77 inputFileName_(im.inputFileName_),
78 duration_(im.duration_),
79 parcelsPerSecond_(im.parcelsPerSecond_, false),
80 randomise_(im.randomise_),
81 injectors_(im.injectors_),
82 injectorCoordinates_(im.injectorCoordinates_),
83 injectorCells_(im.injectorCells_),
84 injectorTetFaces_(im.injectorTetFaces_),
85 injectorTetPts_(im.injectorTetPts_)
91 template<
class CloudType>
98 template<
class CloudType>
104 this->findCellAtPosition
107 injectorCoordinates_[i],
109 injectorTetFaces_[i],
116 template<
class CloudType>
119 return this->SOI_ + duration_;
123 template<
class CloudType>
130 if (time0 >= 0 && time0 < duration_)
135 injectorCells_.size()
136 *parcelsPerSecond_->integral(time0, time1)
146 template<
class CloudType>
155 if (time0 >= 0 && time0 < duration_)
159 mass += injectors_[i].mDot()*(time1 - time0);
167 template<
class CloudType>
171 const label nParcels,
188 injectorI = parcelI*injectorCells_.size()/nParcels;
191 coordinates = injectorCoordinates_[injectorI];
192 celli = injectorCells_[injectorI];
193 tetFacei = injectorTetFaces_[injectorI];
194 tetPti = injectorTetPts_[injectorI];
198 template<
class CloudType>
202 const label nParcels,
204 typename CloudType::parcelType::trackingData& td,
208 label injectorI = parcelI*injectorCells_.size()/nParcels;
211 parcel.U() = injectors_[injectorI].U();
214 parcel.d() = injectors_[injectorI].d();
217 parcel.rho() = injectors_[injectorI].rho();
220 parcel.T() = injectors_[injectorI].T();
223 parcel.Cp() = injectors_[injectorI].Cp();
227 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.
ThermoLookupTableInjection(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 &cellOwner, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
virtual ~ThermoLookupTableInjection()
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.
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)