34 template<
class CloudType>
43 positionsFile_(this->typeDict().
lookup(
"positionsFile")),
49 owner.
time().constant(),
55 diameters_(positions_.size()),
56 injectorCoordinates_(positions_.size(),
barycentric::uniform(NaN)),
57 injectorCells_(positions_.size(), -1),
58 injectorTetFaces_(positions_.size(), -1),
59 injectorTetPts_(positions_.size(), -1),
60 massTotal_(this->readMassTotal(
dict, owner)),
61 U0_(this->typeDict().
lookup(
"U0")),
67 this->typeDict().subDict(
"sizeDistribution"),
74 this->typeDict().lookupOrDefault(
"ignoreOutOfBounds", false)
82 diameters_[i] = sizeDistribution_->sample();
87 template<
class CloudType>
94 positionsFile_(im.positionsFile_),
95 positions_(im.positions_),
96 diameters_(im.diameters_),
97 injectorCoordinates_(im.injectorCoordinates_),
98 injectorCells_(im.injectorCells_),
99 injectorTetFaces_(im.injectorTetFaces_),
100 injectorTetPts_(im.injectorTetPts_),
101 massTotal_(im.massTotal_),
103 sizeDistribution_(im.sizeDistribution_, false),
104 ignoreOutOfBounds_(im.ignoreOutOfBounds_)
110 template<
class CloudType>
117 template<
class CloudType>
130 !this->findCellAtPosition
134 injectorCoordinates_[pI],
136 injectorTetFaces_[pI],
156 Info<<
" " << nRejected
157 <<
" particles ignored, out of bounds" <<
endl;
162 template<
class CloudType>
170 template<
class CloudType>
178 if (0 >= t0 && 0 < t1)
180 return positions_.size();
189 template<
class CloudType>
197 if (0 >= t0 && 0 < t1)
208 template<
class CloudType>
223 celli = injectorCells_[parcelI];
224 tetFacei = injectorTetFaces_[parcelI];
225 tetPti = injectorTetPts_[parcelI];
229 template<
class CloudType>
235 typename CloudType::parcelType::trackingData& td,
243 parcel.d() = diameters_[parcelI];
247 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.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Templated injection model class.
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 ~ManualInjection()
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.
ManualInjection(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.
virtual 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.
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.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet & dimLength
void inplaceSubset(const UList< T > &select, const T &value, ListType &)
Inplace extract elements of List when select is a certain value.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
randomGenerator rndGen(653213)