33 template<
class CloudType>
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>
102 relaxationCollisionNumber_
111 template<
class CloudType>
119 template<
class CloudType>
126 template<
class CloudType>
135 label typeIdP = pP.typeId();
136 label typeIdQ = pQ.typeId();
141 cloud.constProps(typeIdP).d()
142 +
cloud.constProps(typeIdQ).d()
148 cloud.constProps(typeIdP).omega()
149 +
cloud.constProps(typeIdQ).omega()
152 scalar cR =
mag(pP.U() - pQ.U());
159 scalar mP =
cloud.constProps(typeIdP).mass();
160 scalar mQ =
cloud.constProps(typeIdQ).mass();
161 scalar mR = mP*mQ/(mP + mQ);
173 template<
class CloudType>
182 label typeIdP = pP.typeId();
183 label typeIdQ = pQ.typeId();
186 scalar& EiP = pP.Ei();
187 scalar& EiQ = pQ.Ei();
191 scalar inverseCollisionNumber = 1/relaxationCollisionNumber_;
197 scalar preCollisionEiP = EiP;
198 scalar preCollisionEiQ = EiQ;
200 direction iDofP =
cloud.constProps(typeIdP).internalDegreesOfFreedom();
201 direction iDofQ =
cloud.constProps(typeIdQ).internalDegreesOfFreedom();
206 cloud.constProps(typeIdP).omega()
207 +
cloud.constProps(typeIdQ).omega()
210 scalar mP =
cloud.constProps(typeIdP).mass();
211 scalar mQ =
cloud.constProps(typeIdQ).mass();
212 scalar mR = mP*mQ/(mP + mQ);
213 vector Ucm = (mP*UP + mQ*UQ)/(mP + mQ);
214 scalar cRsqr =
magSqr(UP - UQ);
215 scalar availableEnergy = 0.5*mR*cRsqr;
216 scalar ChiB = 2.5 - omegaPQ;
220 if (inverseCollisionNumber >
rndGen.scalar01())
222 availableEnergy += preCollisionEiP;
226 scalar energyRatio = 1.0 -
pow(
rndGen.scalar01(), (1.0/ChiB));
227 EiP = energyRatio*availableEnergy;
231 scalar ChiA = 0.5*iDofP;
232 EiP = energyRatio(ChiA, ChiB)*availableEnergy;
235 availableEnergy -= EiP;
241 if (inverseCollisionNumber >
rndGen.scalar01())
243 availableEnergy += preCollisionEiQ;
247 scalar energyRatio = 1.0 -
pow(
rndGen.scalar01(), (1.0/ChiB));
248 EiQ = energyRatio*availableEnergy;
252 scalar ChiA = 0.5*iDofQ;
253 EiQ = energyRatio(ChiA, ChiB)*availableEnergy;
256 availableEnergy -= EiQ;
261 scalar cR =
sqrt(2.0*availableEnergy/mR);
264 scalar cosTheta = 2.0*
rndGen.scalar01() - 1.0;
265 scalar sinTheta =
sqrt(1.0 - cosTheta*cosTheta);
268 vector postCollisionRelU =
277 UP = Ucm + postCollisionRelU*mQ/(mP + mQ);
278 UQ = Ucm - postCollisionRelU*mP/(mP + mQ);