mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user