ENH: primitiveMeshTools: handle zero/neg volume cells

This commit is contained in:
mattijs
2014-01-27 12:54:48 +00:00
parent 1f192f8b73
commit 7054a8be58

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) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -315,10 +315,12 @@ void Foam::primitiveMeshTools::cellClosedness
scalar aspectRatio = maxCmpt/(minCmpt + VSMALL); scalar aspectRatio = maxCmpt/(minCmpt + VSMALL);
if (nDims == 3) if (nDims == 3)
{ {
scalar v = max(VSMALL, vols[cellI]);
aspectRatio = max aspectRatio = max
( (
aspectRatio, aspectRatio,
1.0/6.0*cmptSum(sumMagClosed[cellI])/pow(vols[cellI], 2.0/3.0) 1.0/6.0*cmptSum(sumMagClosed[cellI])/pow(v, 2.0/3.0)
); );
} }