r/CFD • u/Syphonicc • 13m ago
My attempt at building a mesher mantle
I've been working on a side research project: an open-source mesher called mantle. STL in, OpenFOAM case + native SU2 mesh out. It's written in Rust and still very much a work in progress, but it has reached the point where I'd love some outside eyes on it.
The idea is to flip the usual order. Instead of making a background mesh and then trying to squeeze prism layers in afterwards (which is where snappyHexMesh tends to give up at small y+), mantle first builds a smooth "shell" around the body at the boundary-layer thickness. It fills the space between the shell and the wall with the layers, and only then fills everything outside with an octree hex core. So the layers aren't an afterthought; they're the first thing that exists.
Things I've been fighting with lately: faceted leading edges (columns collapsing onto facet edges, fixed by extruding along smoothed wall normals), and sharp trailing edges (fans with one layer direction per neighbouring cell, a bit like what T-Rex does).
I ran a head-to-head on the ONERA M6 wing at y+ ≈ 1 (29 layers, first cell 5.8e-6), same STL and same sizing for everyone:
- mantle: the requested first cell over 99.998% of the wall
- snappyHexMesh: layers collapse almost everywhere. I tried 6 configurations (relative/absolute sizes, feature angles, both mesh shrinkers) to make sure it wasn't just bad settings on my end
- cfMesh: about 13% on target, plus a lot of negative cells
To be fair to snappy, it always gave me a valid mesh: it just drops layers where they'd break its quality rules. mantle keeps the layers, but at y+ 1 it still leaves around 10 invalid cells at the wing-tip trailing-edge corners, where the wing is thinner than the layer stack. That's what I'm working on next. I also checked a second wing it was never tuned on, and the results held up.
All the scripts and numbers are in the repo if anyone wants to poke at them or reproduce them: https://github.com/Syphonicc/mantle
What I'd really appreciate:
- STL files that break your current mesher (or mantle!)
- Thoughts from people who do wall-resolved RANS: what would make you actually trust a new mesher?
- Anything that looks off in the comparison
It's a research prototype, not production-ready, so be gentle but honest :)
