From 2bd012729b7decb4b1b3d3b476623274b3031d4c Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 5 Apr 2019 15:33:15 +0100 Subject: [PATCH] Bugfix: live factor rejection by cells ; not by faces --- .../immersedPoly/ImmersedCell.C | 17 +++++++++- .../immersedPoly/ImmersedFace.C | 32 +++---------------- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedCell.C b/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedCell.C index 6166e9e6a..d2c0d9118 100644 --- a/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedCell.C +++ b/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedCell.C @@ -801,7 +801,22 @@ Foam::ImmersedCell::ImmersedCell isBadCut_ = true; } - if (isBadCut_) + // If the cut is not bad, adjust the cell for thin cell cut + if (!isBadCut_) + { + if (mag(wetCut) < immersedPoly::liveFactor_()) + { + // Cell is dry; reset + isAllDry_ = true; + } + + if (mag(dryCut) < immersedPoly::liveFactor_()) + { + // Cell is wet; reset + isAllWet_ = true; + } + } + else { Info<< "Bad cell cut: volume = (" << wetCut << " " << dryCut << ") = " << wetCut + dryCut << nl diff --git a/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedFace.C b/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedFace.C index c0c997fab..e18cf7ea7 100644 --- a/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedFace.C +++ b/src/immersedBoundary/immersedBoundary/immersedPoly/ImmersedFace.C @@ -272,19 +272,8 @@ void Foam::ImmersedFace::createSubfaces { drySubface_.setSize(nDry); - // Check area: if it is very small, reset the face - if - ( - drySubface_.mag(facePointsAndIntersections_) - < immersedPoly::liveFactor_()* - localFace.mag(facePointsAndIntersections_) - ) - { - // The face is practically wet - isAllWet_ = true; - - drySubface_.clear(); - } + // Since cell cut is adjusted, face cut cannot be. + // HJ, 5/Apr/2019 } if (nWet < 3) @@ -299,21 +288,8 @@ void Foam::ImmersedFace::createSubfaces { wetSubface_.setSize(nWet); - // Check area: if it is very small, reset the face - // Note: must use relative tolerance, ie divide with original face - // area magnitude. HJ, 30/Aug/2018 - if - ( - wetSubface_.mag(facePointsAndIntersections_) - < immersedPoly::liveFactor_()* - localFace.mag(facePointsAndIntersections_) - ) - { - // The face is practically dry - isAllDry_ = true; - - wetSubface_.clear(); - } + // Since cell cut is adjusted, face cut cannot be. + // HJ, 5/Apr/2019 } } }