34 template<
class CloudType>
43 factor_(this->typeDict().template
lookup<scalar>(
"factor")),
48 this->typeDict().
lookup(
"referenceField")
55 this->typeDict().
lookup(
"thresholdField")
58 positionsFile_(this->typeDict().
lookup(
"positionsFile")),
64 owner.
time().constant(),
70 injectorCoordinates_(positions_.size()),
71 injectorCells_(positions_.size()),
72 injectorTetFaces_(positions_.size()),
73 injectorTetPts_(positions_.size()),
74 massTotal_(this->readMassTotal(
dict, owner)),
77 this->typeDict().template
lookup<
label>(
"parcelsPerInjector")
79 nParcelsInjected_(positions_.size(), 0),
80 U0_(this->typeDict().
lookup(
"U0")),
81 diameters_(positions_.size()),
87 this->typeDict().subDict(
"sizeDistribution"),
96 diameters_[i] = sizeDistribution_->sample();
103 template<
class CloudType>
111 referenceField_(im.referenceField_),
112 thresholdField_(im.thresholdField_),
113 positionsFile_(im.positionsFile_),
114 positions_(im.positions_),
115 injectorCoordinates_(im.injectorCoordinates_),
116 injectorCells_(im.injectorCells_),
117 injectorTetFaces_(im.injectorTetFaces_),
118 injectorTetPts_(im.injectorTetPts_),
119 massTotal_(im.massTotal_),
120 nParcelsPerInjector_(im.nParcelsPerInjector_),
121 nParcelsInjected_(im.nParcelsInjected_),
123 diameters_(im.diameters_),
124 sizeDistribution_(im.sizeDistribution_, false)
130 template<
class CloudType>
137 template<
class CloudType>
145 this->findCellAtPosition
149 injectorCoordinates_[i],
151 injectorTetFaces_[i],
158 template<
class CloudType>
165 template<
class CloudType>
172 if (
sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
174 return positions_.size();
183 template<
class CloudType>
190 if (
sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
192 return massTotal_/nParcelsPerInjector_;
201 template<
class CloudType>
215 const label injectorCelli = injectorCells_[parceli];
219 nParcelsInjected_[parceli] < nParcelsPerInjector_
220 && factor_*referenceField_[injectorCelli] > thresholdField_[injectorCelli]
224 celli = injectorCells_[parceli];
225 tetFacei = injectorTetFaces_[parceli];
226 tetPti = injectorTetPts_[parceli];
228 nParcelsInjected_[parceli]++;
233 template<
class CloudType>
239 typename CloudType::parcelType::trackingData& td,
247 parcel.d() = diameters_[parceli];
251 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.
Injection at specified positions, with the conditions:
virtual scalar nParcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual void topoChange()
Set injector locations when mesh is updated.
virtual ~FieldActivatedInjection()
Destructor.
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.
FieldActivatedInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual void setPositionAndCell(const meshSearch &searchEngine, const label parceli, const label nParcels, const scalar time, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
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.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Templated injection model class.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Base class for statistical distributions.
Mesh object that implements searches within the local cells and faces.
static const meshSearch & New(const polyMesh &mesh, const pointInCellShapes=pointInCellShapes::tets)
Lookup or construct from mesh and cell decomposition option.
Registry of regIOobjects.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
barycentric coordinates(const polyMesh &mesh, const point &position, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the coordinates given the position and tet topology.
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet & dimLength
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
randomGenerator rndGen(653213)