snappyHexMesh leak detection is prone to false positives
Summary
snappyHexMesh leak detection using the locationsOutsideMesh keyword is highly prone to false positives. In other words, a detected leak often doesn't actually cause the mesh to leak when meshed.
Steps to reproduce
I've attached a simple model to demonstrate this issue. The model is simply a block inside of another block. The inner block has a triangle removed which snappyHexMesh detects as a leak.
On the attached model run...
- blockMesh
- snappyHexMesh -overwrite
You should get an error and a leak path is exported. Now...
- remove the locationsOutsideMesh keyword in the snappyHexMeshDict
- re-run snappyHexMesh
- Review mesh, you'll see that there is no leak into the inner box
Example case
What is the current bug behaviour?
snappyHexMesh detects a leak when there isn't one.
What is the expected correct behavior?
snappyHexMesh should only detect a leak if there actually is one.
Environment information
- OpenFOAM version : v1906
- Operating system : RHEL/Windows 10
- Hardware info : Intel
- Compiler : gcc/minGW
Possible fixes
I suspect the leak detection code is not using the same method that is used to find regions and remove cells during the castellation phase. If possible, the same walking method used to find regions and remove cells should be used to find leaks between the two points. The current method produces way too many false positives to be useful on more complex geometry.