Improved test to avoid /0

This commit is contained in:
Henry
2014-12-12 11:30:27 +00:00
parent d26c772cf5
commit e3c8025e9d

View File

@ -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,11 +289,15 @@ 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();
const scalar nPack = n*alphaMax/alpha()[cellI];
if (n > 0 && nPack < nMin) if (n > 0)
{ {
nMin = nPack; const scalar nPack = n*alphaMax/alpha()[cellI];
if (nPack < nMin)
{
nMin = nPack;
}
} }
} }