33 template<
class CloudType>
42 Random&
rndGen(cloud.rndGen());
44 scalar ChiAMinusOne = ChiA - 1;
45 scalar ChiBMinusOne = ChiB - 1;
47 if (ChiAMinusOne < small && ChiBMinusOne < small)
59 energyRatio =
rndGen.scalar01();
61 if (ChiAMinusOne < small)
63 P = 1.0 -
pow(energyRatio, ChiB);
65 else if (ChiBMinusOne < small)
67 P = 1.0 -
pow(energyRatio, ChiA);
74 (ChiAMinusOne + ChiBMinusOne)*energyRatio/ChiAMinusOne,
79 (ChiAMinusOne + ChiBMinusOne)*(1 - energyRatio)
84 }
while (P <
rndGen.scalar01());
92 template<
class CloudType>
101 Tref_(this->coeffDict().template lookup<scalar>(
"Tref")),
102 relaxationCollisionNumber_
104 this->coeffDict().
template lookup<scalar>(
"relaxationCollisionNumber")
111 template<
class CloudType>
119 template<
class CloudType>
128 label typeIdP = pP.typeId();
129 label typeIdQ = pQ.typeId();
145 scalar cR =
mag(pP.U() - pQ.U());
154 scalar mR = mP*mQ/(mP + mQ);
166 template<
class CloudType>
175 label typeIdP = pP.typeId();
176 label typeIdQ = pQ.typeId();
179 scalar& EiP = pP.Ei();
180 scalar& EiQ = pQ.Ei();
184 scalar inverseCollisionNumber = 1/relaxationCollisionNumber_;
190 scalar preCollisionEiP = EiP;
191 scalar preCollisionEiQ = EiQ;
205 scalar mR = mP*mQ/(mP + mQ);
206 vector Ucm = (mP*UP + mQ*UQ)/(mP + mQ);
207 scalar cRsqr =
magSqr(UP - UQ);
208 scalar availableEnergy = 0.5*mR*cRsqr;
209 scalar ChiB = 2.5 - omegaPQ;
213 if (inverseCollisionNumber >
rndGen.scalar01())
215 availableEnergy += preCollisionEiP;
219 scalar energyRatio = 1.0 -
pow(
rndGen.scalar01(), (1.0/ChiB));
220 EiP = energyRatio*availableEnergy;
224 scalar ChiA = 0.5*iDofP;
225 EiP = energyRatio(ChiA, ChiB)*availableEnergy;
228 availableEnergy -= EiP;
234 if (inverseCollisionNumber >
rndGen.scalar01())
236 availableEnergy += preCollisionEiQ;
240 scalar energyRatio = 1.0 -
pow(
rndGen.scalar01(), (1.0/ChiB));
241 EiQ = energyRatio*availableEnergy;
245 scalar ChiA = 0.5*iDofQ;
246 EiQ = energyRatio(ChiA, ChiB)*availableEnergy;
249 availableEnergy -= EiQ;
254 scalar cR =
sqrt(2.0*availableEnergy/mR);
257 scalar cosTheta = 2.0*
rndGen.scalar01() - 1.0;
258 scalar sinTheta =
sqrt(1.0 - cosTheta*cosTheta);
261 vector postCollisionRelU =
270 UP = Ucm + postCollisionRelU*mQ/(mP + mQ);
271 UQ = Ucm - postCollisionRelU*mP/(mP + mQ);
virtual void collide(typename CloudType::parcelType &pP, typename CloudType::parcelType &pQ)
Apply collision.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
DSMCCloud< dsmcParcel > CloudType
virtual scalar sigmaTcR(const typename CloudType::parcelType &pP, const typename CloudType::parcelType &pQ) const
Return the collision cross section * relative velocity product.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Templated DSMC particle collision class.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Vector< scalar > vector
A scalar version of the templated Vector.
virtual ~LarsenBorgnakkeVariableHardSphere()
Destructor.
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
Random & rndGen()
Return references to the random object.
const scalar twoPi(2 *pi)
ParcelType parcelType
Type of parcel the cloud was instantiated for.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar sin(const dimensionedScalar &ds)
dimensionedScalar lgamma(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
LarsenBorgnakkeVariableHardSphere(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
const dimensionedScalar k
Boltzmann constant.
dimensioned< scalar > mag(const dimensioned< Type > &)
Templated base class for dsmc cloud.
const List< typename ParcelType::constantProperties > & constProps() const
Return all of the constant properties.
Variable Hard Sphere BinaryCollision Model with Larsen Borgnakke internal energy redistribution. Based on the INELRS subroutine in Bird's DSMC0R.FOR.