37template<
class CloudType>
52 time[particlei] =
p.soi();
53 position[particlei] =
p.position() + positionOffset_;
54 diameter[particlei] =
p.d();
61 if (Pstream::parRun())
64 procTime[Pstream::myProcNo()].
transfer(time);
65 Pstream::gatherList(procTime);
66 Pstream::scatterList(procTime);
68 ListListOps::combine<List<scalar>>
74 procPosition[Pstream::myProcNo()].
transfer(position);
75 Pstream::gatherList(procPosition);
76 Pstream::scatterList(procPosition);
78 ListListOps::combine<List<point>>
84 procD[Pstream::myProcNo()].
transfer(diameter);
85 Pstream::gatherList(procD);
86 Pstream::scatterList(procD);
88 ListListOps::combine<List<scalar>>
95 Pstream::gatherList(procU);
96 Pstream::scatterList(procU);
98 ListListOps::combine<List<vector>>
104 nParticles = time.
size();
107 scalar minTime =
min(time);
123 scalar sumVolume = 0;
133 this->volumeTotal_ = sumVolume;
136 Info<<
" Read " << nParticles <<
" particles" <<
endl;
142template<
class CloudType>
147 const word& modelName
151 cloudName_(this->coeffDict().
lookup(
"cloud")),
155 time_(this->template getModelProperty<
scalarList>(
"time")),
156 position_(this->template getModelProperty<
vectorList>(
"position")),
157 positionOffset_(this->coeffDict().
lookup(
"positionOffset")),
158 diameter_(this->template getModelProperty<
scalarList>(
"diameter")),
159 U_(this->template getModelProperty<
vectorList>(
"U")),
160 volume_(this->template getModelProperty<
scalarList>(
"volume")),
163 this->coeffDict().getOrDefault(
"ignoreOutOfBounds", false)
167 this->template getModelProperty<label>
177 <<
"Injector model: " << this->
modelName()
178 <<
" Parcel basis must be set to fixed"
198template<
class CloudType>
205 cloudName_(im.cloudName_),
206 injectorCells_(im.injectorCells_),
207 injectorTetFaces_(im.injectorTetFaces_),
208 injectorTetPts_(im.injectorTetPts_),
210 position_(im.position_),
211 positionOffset_(im.positionOffset_),
212 diameter_(im.diameter_),
215 ignoreOutOfBounds_(im.ignoreOutOfBounds_),
216 currentParticlei_(im.currentParticlei_)
222template<
class CloudType>
227 bitSet keep(position_.size(),
true);
229 forAll(position_, particlei)
233 !this->findCellAtPosition
235 injectorCells_[particlei],
236 injectorTetFaces_[particlei],
237 injectorTetPts_[particlei],
238 position_[particlei],
243 keep.
unset(particlei);
259 Info<<
" " << nRejected
260 <<
" particles ignored, out of bounds" <<
endl;
265template<
class CloudType>
272template<
class CloudType>
279 label nParticles = 0;
282 if ((time_[particlei] >= time0) && (time_[particlei] < time1))
292template<
class CloudType>
299 scalar sumVolume = 0;
302 if ((time_[particlei] >= time0) && (time_[particlei] < time1))
304 sumVolume += volume_[particlei];
312template<
class CloudType>
316 const label nParcels,
329 position = position_[currentParticlei_];
330 cellOwner = injectorCells_[currentParticlei_];
331 tetFacei = injectorTetFaces_[currentParticlei_];
332 tetPti = injectorTetPts_[currentParticlei_];
336template<
class CloudType>
346 parcel.U() = U_[currentParticlei_];
349 parcel.d() = diameter_[currentParticlei_];
353template<
class CloudType>
360template<
class CloudType>
370template<
class CloudType>
375 if (this->writeTime())
377 this->setModelProperty(
"currentParticlei", currentParticlei_);
378 this->setModelProperty(
"time", time_);
379 this->setModelProperty(
"position", position_);
380 this->setModelProperty(
"diameter", diameter_);
381 this->setModelProperty(
"U", U_);
382 this->setModelProperty(
"volume", volume_);
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
const List< typename ParcelType::constantProperties > & constProps() const
Return all of the constant properties.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
label size() const noexcept
The number of elements in table.
Replays an set of particle data based on an injectedParticleCloud, using the assumption of one partic...
void initialise()
Initialise injectors.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
labelList injectorCells_
List of cell label per injector.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
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 void setProperties(const label parceli, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
labelList injectorTetPts_
List of tetPt label per injector.
vectorList position_
List of position per particle [m].
labelList injectorTetFaces_
List of tetFace label per injector.
scalarList time_
List of injection time per particle [s].
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual bool validInjection(const label parceli)
Return flag to identify whether or not injection of parcelI is.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
scalar timeEnd() const
Return the end-of-injection time.
Templated injection model class.
parcelBasis parcelBasis_
Parcel basis enumeration.
scalar massTotal_
Total mass to inject [kg].
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bitSet & unset(const bitSet &other)
A cloud is a registry collection of lagrangian particles.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
InfoProxy< ensightCells > info() const
Return info proxy.
Primarily stores particle properties so that it can be injected at a later time. Note that this store...
Lookup type of boundary radiation properties.
const word & modelName() const
Return const access to the name of the sub-model.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
constexpr scalar pi(M_PI)
Different types of constants.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
dimensionedScalar pow3(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.