28 #include "distribution.H"
34 template<
class CloudType>
44 phiName_(this->coeffDict().template lookupOrDefault<
word>(
"phi",
"phi")),
45 rhoName_(this->coeffDict().template lookupOrDefault<
word>(
"rho",
"rho")),
46 duration_(this->readDuration(
dict, owner)),
58 this->coeffDict().template lookup<scalar>(
"parcelConcentration")
64 this->coeffDict().subDict(
"sizeDistribution"),
72 template<
class CloudType>
80 phiName_(im.phiName_),
81 rhoName_(im.rhoName_),
82 duration_(im.duration_),
83 concentration_(im.concentration_),
84 parcelConcentration_(im.parcelConcentration_),
85 sizeDistribution_(im.sizeDistribution_().
clone().ptr())
91 template<
class CloudType>
98 template<
class CloudType>
105 template<
class CloudType>
108 return this->SOI_ + duration_;
112 template<
class CloudType>
115 const polyMesh& mesh = this->owner().mesh();
122 scalar flowRateIn = 0.0;
125 flowRateIn =
max(0.0, -
sum(phip));
133 flowRateIn =
max(0.0, -
sum(phip/rhop));
142 template<
class CloudType>
149 if (time0 >= 0 && time0 < duration_)
151 scalar dt = time1 - time0;
153 scalar
c = concentration_.
value(0.5*(time0 + time1));
155 scalar nParcels = parcelConcentration_*
c*flowRate()*dt;
157 Random& rnd = this->owner().rndGen();
159 label nParcelsToInject = floor(nParcels);
172 return nParcelsToInject;
181 template<
class CloudType>
190 if (time0 >= 0 && time0 < duration_)
192 scalar
c = concentration_.
value(0.5*(time0 + time1));
194 volume =
c*(time1 - time0)*flowRate();
197 return volume*this->owner().constProps().rho0();
201 template<
class CloudType>
216 this->owner().mesh(),
227 template<
class CloudType>
237 parcel.U() = this->owner().U()[parcel.cell()];
240 parcel.d() = sizeDistribution_->sample();
244 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.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Templated injection model class.
Patch injection, by using patch flow rate to determine concentration and velocity.
virtual void topoChange()
Set injector locations when mesh is updated.
virtual ~PatchFlowRateInjection()
Destructor.
PatchFlowRateInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
scalar flowRate() const
Return the total volumetric flow rate across the patch [m^3/s].
virtual void setPositionAndCell(const fvMesh &mesh, Random &rnd, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Inherit setPositionAndCell from patchInjectionBase.
virtual label nParcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
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.
scalar globalScalar01()
Advance the state and return a scalar sample from a uniform.
Light wrapper around Function1 to provide a mechanism to update time-based entries.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const Type & value() const
Return const reference to value.
Accumulating histogram of values. Specified bin resolution automatic generation of bins.
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 setPositionAndCell(const fvMesh &mesh, Random &rnd, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
virtual void topoChange(const polyMesh &mesh)
Update patch geometry and derived info for injection locations.
Mesh consisting of general polyhedral cells.
A class for handling words, derived from string.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
const dimensionedScalar c
Speed of light in a vacuum.
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 > sum(const DimensionedField< Type, GeoMesh > &df)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimFlux