GMSH: Mesh Refinement Using Mesh Size Field

GMSH: Mesh Refinement Using Mesh Size Field

GMSH is a powerful open-source software offering advanced mesh generation capabilities, used for various applications such as computational fluid dynamics. One of its features is the ability to refine the mesh using a mesh size field.

A mesh size field defines the target size for mesh elements in a specific region or along a particular boundary of the model. This allows the user to control the mesh density and accuracy in specific areas where more resolution is needed, such as near boundaries, singularities, or regions of high gradients.

The mesh size field can be defined in several ways:

  • Distance and Threshold: the Distance field specifies the mesh size according to the distance to some model entities. For example, to obtain mesh elements with size lc/30, near curve 2 and point 5, and size lc elsewhere, a Distance field should be defined on points 5 and curve 2. This field returns the distance to point 5 and to curve 2. Then a Threshold field is defined, which uses the return value of the Distance field to define a simple change in element size depending on the computed distances.
  • MathEval field: specifies the mesh size using an explicit mathematical function.
  • Box field: specifies the size of the elements inside and outside of a parallelepipedic region.
  • PostView field: specifies an explicit background mesh in the form of a scalar post-processing view.

More details are available in the Gmsh Reference Manual.

Figure 1 illustrates the mesh size fields: Distance, Threshold, MathEval, and Box. The implementation in Gmsh is available in t10.geo, C++ (t10.cpp), Python (t10.py), Julia (t10.jl) and Fortran (t10.f90).

Aucun texte alternatif pour cette image
Figure 1: Mesh size field illustration

Mesh refinement using a mesh size field is a powerful tool in GMSH for controlling the accuracy and efficiency of simulations. It allows the user to target the mesh density where needed, resulting in more accurate solutions without sacrificing computational resources.

Julio Mendez

CFD Scientist and High Performance Computing Specialist.

1y

My only complain with GMESH is that it does not have prism layer capabilities.

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics