From e58ff9d366c4f70aa044a0a199ef71a0ceee5400 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 5 Feb 2015 16:31:29 +0000 Subject: [PATCH] primitiveMeshTools: stabilize with VSMALL rather than SMALL to avoid problems with very small meshes Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1509 --- .../primitiveMeshCheck/primitiveMeshTools.C | 120 +----------------- 1 file changed, 5 insertions(+), 115 deletions(-) diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C index fa83d3ae9d..868c53954c 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ Foam::scalar Foam::primitiveMeshTools::faceSkewness // Skewness vector vector sv = Cpf - - ((fAreas[faceI] & Cpf)/((fAreas[faceI] & d) + SMALL))*d; + - ((fAreas[faceI] & Cpf)/((fAreas[faceI] & d) + VSMALL))*d; vector svHat = sv/(mag(sv) + VSMALL); // Normalisation distance calculated as the approximate distance @@ -64,6 +64,7 @@ Foam::scalar Foam::primitiveMeshTools::faceSkewness return mag(sv)/fd; } + Foam::scalar Foam::primitiveMeshTools::boundaryFaceSkewness ( const primitiveMesh& mesh, @@ -196,6 +197,7 @@ Foam::tmp Foam::primitiveMeshTools::faceSkewness return tskew; } + void Foam::primitiveMeshTools::facePyramidVolume ( const primitiveMesh& mesh, @@ -440,7 +442,7 @@ Foam::tmp Foam::primitiveMeshTools::faceFlatness sumA += mag(n); } - faceFlatness[faceI] = magAreas[faceI] / (sumA+VSMALL); + faceFlatness[faceI] = magAreas[faceI]/(sumA + VSMALL); } } @@ -448,116 +450,6 @@ Foam::tmp Foam::primitiveMeshTools::faceFlatness } -//Foam::tmp Foam::primitiveMeshTools::edgeAlignment -//( -// const primitiveMesh& mesh, -// const Vector