When iDof = 0, equipartitionInternalEnergy will enter an infinite loop, adding a check and return.

This commit is contained in:
graham
2009-04-13 13:02:17 +01:00
parent 886cab29a0
commit a8b37fc4a7

View File

@ -350,7 +350,7 @@ void Foam::DsmcCloud<ParcelType>::collisions()
scalar selectedPairs =
collisionSelectionRemainder_[celli]
+ 0.5*nC*(nC-1)*nParticle_*sigmaTcRMax*deltaT
+ 0.5*nC*(nC - 1)*nParticle_*sigmaTcRMax*deltaT
/mesh_.cellVolumes()[celli];
label nCandidates(selectedPairs);
@ -859,7 +859,11 @@ Foam::scalar Foam::DsmcCloud<ParcelType>::equipartitionInternalEnergy
{
scalar Ei = 0.0;
if (iDof < 2.0 + SMALL && iDof > 2.0 - SMALL)
if (iDof < SMALL)
{
return Ei;
}
else if (iDof < 2.0 + SMALL && iDof > 2.0 - SMALL)
{
// Special case for iDof = 2, i.e. diatomics;
Ei = -log(rndGen_.scalar01())*kb*temperature;