34template<
class CloudType>
47template<
class CloudType>
54 gradkPtr_(dm.gradkPtr_),
55 ownGradK_(dm.ownGradK_)
63template<
class CloudType>
72template<
class CloudType>
79 gradkPtr_ =
fvc::grad(*this->kPtr_).ptr();
94template<
class CloudType>
105 Random& rnd = this->owner().rndGen();
107 const scalar cps = 0.16432;
109 const scalar
k = this->kPtr_->primitiveField()[celli];
111 this->epsilonPtr_->primitiveField()[celli] + ROOTVSMALL;
112 const vector& gradk = this->gradkPtr_->primitiveField()[celli];
114 const scalar UrelMag =
mag(
U - Uc - UTurb);
116 const scalar tTurbLoc =
125 if (tTurb > tTurbLoc)
130 const vector dir = -gradk/(
mag(gradk) + SMALL);
138 if (this->owner().
mesh().nSolutionD() == 2)
140 fac = rnd.GaussNormal<scalar>();
144 fac =
mag(rnd.GaussNormal<scalar>());
const CloudType & owner() const
Return const access to the owner cloud.
Base class for particle dispersion models based on RAS turbulence.
const volScalarField * epsilonPtr_
Turbulence epsilon.
virtual void cacheFields(const bool store)
Cache carrier fields.
const volScalarField * kPtr_
Turbulence k.
DispersionRASModel(const dictionary &dict, CloudType &owner)
Construct from components.
The velocity is perturbed in the direction of -grad(k), with a Gaussian random number distribution wi...
virtual ~GradientDispersionRAS()
Destructor.
virtual void cacheFields(const bool store)
Cache carrier fields.
GradientDispersionRAS(const dictionary &dict, CloudType &owner)
Construct from components.
const volVectorField * gradkPtr_
Gradient of k.
virtual vector update(const scalar dt, const label celli, const vector &U, const vector &Uc, vector &UTurb, scalar &tTurb)
Update (disperse particles).
bool ownGradK_
Take ownership of the grad(k).
Type GaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Template functions to aid in the implementation of demand driven data.
Calculate the gradient of the given field.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
DSMCCloud< dsmcParcel > CloudType
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0).
void deleteDemandDrivenData(DataPtr &dataPtr)
Calculate the second temporal derivative.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)