diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C index 391a6a8a37c25e228158ee76b43e2cb70bafaea2..8d3c0c0a57a1f4b5ca3b59608cf730b061d0a552 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -539,7 +539,15 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::cellDeterminant } } - cellDeterminant[celli] = mag(det(areaTensor)); + // Note: + // - normalise to be 0..1 (since cube has eigenvalues 2 2 2) + // - we use the determinant (i.e. 3rd invariant) and not e.g. + // condition number (= max ev / min ev) since we are + // interested in the minimum connectivity and not the + // uniformity. Using the condition number on corner cells + // leads to uniformity 1 i.e. equally bad in all three + // directions which is not what we want. + cellDeterminant[celli] = mag(det(areaTensor))/8.0; } } } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.H b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.H index 34045ec79f2dd54150475feee41dbdae143fd34e..535ead0a19522484001909d64483f6bcb566e7ec 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshTools.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -119,7 +119,7 @@ public: const pointField& p ); - //- Generate cell determinant field + //- Generate cell determinant field. Normalised to 1 for an internal cube. static tmp<scalarField> cellDeterminant ( const primitiveMesh& mesh,