Before I get into this one, I wanted to remind you that The OpenFOAM Diet is now available to read! You’ll actually start learning how to use OpenFOAM properly without the fluff and confusion. (You’ll also be supporting my continued effort to make this tool and simulation knowledge more accessible to all!). Click here for details.


First go, corner layers collapse

Whilst frustrating to say the least, the results from snappyHexMesh improve when you start thinking about it a little more holistically…

I’ve found it’s best to stop thinking about it in stages (castellation | snapping | layering) and instead think of it like a waterfall process (castellation to snapping to layering).

In other words, generally, the success of each feeds into the next.

This means you stop thinking “I need a fine base mesh before anything”.
The truth it’s often more productive and beneficial to keep it relatively coarse and moderately refine the cells in snappyHexMesh from here.

Second go, more layers closer to the corner and symmetric on approach

A “Setup” tends to make you think of providing snappyHexMesh all the parameter numbers that need to go in (be completed).

Whereas a “Strategy” is an approach to meshing, providing snappyHexMesh with parameter values that work together.

Here’s my general strategy for a new geometry file:

Base mesh: Moderately coarse (not too fine)
Surface refinement: Moderate, resolveFeatureAngle: <20
Snap: tolerance 2, nRelaxIter 20
Layers: Thin and a few to start, nGrow: 1 or 2, featureAngle: 120 – 130

I let this guide my work.

Could this be the answer to all geometries? No, and it can get frustrating.
But it does provide a starting point from which you can hopefully refine later.

What I’m fast realising with snappyHexMesh…

Commercial meshing tools make it super-easy to generate a mesh using alternative algorithms and moderate / forgiving presets.

snappyHexMesh has a meshing algorithm with is based on recursive refinement and extruding layers after a mesh exists.

This is often the source of many of its “issues” – my quest is to focus in on these and tame them.

Watch this space as I share my progress and solutions with you.

See you soon 👋

admin