33 template<
class CloudType>
42 inputFileName_(this->coeffDict().
lookup(
"inputFile")),
43 duration_(this->coeffDict().getScalar(
"duration")),
44 parcelsPerSecond_(this->coeffDict().getScalar(
"parcelsPerSecond")),
45 randomise_(this->coeffDict().getBool(
"randomise")),
51 owner.db().time().constant(),
57 injectorCells_(injectors_.size()),
58 injectorTetFaces_(injectors_.size()),
59 injectorTetPts_(injectors_.size())
69 this->
volumeTotal_ += injectors_[i].mDot()/injectors_[i].rho();
75 template<
class CloudType>
78 const ReactingLookupTableInjection<CloudType>& im
82 inputFileName_(im.inputFileName_),
83 duration_(im.duration_),
84 parcelsPerSecond_(im.parcelsPerSecond_),
85 randomise_(im.randomise_),
86 injectors_(im.injectors_),
87 injectorCells_(im.injectorCells_),
88 injectorTetFaces_(im.injectorTetFaces_),
89 injectorTetPts_(im.injectorTetPts_)
95 template<
class CloudType>
99 bitSet reject(injectors_.size());
106 !this->findCellAtPosition
109 injectorTetFaces_[i],
112 !this->ignoreOutOfBounds_
121 const label nRejected = reject.count();
132 <<
" positions rejected, out of bounds" <<
endl;
137 template<
class CloudType>
140 return this->SOI_ + duration_;
144 template<
class CloudType>
151 if ((time0 >= 0.0) && (time0 < duration_))
153 return floor(injectorCells_.size()*(time1 - time0)*parcelsPerSecond_);
160 template<
class CloudType>
168 if ((time0 >= 0.0) && (time0 < duration_))
172 volume += injectors_[i].mDot()/injectors_[i].rho()*(time1 - time0);
180 template<
class CloudType>
184 const label nParcels,
195 Random& rnd = this->owner().rndGen();
196 injectorI = rnd.
position<label>(0, injectorCells_.size() - 1);
200 injectorI = parcelI*injectorCells_.size()/nParcels;
203 position = injectors_[injectorI].x();
204 cellOwner = injectorCells_[injectorI];
205 tetFacei = injectorTetFaces_[injectorI];
206 tetPti = injectorTetPts_[injectorI];
210 template<
class CloudType>
214 const label nParcels,
219 label injectorI = parcelI*injectorCells_.size()/nParcels;
222 parcel.U() = injectors_[injectorI].U();
225 parcel.d() = injectors_[injectorI].d();
228 parcel.rho() = injectors_[injectorI].rho();
231 parcel.T() = injectors_[injectorI].T();
234 parcel.Cp() = injectors_[injectorI].Cp();
237 parcel.Y() = injectors_[injectorI].Y();
241 template<
class CloudType>
248 template<
class CloudType>
scalar timeEnd() const
Return the end-of-injection time.
DSMCCloud< dsmcParcel > CloudType
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Templated injection model class.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is permitted.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Lookup type of boundary radiation properties.
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
const CloudType & owner() const
Return const access to the owner cloud.
#define forAll(list, i)
Loop across all elements in list.
virtual scalar userTimeToTime(const scalar theta) const
Convert the user-time (e.g. CA deg) to real-time (s).
A class for handling words, derived from Foam::string.
const Time & time() const noexcept
Return time registry.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
ReactingLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
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.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
messageStream Info
Information stream (stdout output on master, null elsewhere)
scalar volumeTotal_
Total volume of particles introduced by this injector [m^3] Note: scaled to ensure massTotal is achie...
virtual void updateMesh()
Set injector locations when mesh is updated.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Templated base class for dsmc cloud.
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.