Fill out the form to download

Required field
Required field
Not a valid email address
Required field
Required field
  • Set up your own cloud-native simulation in minutes.

  • Documentation

    Background of Hex-dominant Meshing

    Overview of snappyHexMesh

    SnappyHexMesh, which the Hex-dominant meshing algorithm type is based on, is a mesh generation tool in the OPENFOAM® open-source software.

    This tool generates three-dimensional unstructured or hybrid meshes consisting of hexahedral (hex) and split-hexahedra (split-hex) elements. Besides the Standard automatic meshing tool, which generates a hybrid mesh of both tetrahedral (tet) and hexahedral elements, the SimScale platform also houses the snappyHexMesh meshing algorithm. The method iteratively performs the steps detailed below to obtain the final mesh.

    The advantage of working with hexahedral and split-hex elements using the Hex-dominant meshing method is that the elements can be subdivided to a very fine scale without losing too much mesh quality, thus improving potential simulation speed and accuracy. This is in contrast to working with tetrahedral elements, which can be more robustly automated to fit complex geometries, but may face more mesh quality issues for certain geometry features without additional manual refinement.

    Generally, a reference base mesh composed of hex cell elements is used to project and snap cells onto the geometry. Mesh refinements can flexibly be specified on edges, surfaces, and inside or outside volumes to obtain optimum geometry feature resolution and final mesh quality. Parallel computing is fully supported with load balancing at every iteration.

    Methodology of Hex-dominant Meshing

    The basic Hex-dominant methodology, using the snappyHexMesh algorithm, consists of 4 main steps:

    1. In the first step, the Castellated Mesh Step, the reference base mesh is created (with or without refinements) around the object.
    2. Next, the castellated mesh is snapped onto the object’s surface in the Snapping Step.
    3. If specified, mesh layers are generated on selected surfaces and adjusted to the main mesh in the Layer Addition Step.
    4. Finally, in the Mesh Quality Assessment Step, the final mesh is checked for illegal/bad cells and further iterations are performed until the quality standards are attained.

    These four steps are described and illustrated in brief detail below:

    Castellated Mesh Step

    In the castellated mesh step, the base mesh is created inside the bounds of the Base Mesh Box.

    The Base Mesh Box or the Background Mesh Box serves as the domain for the base mesh in the meshing process. This mesh purely contains hexahedral elements whose number is defined by the user. It is important to note that for any direction, the number of cells must be larger than 1, resulting in a 3-D mesh.

    In the following figure, an example of an external mesh around a vehicle body is used to explain the meshing process. The first image below shows the Base Mesh Box around the object.

    Background Mesh for the object in snappyHexMesh meshing process
    Figure 1: Base Mesh Box bounding the object

    The Base Mesh is then generated inside the entire space bounded by the Base Mesh Box, as shown in the figure below.

    Initial mesh generation in snappyHexMesh meshing process
    Figure 2: Base Mesh around and inside the object

    Cell Splitting:

    Before removing the mesh cells inside the body, this base mesh is then refined based on the specified edge and surface refinements and then split in the vicinity of the body surfaces.

    Cell splitting in snappyHexMesh meshing process
    Figure 3: Splitting of refined cells intersecting the surface of the object

    Cell Removal:

    After the mesh in the locality of the body is refined and split, cells are removed based on the specification of the material point (see the Hex-dominant Main Settings page for details).

    This requires at least one region to be bounded by a surface inside the domain. The mesh space where the material point is located is kept while cells are removed in the other space(s). So in this case, the material point can be anywhere in the space between the bounds of the base Mesh Box and the surface of the body.

    Cell removal in snappyHexMesh meshing process
    Figure 4: Cell removal process based on the material point

    Region refinements:

    Lastly, the mesh space is refined further based on the specified region refinements and the refinement level (detailed in Main Settings Region refinements). After this, the castellated mesh looks similar to the one shown below.

    Region refinement in  snappyHexMesh meshing process
    Figure 5: Region refinement for the volume mesh around the object

    Snapping Step

    The next step in the snappyHexMesh algorithm is snapping or projecting the castellated mesh (staircase-type mesh) to the object surface. This process is accomplished by the following algorithm:

    • Displacing the cell vertices of the castellated mesh onto the object’s surface.
    • Then, relaxing the internal mesh due to the displaced vertices.
    • Checking for any bad cells that violate the mesh quality parameters.
    • Re-iterate the process until the quality standards are achieved.

    The internal mesh after the snapping process is depicted in the figure below:

    Surface snapping in snappyHexMesh meshing process
    Figure 6: Snapping of the cells onto the surface of the object

    Layer Addition

    Depending upon the mesh setting specifications, a layered mesh consisting of hexahedral cells that are aligned to the surface may be generated on selected or all surfaces.

    This process is also done iteratively and involves a number of steps to generate the required mesh. Here only the methodology is discussed, while the settings are further detailed in Main Settings > Layer Refinements.

    The main steps are highlighted as follows:

    • The internal snapped mesh is pushed back from the object’s surface in the normal direction by the specified distance (Thickness value).
    • The internal mesh is then relaxed and checked to satisfy the quality parameters, otherwise, the thickness is reduced.
    • If the quality criterion is satisfied then layers are inserted. If not then, the previous steps are repeated.
    • If there is no possibility of achieving the required quality standards, the layers are not inserted.
    Layer addition in the snappyHexMesh meshing process
    Figure 7: Addition of layers aligned to the object’s selected surface

    Mesh Quality Assessment

    As a final step, the mesh is checked for quality criterion and the meshing process looped until all checks are passed or the overall iteration limit is reached.

    In the case of reaching the iteration limit with failed checks, the resulting mesh might contain bad elements or cells.

    Become a SimScale member!

    Try out SimScale’s hex-dominant mesher today! Join SimScale today and experience cloud-based simulation within minutes!


    Last updated: August 11th, 2023