Bugfix: Avoid zero in log function in dsmcInitialise Authors: Robert Keser & Vanja Skuric

This commit is contained in:
Robert Keser 2017-04-19 14:21:43 +02:00
parent 8607f3d224
commit d69eccdc69

View file

@ -1144,7 +1144,7 @@ Foam::scalar Foam::DsmcCloud<ParcelType>::equipartitionInternalEnergy
else if (iDof < 2.0 + SMALL && iDof > 2.0 - SMALL)
{
// Special case for iDof = 2, i.e. diatomics;
Ei = -log(rndGen_.scalar01())*kb*temperature;
Ei = -log(max(rndGen_.scalar01(), VSMALL))*kb*temperature;
}
else
{