snappyHexMesh

This section describes the mesh generation utility, snappyHexMesh, supplied with OpenFOAM. The snappyHexMesh utility generates 3-dimensional meshes containing hexahedra (hex) and split-hexahedra (split-hex) automatically from triangulated surface geometries in Stereolithography (STL) format. The mesh approximately conforms to the surface by iteratively refining a starting mesh and morphing the resulting split-hex mesh to the surface. An optional phase will shrink back the resulting mesh and insert cell layers. The specification of mesh refinement level is very flexible and the surface handling is robust with a pre-specified final mesh quality. It runs in parallel with a load balancing step every iteration.

The mesh generation process using the snappyHexMesh utility can be divided in 4 steps.

1

Background mesh

Before snappyHexMesh is executed, a background mesh of hexahedral cells that fills the entire flow domain must be created. This can be done simply using the blockMesh utility or other external mesh generators.

snappyHexMesh / background mesh

The cell aspect ratio should be approximately 1, at least near surfaces at which the subsequent snapping procedure is applied.

2

Cell splitting and cell removal

Cell splitting is performed according to refinement levels for regions, surfaces and feature edges supplied by the user.

snappyHexMesh / cell splitting and cell removal

Cell removal requires one or more regions enclosed entirely by a bounding surface. The region in which cells are retained are simply identified by a location point within that region. Cells are retained if, approximately speaking, 50% or more of their volume lies within the region. The remaining cells are removed accordingly.

3

Snapping to surfaces

The next step involves moving cell vertex points onto surface geometry to remove the jagged castellated surface from the mesh.

snappyHexMesh / snapping to surfaces

4

Mesh layers

An optional stage which introduces layers of hexahedral cells aligned to the boundary surface can be added. The process of mesh layer addition involves shrinking the existing mesh from the boundary and inserting layers of cells.

snappyHexMesh / mesh layers

Obviously at the end of the whole meshing process, mesh quality checks for each stage will be performed.

 

A presentation made during the 7th OpenFOAM® Workshop in Darmstadt shows the various stages of the meshing process and explains in details parameters of the snappyHexMeshDict dictionary. Grid examples generated with the snappyHexMesh utility are shown in the main menu Applications.