Skip to content
Snippets Groups Projects
Commit aca1aa0b authored by mattijs's avatar mattijs
Browse files

ENH: polyMeshGeometry: normalise cellDeterminant calculation. Fixes #380.

parent 7feca849
Branches
Tags
No related merge requests found
......@@ -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;
}
}
}
......
......@@ -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,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment