33template<
class CloudType>
44 duration_(this->
coeffDict().getScalar(
"duration")),
45 parcelsPerSecond_(this->
coeffDict().getScalar(
"parcelsPerSecond")),
46 randomise_(this->
coeffDict().getBool(
"randomise")),
58 injectorCells_(injectors_.size()),
59 injectorTetFaces_(injectors_.size()),
60 injectorTetPts_(injectors_.size())
64 duration_ =
owner.db().time().userTimeToTime(duration_);
76template<
class CloudType>
80 const ReactingMultiphaseLookupTableInjection<CloudType>& im
84 inputFileName_(im.inputFileName_),
85 duration_(im.duration_),
86 parcelsPerSecond_(im.parcelsPerSecond_),
87 randomise_(im.randomise_),
88 injectors_(im.injectors_),
89 injectorCells_(im.injectorCells_),
90 injectorTetFaces_(im.injectorTetFaces_),
91 injectorTetPts_(im.injectorTetPts_)
97template<
class CloudType>
101 bitSet reject(injectors_.size());
108 !this->findCellAtPosition
111 injectorTetFaces_[i],
114 !this->ignoreOutOfBounds_
123 label nRejected = reject.count();
133 Info<<
" " << nRejected
134 <<
" positions rejected, out of bounds" <<
endl;
139template<
class CloudType>
143 return this->
SOI_ + duration_;
147template<
class CloudType>
155 if ((time0 >= 0.0) && (time0 < duration_))
157 return floor(injectorCells_.size()*(time1 - time0)*parcelsPerSecond_);
164template<
class CloudType>
173 if ((time0 >= 0.0) && (time0 < duration_))
177 volume += injectors_[i].mDot()/injectors_[i].rho()*(time1 - time0);
185template<
class CloudType>
189 const label nParcels,
200 Random& rnd = this->owner().
rndGen();
201 injectorI = rnd.
position<label>(0, injectorCells_.size() - 1);
205 injectorI = parcelI*injectorCells_.size()/nParcels;
208 position = injectors_[injectorI].x();
209 cellOwner = injectorCells_[injectorI];
210 tetFacei = injectorTetFaces_[injectorI];
211 tetPti = injectorTetPts_[injectorI];
215template<
class CloudType>
219 const label nParcels,
224 label injectorI = parcelI*injectorCells_.size()/nParcels;
227 parcel.
U() = injectors_[injectorI].U();
230 parcel.d() = injectors_[injectorI].d();
233 parcel.rho() = injectors_[injectorI].rho();
236 parcel.T() = injectors_[injectorI].T();
239 parcel.Cp() = injectors_[injectorI].Cp();
242 parcel.Y() = injectors_[injectorI].Y();
245 parcel.YGas() = injectors_[injectorI].YGas();
248 parcel.YLiquid() = injectors_[injectorI].YLiquid();
251 parcel.YSolid() = injectors_[injectorI].YSolid();
255template<
class CloudType>
263template<
class CloudType>
const CloudType & owner() const
Return const access to the owner cloud.
Random & rndGen()
Return reference to the random object.
const vector & U() const
Return const access to velocity.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool ignoreOutOfBounds_
Optional flag to indicate that injections attempted outside the mesh should be ignored.
scalar volumeTotal_
Total volume of particles introduced by this injector [m^3] Note: scaled to ensure massTotal is achie...
InjectionModel(CloudType &owner)
Construct null from owner.
virtual bool findCellAtPosition(label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
Find the cell that contains the supplied position.
scalar SOI_
Start of injection [s].
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
ReactingMultiphaseLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
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.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is permitted.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
scalar timeEnd() const
Return the end-of-injection time.
const Cmpt & x() const noexcept
Access to the vector x component.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
unsigned int count(const bool on=true) const
Count number of bits set.
void flip()
Invert all bits in the addressable region.
void set(const bitSet &bitset)
Set specified bits from another bitset.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Lookup type of boundary radiation properties.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
const word & modelName() const
Return const access to the name of the sub-model.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Different types of constants.
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
DSMCCloud< dsmcParcel > CloudType
messageStream Info
Information stream (stdout output on master, null elsewhere).
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.