31 template<
class CloudType>
40 inputFileName_(this->typeDict().
lookup(
"inputFile")),
41 duration_(this->readDuration(
dict, owner)),
42 parcelsPerSecond_(this->readParcelsPerSecond(
dict, owner)),
49 owner.
time().constant(),
55 injectorCoordinates_(0),
61 injectorCoordinates_.setSize(injectors_.size());
62 injectorCells_.
setSize(injectors_.size());
63 injectorTetFaces_.
setSize(injectors_.size());
64 injectorTetPts_.
setSize(injectors_.size());
70 template<
class CloudType>
77 inputFileName_(im.inputFileName_),
78 duration_(im.duration_),
79 parcelsPerSecond_(im.parcelsPerSecond_, false),
80 randomise_(im.randomise_),
81 injectors_(im.injectors_),
82 injectorCoordinates_(im.injectorCoordinates_),
83 injectorCells_(im.injectorCells_),
84 injectorTetFaces_(im.injectorTetFaces_),
85 injectorTetPts_(im.injectorTetPts_)
91 template<
class CloudType>
98 template<
class CloudType>
106 this->findCellAtPosition
110 injectorCoordinates_[i],
112 injectorTetFaces_[i],
119 template<
class CloudType>
122 return this->SOI_ + duration_;
126 template<
class CloudType>
133 if (t1 >= 0 && t0 < duration_)
136 injectorCells_.size()
137 *parcelsPerSecond_->integral(
max(t0, 0),
min(t1, duration_));
146 template<
class CloudType>
155 if (t1 >= 0 && t0 < duration_)
159 mass += injectors_[i].mDot()*(
min(t1, duration_) -
max(t0, 0));
167 template<
class CloudType>
172 const label nParcels,
189 injectorI = parcelI*injectorCells_.size()/nParcels;
193 celli = injectorCells_[injectorI];
194 tetFacei = injectorTetFaces_[injectorI];
195 tetPti = injectorTetPts_[injectorI];
199 template<
class CloudType>
203 const label nParcels,
205 typename CloudType::parcelType::trackingData& td,
209 label injectorI = parcelI*injectorCells_.size()/nParcels;
212 parcel.U() = injectors_[injectorI].U();
215 parcel.d() = injectors_[injectorI].d();
218 parcel.rho() = injectors_[injectorI].rho();
221 parcel.T() = injectors_[injectorI].T();
224 parcel.Cp() = injectors_[injectorI].Cp();
228 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.
void setSize(const label)
Reset size of List.
Particle injection sources read from look-up table. Each row corresponds to an injection site.
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 void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType::trackingData &td, typename CloudType::parcelType &parcel)
Set the parcel properties.
ThermoLookupTableInjection(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 &cellOwner, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
virtual ~ThermoLookupTableInjection()
Destructor.
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.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
Type sampleAB(const Type &a, const Type &b)
Return a type with components uniformly distributed between two.
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.
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
randomGenerator rndGen(653213)