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>
140 positionAxis_(im.positionAxis_),
141 injectorCells_(im.injectorCells_),
142 injectorTetFaces_(im.injectorTetFaces_),
143 injectorTetPts_(im.injectorTetPts_),
144 duration_(im.duration_),
145 parcelsPerInjector_(im.parcelsPerInjector_),
146 flowRateProfile_(im.flowRateProfile_),
148 thetaInner_(im.thetaInner_),
149 thetaOuter_(im.thetaOuter_),
150 sizeDistribution_(im.sizeDistribution_().clone().ptr()),
151 nInjected_(im.nInjected_),
152 tanVec1_(im.tanVec1_),
153 tanVec2_(im.tanVec2_)
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 nInjected_ += nToInject;
208 return positionAxis_.size()*nToInject;
217 template<
class CloudType>
224 if ((time0 >= 0.0) && (time0 < duration_))
226 return flowRateProfile_.integrate(time0, time1);
235 template<
class CloudType>
247 const label i = parcelI % positionAxis_.size();
249 position = positionAxis_[i].first();
250 cellOwner = injectorCells_[i];
251 tetFaceI = injectorTetFaces_[i];
252 tetPtI = injectorTetPts_[i];
256 template<
class CloudType>
268 const label i = parcelI % positionAxis_.size();
270 scalar t = time - this->SOI_;
271 scalar ti = thetaInner_.value(t);
272 scalar to = thetaOuter_.value(t);
276 scalar dcorr =
cos(coneAngle);
280 vector dirVec = dcorr*positionAxis_[i].second();
282 dirVec /=
mag(dirVec);
284 parcel.U() = Umag_.value(t)*dirVec;
287 parcel.d() = sizeDistribution_().sample();
291 template<
class CloudType>
298 template<
class CloudType>
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
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.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual void updateMesh()
Set injector locations when mesh is updated.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
A class for handling words, derived from string.
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...
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Multi-point cone injection model.
stressControl lookup("compactNormalStress") >> compactNormalStress
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Templated injection model class.
dimensionedScalar cos(const dimensionedScalar &ds)
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Unit conversion functions.
static autoPtr< distributionModel > New(const dictionary &dict, cachedRandom &rndGen)
Selector.
scalar timeEnd() const
Return the end-of-injection time.
ConeInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual ~ConeInjection()
Destructor.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
A normal distribution model.
Type sample01()
Return a sample whose components lie in the range 0-1.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Type position(const Type &start, const Type &end)
Return a sample between start and end.
Templated base class for dsmc cloud.
const scalar twoPi(2 *pi)
dimensionedScalar sin(const dimensionedScalar &ds)