Added an if (cR < SMALL) guard to VHS sigmaTcR calculation. Giving each processor a different random number generator seed, otherwise they follow the same sequence and are not independent. Tnis is a practical problem because they were producing molecules with the same velocity in neighbouring cells on different procs which then collided and caused a floating point error because they had equal velocities.

This commit is contained in:
graham
2009-03-06 16:30:33 +00:00
parent 9c32b96e01
commit 4b75568c90
3 changed files with 12 additions and 2 deletions

View File

@ -438,7 +438,7 @@ Foam::DsmcCloud<ParcelType>::DsmcCloud
)
),
constProps_(),
rndGen_(label(971501)),
rndGen_(label(149382906) + 7183*Pstream::myProcNo()),
T_(T),
U_(U),
binaryCollisionModel_
@ -543,7 +543,7 @@ Foam::DsmcCloud<ParcelType>::DsmcCloud
)
),
constProps_(),
rndGen_(label(971501)),
rndGen_(label(971501) + 1526*Pstream::myProcNo()),
T_
(
volScalarField

View File

@ -142,6 +142,11 @@ Foam::scalar Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::sigmaTcR
scalar cR = mag(UP - UQ);
if (cR < VSMALL)
{
return 0;
}
scalar mP = cloud.constProps(typeIdP).mass();
scalar mQ = cloud.constProps(typeIdQ).mass();

View File

@ -76,6 +76,11 @@ Foam::scalar Foam::VariableHardSphere<CloudType>::sigmaTcR
scalar cR = mag(UP - UQ);
if (cR < VSMALL)
{
return 0;
}
scalar mP = cloud.constProps(typeIdP).mass();
scalar mQ = cloud.constProps(typeIdQ).mass();