Bugfix: live factor rejection by cells ; not by faces

This commit is contained in:
Hrvoje Jasak 2019-04-05 15:33:15 +01:00
parent 9bdc8ce728
commit 2bd012729b
2 changed files with 20 additions and 29 deletions

View file

@ -801,7 +801,22 @@ Foam::ImmersedCell<Distance>::ImmersedCell
isBadCut_ = true; 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 Info<< "Bad cell cut: volume = (" << wetCut << " " << dryCut
<< ") = " << wetCut + dryCut << nl << ") = " << wetCut + dryCut << nl

View file

@ -272,19 +272,8 @@ void Foam::ImmersedFace<Distance>::createSubfaces
{ {
drySubface_.setSize(nDry); drySubface_.setSize(nDry);
// Check area: if it is very small, reset the face // Since cell cut is adjusted, face cut cannot be.
if // HJ, 5/Apr/2019
(
drySubface_.mag(facePointsAndIntersections_)
< immersedPoly::liveFactor_()*
localFace.mag(facePointsAndIntersections_)
)
{
// The face is practically wet
isAllWet_ = true;
drySubface_.clear();
}
} }
if (nWet < 3) if (nWet < 3)
@ -299,21 +288,8 @@ void Foam::ImmersedFace<Distance>::createSubfaces
{ {
wetSubface_.setSize(nWet); wetSubface_.setSize(nWet);
// Check area: if it is very small, reset the face // Since cell cut is adjusted, face cut cannot be.
// Note: must use relative tolerance, ie divide with original face // HJ, 5/Apr/2019
// area magnitude. HJ, 30/Aug/2018
if
(
wetSubface_.mag(facePointsAndIntersections_)
< immersedPoly::liveFactor_()*
localFace.mag(facePointsAndIntersections_)
)
{
// The face is practically dry
isAllDry_ = true;
wetSubface_.clear();
}
} }
} }
} }