mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Improved test to avoid /0
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -289,13 +289,17 @@ void Foam::MPPICCloud<CloudType>::info()
|
|||||||
forAll(this->mesh().cells(), cellI)
|
forAll(this->mesh().cells(), cellI)
|
||||||
{
|
{
|
||||||
const label n = this->cellOccupancy()[cellI].size();
|
const label n = this->cellOccupancy()[cellI].size();
|
||||||
|
|
||||||
|
if (n > 0)
|
||||||
|
{
|
||||||
const scalar nPack = n*alphaMax/alpha()[cellI];
|
const scalar nPack = n*alphaMax/alpha()[cellI];
|
||||||
|
|
||||||
if (n > 0 && nPack < nMin)
|
if (nPack < nMin)
|
||||||
{
|
{
|
||||||
nMin = nPack;
|
nMin = nPack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
reduce(nMin, minOp<scalar>());
|
reduce(nMin, minOp<scalar>());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user