33 template<
class CloudType>
43 phiName_(this->coeffDict().template lookupOrDefault<
word>(
"phi",
"phi")),
44 rhoName_(this->coeffDict().template lookupOrDefault<
word>(
"rho",
"rho")),
45 duration_(this->readDuration(
dict, owner)),
48 this->coeffDict().
found(
"concentration")
49 || this->coeffDict().
found(
"volumeRatio")
52 this->coeffDict().
found(
"volumeRatio")
55 this->owner().db().time().userUnits(),
63 this->coeffDict().
found(
"massRatio")
67 this->owner().db().time().userUnits(),
75 this->coeffDict().template lookup<scalar>(
"parcelConcentration")
82 this->coeffDict().subDict(
"sizeDistribution"),
88 if (volumeRatio_.valid() && massRatio_.valid())
91 <<
"keywords volumeRatio (or concentration) and "
92 <<
"massRatio both defined in dictionary "
96 if (!volumeRatio_.valid() && !massRatio_.valid())
99 <<
"keyword volumeRatio or massRatio is "
100 <<
"undefined in dictionary "
106 template<
class CloudType>
114 phiName_(im.phiName_),
115 rhoName_(im.rhoName_),
116 duration_(im.duration_),
117 volumeRatio_(im.volumeRatio_, false),
118 massRatio_(im.massRatio_, false),
119 parcelConcentration_(im.parcelConcentration_),
120 sizeDistribution_(im.sizeDistribution_, false)
126 template<
class CloudType>
133 template<
class CloudType>
140 template<
class CloudType>
143 return this->SOI_ + duration_;
147 template<
class CloudType>
159 flowRateIn =
max(scalar(0), -
sum(phip));
167 flowRateIn =
max(scalar(0), -
sum(phip/rhop));
176 template<
class CloudType>
192 flowRateIn =
max(scalar(0), -
sum(phip*rhop));
196 flowRateIn =
max(scalar(0), -
sum(phip));
205 template<
class CloudType>
212 if (t1 >= 0 && t0 < duration_)
214 const scalar tMid = (t0 + t1)/2;
216 const scalar volumeFlowRateToInject =
218 ? volumeRatio_->value(tMid)
219 *volumetricFlowRate()
220 : massRatio_->value(tMid)
222 /this->owner().constProps().rho0();
226 *volumeFlowRateToInject
227 *(
min(t1, duration_) -
max(t0, 0));
236 template<
class CloudType>
243 if (t1 >= 0 && t0 < duration_)
245 const scalar tMid = (t0 + t1)/2;
247 const scalar massFlowRateToInject =
249 ? volumeRatio_->value(tMid)
250 *volumetricFlowRate()
251 *this->owner().constProps().rho0()
252 : massRatio_->value(tMid)
257 *(
min(t1, duration_) -
max(t0, 0));
266 template<
class CloudType>
281 this->owner().
mesh(),
292 template<
class CloudType>
298 typename CloudType::parcelType::trackingData& td,
303 parcel.U() = this->owner().U()[parcel.cell()];
306 parcel.d() = sizeDistribution_->sample();
310 template<
class CloudType>
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
const dimensionSet & dimensions() const
Return dimensions.
Run-time selectable general function of one variable.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Templated injection model class.
Patch injection in which the quantity of particulate material introduced is specified as a fraction o...
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)
virtual ~PatchFlowRateInjection()
Destructor.
PatchFlowRateInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
scalar massFlowRate() const
Return the total mass flow rate across the patch [kg/s].
scalar volumetricFlowRate() const
Return the total volumetric flow rate across the patch [m^3/s].
virtual void setPositionAndCell(const fvMesh &mesh, randomGenerator &rndGen, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Inherit setPositionAndCell from patchInjectionBase.
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.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const fileName & name() const
Return the dictionary name.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Base class for statistical distributions.
const polyMesh & mesh() const
Return reference to polyMesh.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
Base class for patch-based injection models.
virtual void topoChange(const polyMesh &mesh)
Update patch geometry and derived info for injection locations.
virtual void setPositionAndCell(const fvMesh &mesh, randomGenerator &rndGen, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
Mesh consisting of general polyhedral cells.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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 dimVolumetricFlux
const dimensionSet dimless
const dimensionSet dimLength
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
randomGenerator rndGen(653213)