mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added probabilistic insertion of an additional particle on a face proportional to the remainder after taking the integer part.
This commit is contained in:
@ -249,9 +249,16 @@ void Foam::FreeStream<CloudType>::inflow()
|
||||
{
|
||||
scalar& faceAccumulator = pFA[i][f];
|
||||
|
||||
// Number of particles to insert
|
||||
// Number of whole particles to insert
|
||||
label nI = max(label(faceAccumulator), 0);
|
||||
|
||||
// Add another particle with a probability proportional to the
|
||||
// remainder of taking the integer part of faceAccumulator
|
||||
if ((faceAccumulator - nI) > rndGen.scalar01())
|
||||
{
|
||||
nI++;
|
||||
}
|
||||
|
||||
faceAccumulator -= nI;
|
||||
|
||||
label typeId = moleculeTypeIds_[i];
|
||||
|
||||
Reference in New Issue
Block a user