34 template<
class CloudType>
43 inputFileName_(this->coeffDict().
lookup(
"inputFile")),
44 duration_(this->coeffDict().getScalar(
"duration")),
45 parcelsPerSecond_(this->coeffDict().getScalar(
"parcelsPerSecond")),
46 randomise_(this->coeffDict().getBool(
"randomise")),
52 owner.db().time().constant(),
58 injectorCells_(injectors_.size()),
59 injectorTetFaces_(injectors_.size()),
60 injectorTetPts_(injectors_.size())
70 this->
volumeTotal_ += injectors_[i].mDot()/injectors_[i].rho();
76 template<
class CloudType>
83 inputFileName_(im.inputFileName_),
84 duration_(im.duration_),
85 parcelsPerSecond_(im.parcelsPerSecond_),
86 randomise_(im.randomise_),
87 injectors_(im.injectors_),
88 injectorCells_(im.injectorCells_),
89 injectorTetFaces_(im.injectorTetFaces_),
90 injectorTetPts_(im.injectorTetPts_)
96 template<
class CloudType>
100 bitSet reject(injectors_.size());
107 !this->findCellAtPosition
110 injectorTetFaces_[i],
113 !this->ignoreOutOfBounds_
122 const label nRejected = reject.count();
133 <<
" positions rejected, out of bounds" <<
endl;
138 template<
class CloudType>
141 return this->SOI_ + duration_;
145 template<
class CloudType>
152 if ((time0 >= 0.0) && (time0 < duration_))
154 return floor(injectorCells_.size()*(time1 - time0)*parcelsPerSecond_);
161 template<
class CloudType>
169 if ((time0 >= 0.0) && (time0 < duration_))
173 volume += injectors_[i].mDot()/injectors_[i].rho()*(time1 - time0);
181 template<
class CloudType>
185 const label nParcels,
196 Random& rnd = this->owner().rndGen();
197 injectorI = rnd.
position<label>(0, injectorCells_.size() - 1);
201 injectorI = parcelI*injectorCells_.size()/nParcels;
204 position = injectors_[injectorI].x();
205 cellOwner = injectorCells_[injectorI];
206 tetFacei = injectorTetFaces_[injectorI];
207 tetPti = injectorTetPts_[injectorI];
211 template<
class CloudType>
215 const label nParcels,
220 label injectorI = parcelI*injectorCells_.size()/nParcels;
223 parcel.U() = injectors_[injectorI].U();
226 parcel.d() = injectors_[injectorI].d();
229 parcel.rho() = injectors_[injectorI].rho();
232 parcel.T() = injectors_[injectorI].T();
235 parcel.cp() = injectors_[injectorI].cp();
239 template<
class CloudType>
246 template<
class CloudType>
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Templated injection model class.
Ostream & endl(Ostream &os)
Add newline and flush stream.
ThermoLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
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.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
const CloudType & owner() const
Return const access to the owner cloud.
#define forAll(list, i)
Loop across all elements in list.
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 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.
virtual void updateMesh()
Set injector locations when mesh is updated.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
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 void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is permitted.
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...
Defines the attributes of an object for which implicit objectRegistry management is supported...
Templated base class for dsmc cloud.
scalar timeEnd() const
Return the end-of-injection time.
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
Particle injection sources read from look-up table. Each row corresponds to an injection site...