Go to the documentation of this file.
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();
111 scalar magTangent = 0.0;
114 while (magTangent < SMALL)
118 tangent = v - (v & axis)*axis;
119 magTangent =
mag(tangent);
122 tanVec1_[i] = tangent/magTangent;
123 tanVec2_[i] = axis^tanVec1_[i];
127 this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_);
133 template<
class CloudType>
159 template<
class CloudType>
166 template<
class CloudType>
172 this->findCellAtPosition
175 injectorTetFaces_[i],
177 positionAxis_[i].first()
183 template<
class CloudType>
186 return this->SOI_ + duration_;
190 template<
class CloudType>
197 if ((time0 >= 0.0) && (time0 < duration_))
199 const scalar targetVolume = flowRateProfile_.integrate(0, time1);
201 const label targetParcels =
202 parcelsPerInjector_*targetVolume/this->volumeTotal_;
204 const label nToInject = targetParcels - nInjected_;
206 return positionAxis_.size()*nToInject;
215 template<
class CloudType>
222 if ((time0 >= 0.0) && (time0 < duration_))
224 return flowRateProfile_.integrate(time0, time1);
233 template<
class CloudType>
245 const label i = parcelI % positionAxis_.size();
247 position = positionAxis_[i].first();
248 cellOwner = injectorCells_[i];
249 tetFaceI = injectorTetFaces_[i];
250 tetPtI = injectorTetPts_[i];
254 template<
class CloudType>
266 const label i = parcelI % positionAxis_.size();
268 scalar t = time - this->SOI_;
269 scalar ti = thetaInner_.value(t);
270 scalar to = thetaOuter_.value(t);
274 scalar dcorr =
cos(coneAngle);
278 vector dirVec = dcorr*positionAxis_[i].second();
280 dirVec /=
mag(dirVec);
282 parcel.U() = Umag_.value(t)*dirVec;
285 parcel.d() = sizeDistribution_().sample();
292 template<
class CloudType>
299 template<
class CloudType>
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
virtual ~ConeInjection()
Destructor.
const label parcelsPerInjector_
Number of parcels to introduce per injector.
Type sample01()
Return a sample whose components lie in the range 0-1.
A class for handling words, derived from string.
labelList injectorCells_
List of cell labels corresponding to injector positions.
const TimeDataEntry< scalar > thetaInner_
Inner half-cone angle relative to SOI [deg].
#define forAll(list, i)
Loop across all elements in list.
labelList injectorTetFaces_
List of tetFace labels corresponding to injector positions.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
const TimeDataEntry< scalar > flowRateProfile_
Flow rate profile relative to SOI [].
dimensionedScalar sin(const dimensionedScalar &ds)
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Unit conversion functions.
Templated injection model class.
static autoPtr< distributionModel > New(const dictionary &dict, cachedRandom &rndGen)
Selector.
const scalar twoPi(2 *pi)
dimensioned< scalar > mag(const dimensioned< Type > &)
Random & rndGen()
Return refernce to the random object.
vectorList tanVec2_
Second tangential vector.
const TimeDataEntry< scalar > thetaOuter_
Outer half-cone angle relative to SOI [deg].
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label nInjected_
Number of parcels per injector already injected.
Type position(const Type &start, const Type &end)
Return a sample between start and end.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
ConeInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
scalar duration_
Injection duration [s].
Templated base class for dsmc cloud.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const TimeDataEntry< scalar > Umag_
Parcel velocity magnitude relative to SOI [m/s].
const autoPtr< distributionModels::distributionModel > sizeDistribution_
Parcel size distribution model.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Multi-point cone injection model.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
labelList injectorTetPts_
List of tetPt labels corresponding to injector positions.
virtual void updateMesh()
Set injector locations when mesh is updated.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
vectorList tanVec1_
First tangential vector.
scalar timeEnd() const
Return the end-of-injection time.
A normal distribution model.
List< Tuple2< vector, vector > > positionAxis_
List of position and axis for each injector.
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.
stressControl lookup("compactNormalStress") >> compactNormalStress
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
dimensionedScalar cos(const dimensionedScalar &ds)