From 0c93a0b32c69b61ed08f35c0d002e950292862f6 Mon Sep 17 00:00:00 2001 From: DennisGlaeser Date: Fri, 9 Dec 2016 16:14:53 +0100 Subject: [PATCH] [box][fvelemgeom] fix normal for dim=2,dimworld=3 The normal was not scaled by the right area for 2d network grids in 3d space, which led to wrong fluxes. --- dumux/implicit/box/fvelementgeometry.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dumux/implicit/box/fvelementgeometry.hh b/dumux/implicit/box/fvelementgeometry.hh index 012e72d2cd..4f0f4cadb8 100644 --- a/dumux/implicit/box/fvelementgeometry.hh +++ b/dumux/implicit/box/fvelementgeometry.hh @@ -943,6 +943,10 @@ public: this->crossProduct(elemNormal, elemVec1, elemVec2); this->crossProduct(scvFace.normal, faceVec, elemNormal); + // scale normal vector by the area + scvFace.normal /= scvFace.normal.two_norm(); + scvFace.normal *= faceVec.two_norm(); + const auto diffVec = subContVol[j].global - subContVol[i].global; // make sure the normal points to the right direction if (scvFace.normal * diffVec < 0) -- GitLab