Hey there 👋
It’s Robin from CFD Engine & I’m back wrapping (again), but this time I’ve got a little workflow mod for those who like to wrap, but also quite like feature edges.
Shrinkwrapping can save us a bunch of CAD clean-up time, but it tends to soften the sharp edges in our models.
But what if we need those sharp edges? What if they’re an important part of our simulation? Is wrapping a no-go?
What if I said you could have it all – a no-leak volume mesh, with crisp edges, without hours of CAD clean-up?
No new software.
No command-line gymnastics.
Just a bit of lateral thinking & a slightly different workflow.
Interested? Let’s go…
Imagine…
Imagine a super-complex CAD assembly that would take us an age to clean-up. We can’t just throw it at snappyHexMesh
, it leaks & it has loads of extra detail that makes the OBJ file enormous.
It sounds like a candidate for shrinkwrapping. We could even use the open-source wrapper from CGAL that we discovered a few months ago 👍
But…our geometry has some important feature edges that we need to keep.
They’ll get rounded off by the wrapper. We won’t be able to extract feature edges from the wrap, there aren’t any left.
How about we take feature edges from the original geometry & use them in snappyHexMesh
, along with our watertight wrap?
Something like this…
For example
Here’s how it looks in practice (click for a bigger version):
- the original geometry: remember, it’s super-complex & would take forever to tidy up – we extract our feature edges from here.
- the wrapped surface: a watertight version of our original geometry, but the sharp edges have disappeared (even with a fine tolerance).
- standard volume mesh: meshed using the wrapped surface only. It doesn’t matter how much we try to refine it, the sharp edges are never coming back, they’re lost.
- improved volume mesh: meshed using the wrapped surface plus the feature edges from the original geometry. No leaks & we’ve recovered our sharp edges 🙌
Give it a go
- export your complex/dirty CAD geometry as an OBJ;
- wrap it using the CGAL wrapper (or Rhino v8, if you have it);
- extract feature edges from your complex/dirty CAD geometry using
surfaceFeatureExtract
; - add the wrapped surface to the
geometry
&refinementSurfaces
in yoursnappyHexMeshDict
; - add the feature edge
.eMesh
file to thefeatures
section of yoursnappyHexMeshDict
& turn onexplicitFeatureSnap
- mesh it 🤞
Experiment with different edge lengths & wrap settings to see if you can get something useful for your own geometry. It’s undoubtedly geometry specific & so your mileage may vary.
It’s a wrap (inc. feature edges)
There you have it, a no-leak volume mesh with crisp edges, but without endless hours of CAD clean-up 🎯
You might not need this right now, but I know from the survey that lots of you use snappyHexMesh
, so stash this away, it might come in handy one day.
Drop me a note if you give it a try.
Speaking of the survey, I’ll be back next week with the headlines 🤞
Until then, stay safe,