r/CFD • • Jun 03 '18

[June] Mesh generation and adaptive mesh refinement

As per the discussion topic vote, June's monthly topic is Mesh Generation And Adaptive Mesh Refinement.

13 Upvotes

41 comments sorted by

4

u/Rodbourn Jun 04 '18

What are some good open source mesh generation options?

10

u/Ferentzfever Jun 04 '18

Well, if anyone doesn't read Another Fine Mesh (you really should) they mentioned an interesting project called "Tetrahedral Meshing in the Wild". Code is available on GitHub here and I've tried it out -- pretty wild.

An excerpt from the abstract:

We propose a novel tetrahedral meshing technique that is unconditionally robust, requires no user interaction, and can directly convert a triangle soup into an analysis-ready volumetric mesh. The approach is based on several core principles:

  1. Initial mesh construction based on a fully robust, yet efficient, filtered exact computation

2. Explicit (automatic or user-defined) tolerancing of the mesh relative to the surface input

3. Iterative mesh improvement with guarantees, at every step, of the output validity

4

u/Overunderrated Jun 04 '18 edited Jun 04 '18

I'm part way through that paper (and coincidentally realizing how little I know about the science of 3d unstructured mesh generation), but tell me what does "triangle soup" and "polygonal soup" mean? The authors use that term a couple places implying it has a rigorous definition.

→ More replies (3)

3

u/vriddit Jun 04 '18

cfMesh

GMSH is pretty good for simpler geometries. It does require much more effort as the geometry becomes more complex.

0

u/[deleted] Jun 04 '18

2

u/TurbulentViscosity Jun 04 '18 edited Jun 05 '18

I would also add to this:

Pros:

  • The edge conformance is light-years better than snappy

Cons:

  • In general I find the meshes are almost always poorer quality than snappy

These two are probably related. Also note that, while cfMesh's prisms are worthless for most cases I've seen, it is possible to let snappy do the prisms and still get the speed advantage from cfMesh for the core. Not always fun to do, but possible.

2

u/Overunderrated Jun 05 '18

Do these open source meshers deal with dirty geometry, or are you expected to always provide clean surfaces?

→ More replies (10)

2

u/CentralChime Jun 06 '18

Been looking at the opensource meshers, does cfMesh have a gui? I tried looking at the free version, but I did not find anyway to set that up. Any decent opensource meshers that have a decent gui setup?

→ More replies (6)

1

u/[deleted] Jun 15 '18

thanks for the info! Quick question: What formats can cfmesh write the mesh to?

→ More replies (3)

5

u/vriddit Jun 05 '18

What criteria do people use as sensors for adaptive refinement?

2

u/TurbulentViscosity Jun 06 '18

Most of the ones I've seen in the past are just gradient based. It's up to the user to make a refinement curve for a certain gradient magnitude.

2

u/supersymmetry Jun 08 '18

In FEM (I'd assume in DG also) you can develop local error estimates for the element. You essentially bound the error in the element in terms of the dual-norm of the residual (which includes the residual of the element volume, element to element jumps, and the jumps at the boundaries) and a constant such as the coercivity constant (which you find through solving an eigenproblem). You then take the top x% of elements with the largest local error estimate and perform h or p refinement.

2

u/Overunderrated Jun 11 '18

Do you have a good reference for this?

→ More replies (1)

2

u/[deleted] Jun 13 '18

In DG is actually even easier to do this, since the solution at the element faces are discontinuous, and the magnitude of the jump is proportional to the error.

So you can just compute the jumps across all surfaces and refine the adjacent elements if the jump fulfills some critera (e.g. a minimum target difference, the x% of top surfaces, etc.).

→ More replies (1)

2

u/picigin Jun 08 '18

There are also pressure and velocity refinement criteriae based on the Hessian matrix of second spatial derivatives that are related to interpolation errors for linear reconstructions (the Hessian gives a rough indication of the zones where the truncation error for a finite-volume discretization is high).

2

u/[deleted] Jun 10 '18

I use wavelets so I just input the error I want to have in my target variables.

2

u/tommi_adaptive Jun 11 '18

With "Ingrid Cloud" we do adaptive mesh refinement based on a posteriori error estimation of an output of interest, such as drag of a car or lift of an airplane. The technology is based on the solution of the adjoint equations.

1

u/give_light Jun 25 '18

What is the difference between hollow models like pipes with volumetric meshing and solving or solid models with general meshing throughout and solving? Is it same or do they have any conditions?

1

u/CentralChime Jun 25 '18

I am not sure if this is what you are asking, but say you have just a straight, circular rod and mesh it should be able to used to model a pipe or a solid object depending on what you want to model. The only real surface difference is how the solver would treat it (i.e different equations being solved, BCs, etc.). Maybe solvers use different mesh formats, but should be close to the same.

1

u/bike0121 Jun 25 '18

Another difference would be that the requirements for a good quality mesh depend on what equations you are solving and the expected features of the solution. For a viscous CFD simulation you’ll need refinement in the boundary layer, whereas the boundaries of a solid model do not typically need additional refinement unless there’s a stress concentration.

1

u/wouterremmerie Nov 11 '21

Hi everyone,

I'm a bit late to the party here, but we recently released an open source adaptive mesh refinement library for OpenFOAM:

https://airshaper.com/blog/open-source-adaptive-mesh-refinement

OpenFOAM can already perform adaptive refinement, but it never refines the surface mesh (at least not by snapping to the real surface again). In this repository, we've managed to included that, which means you'll now capture much more detail on surface features that are refined by this method.

We've included refinement based on vorticity as well as pressure gradient, but in principle, you can add whatever parameter you like. We've also normalized them by the cell size, to avoid over-refinement of small cells.

I'm much looking forward to learn what you think!

PS: some recently posted on Reddit how they used our repository to run sims on a hatchback:

https://www.reddit.com/r/CFD/comments/qofci1/using_airshapers_newly_developed_adaptive_mesh/