35 template<
class CloudType>
44 positionAxis_(this->coeffDict().lookup(
"positionAxis")),
45 injectorCells_(positionAxis_.size()),
46 injectorTetFaces_(positionAxis_.size()),
47 injectorTetPts_(positionAxis_.size()),
93 this->coeffDict().subDict(
"sizeDistribution"), owner.rndGen()
96 nInjected_(this->parcelsAddedTotal()),
97 tanVec1_(positionAxis_.size()),
98 tanVec2_(positionAxis_.size())
100 duration_ = owner.db().time().userTimeToTime(duration_);
106 vector& axis = positionAxis_[i].second();
115 this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_);
121 template<
class CloudType>
128 positionAxis_(im.positionAxis_),
129 injectorCells_(im.injectorCells_),
130 injectorTetFaces_(im.injectorTetFaces_),
131 injectorTetPts_(im.injectorTetPts_),
132 duration_(im.duration_),
133 parcelsPerInjector_(im.parcelsPerInjector_),
134 flowRateProfile_(im.flowRateProfile_),
136 thetaInner_(im.thetaInner_),
137 thetaOuter_(im.thetaOuter_),
138 sizeDistribution_(im.sizeDistribution_().clone().ptr()),
139 nInjected_(im.nInjected_),
140 tanVec1_(im.tanVec1_),
141 tanVec2_(im.tanVec2_)
147 template<
class CloudType>
154 template<
class CloudType>
160 this->findCellAtPosition
163 injectorTetFaces_[i],
165 positionAxis_[i].first()
171 template<
class CloudType>
174 return this->SOI_ + duration_;
178 template<
class CloudType>
185 if ((time0 >= 0.0) && (time0 < duration_))
187 const scalar targetVolume = flowRateProfile_.integrate(0, time1);
189 const label targetParcels =
190 parcelsPerInjector_*targetVolume/this->volumeTotal_;
192 const label nToInject = targetParcels - nInjected_;
194 nInjected_ += nToInject;
196 return positionAxis_.size()*nToInject;
205 template<
class CloudType>
212 if ((time0 >= 0.0) && (time0 < duration_))
214 return flowRateProfile_.integrate(time0, time1);
223 template<
class CloudType>
235 const label i = parcelI % positionAxis_.size();
237 position = positionAxis_[i].first();
238 cellOwner = injectorCells_[i];
239 tetFacei = injectorTetFaces_[i];
240 tetPti = injectorTetPts_[i];
244 template<
class CloudType>
253 Random& rnd = this->owner().rndGen();
256 const label i = parcelI % positionAxis_.size();
258 scalar t = time - this->SOI_;
259 scalar ti = thetaInner_.value(t);
260 scalar to = thetaOuter_.value(t);
264 scalar dcorr =
cos(coneAngle);
267 vector normal = alpha*(tanVec1_[i]*
cos(beta) + tanVec2_[i]*
sin(beta));
268 vector dirVec = dcorr*positionAxis_[i].second();
270 dirVec /=
mag(dirVec);
272 parcel.U() = Umag_.value(t)*dirVec;
275 parcel.d() = sizeDistribution_().sample();
279 template<
class CloudType>
286 template<
class CloudType>
ConeInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Templated injection model class.
scalar scalarAB(const scalar a, const scalar b)
Advance the state and return a scalar sample from a uniform.
Unit conversion functions.
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
virtual void setPositionAndCell(const label parcelI, const label nParcels, const scalar time, vector &position, label &cellOwner, label &tetFacei, label &tetPti)
Set the injection position and owner cell, tetFace and tetPt.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
Type sample01()
Advance the state and return a sample of a given type from a.
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar cos(const dimensionedScalar &ds)
A class for handling words, derived from string.
scalar timeEnd() const
Return the end-of-injection time.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
const scalar twoPi(2 *pi)
ParcelType parcelType
Type of parcel the cloud was instantiated for.
dimensionedScalar sin(const dimensionedScalar &ds)
virtual ~ConeInjection()
Destructor.
Vector< Cmpt > perpendicular(const Vector< Cmpt > &v)
static autoPtr< distributionModel > New(const dictionary &dict, Random &rndGen)
Selector.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
dimensioned< scalar > mag(const dimensioned< Type > &)
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Templated base class for dsmc cloud.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Multi-point cone injection model.