From 21301e3aba1264514f8d6f6e7f50e97c1a110ffe Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Fri, 8 Sep 2017 17:22:49 +0100 Subject: [PATCH] ENH: isoCutCell - improved robustness. Patch provided by Johan Roenby - see #582 --- .../isoAdvection/isoCutCell/isoCutCell.C | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutCell/isoCutCell.C b/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutCell/isoCutCell.C index 33563d728d..30aaa5f72b 100644 --- a/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutCell/isoCutCell.C +++ b/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoCutCell/isoCutCell.C @@ -361,6 +361,23 @@ Foam::label Foam::isoCutCell::calcSubCell // Cell cut at least at one face cellStatus_ = 0; calcIsoFaceCentreAndArea(); + + // In the rare but occuring cases where a cell is only touched at a + // point or a line the isoFaceArea_ will have zero length and here the + // cell should be treated as either completely empty or full. + if (mag(isoFaceArea_) < 10*SMALL) + { + if (fullySubFaces_.empty()) + { + // Cell fully above isosurface + cellStatus_ = 1; + } + else + { + // Cell fully below isosurface + cellStatus_ = -1; + } + } } else if (fullySubFaces_.empty()) {