CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Meshing & Mesh Conversion (
-   -   [mesh manipulation] Automatically delete empty patches from boundary file after stitchMesh (

g_b November 21, 2012 03:08

Automatically delete empty patches from boundary file after stitchMesh
Hello foamers,

I was wondering if there is a straightforward/out-of-the-box way to automatically delete empty patches from the boundary file after a successful stitchMesh? Although pyFoam has a utility to add empty patches to the boundary file, I haven't found any to remove them.


mturcios777 November 21, 2012 13:59

I know createPatch removes empty boundaries; try grouping all the empty patches together and see if createPatch will remove them.

vishalsacharya November 24, 2012 00:37

renumberMesh also sometimes does that... but i may be mistaken... its a good idea to renumber after stitching to get the most optimal mesh for decomposition...

rcastilla February 27, 2013 13:00

I think that the problem is that the boundary is in the 0/polyMesh directory instead of in the constant/polyMesh one. Move the 0/polyMesh directory into constant (overwrite the old one) and run pyFoamClearEmptyBoundary again. It worked for me

Gerhard November 23, 2020 08:37

createPatch with no entries under patches in the createPatchDict file will always remove zero-sized patches.
You do not even have to group them together.


All times are GMT -4. The time now is 11:04.