From 11e3740f639b8c32eff434ec46ed07458b2bdc05 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 12 Dec 2014 11:30:27 +0000 Subject: [PATCH] Improved test to avoid /0 --- .../clouds/Templates/MPPICCloud/MPPICCloud.C | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C index eb436471ea..8c7c2cbb55 100644 --- a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -289,11 +289,15 @@ void Foam::MPPICCloud::info() forAll(this->mesh().cells(), cellI) { 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; + } } }