33 template<
class CloudType>
42 randomGenerator&
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();
134 cloud.constProps(typeIdP).d()
135 +
cloud.constProps(typeIdQ).d()
141 cloud.constProps(typeIdP).omega()
142 +
cloud.constProps(typeIdQ).omega()
145 scalar cR =
mag(pP.U() - pQ.U());
152 scalar mP =
cloud.constProps(typeIdP).mass();
153 scalar mQ =
cloud.constProps(typeIdQ).mass();
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;
193 direction iDofP =
cloud.constProps(typeIdP).internalDegreesOfFreedom();
194 direction iDofQ =
cloud.constProps(typeIdQ).internalDegreesOfFreedom();
199 cloud.constProps(typeIdP).omega()
200 +
cloud.constProps(typeIdQ).omega()
203 scalar mP =
cloud.constProps(typeIdP).mass();
204 scalar mQ =
cloud.constProps(typeIdQ).mass();
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;
215 availableEnergy += preCollisionEiP;
220 EiP = energyRatio*availableEnergy;
224 scalar ChiA = 0.5*iDofP;
225 EiP = energyRatio(ChiA, ChiB)*availableEnergy;
228 availableEnergy -= EiP;
236 availableEnergy += preCollisionEiQ;
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);
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);
Templated DSMC particle collision class.
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Variable Hard Sphere BinaryCollision Model with Larsen Borgnakke internal energy redistribution....
virtual scalar sigmaTcR(const typename CloudType::parcelType &pP, const typename CloudType::parcelType &pQ) const
Return the collision cross section * relative velocity product.
LarsenBorgnakkeVariableHardSphere(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
virtual ~LarsenBorgnakkeVariableHardSphere()
Destructor.
virtual void collide(typename CloudType::parcelType &pP, typename CloudType::parcelType &pQ)
Apply collision.
A cloud is a collection of lagrangian particles.
A list of keyword definitions, which are a keyword followed by any number of values (e....
scalar scalar01()
Return a scalar uniformly distributed between zero and one.
const scalar twoPi(2 *pi)
DSMCCloud< dsmcParcel > CloudType
dimensionedScalar exp(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedScalar lgamma(const dimensionedScalar &ds)
dimensionedScalar sin(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Vector< scalar > vector
A scalar version of the templated Vector.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar cos(const dimensionedScalar &ds)
randomGenerator rndGen(653213)