The open source CFD toolbox
snappyHexMesh

# Overview

snappyHexMesh is a fully parallel, split hex, mesh generator that guarantees a minimum mesh quality. Controlled using OpenFOAM dictionaries, it is particularly well suited to batch driven operation.

Key features:

• starts from any pure hex mesh (structured or unstructured)
• reads geometry in triangulated formats, e.g. in stl, obj, vtk
• no limit on the number of input surfaces
• can use simple analytically-defined geometry, e.g. box, sphere, cone
• generates prismatic layers
• scales well when meshing in parallel
• can work with dirty surfaces, i.e. non-watertight surfaces

# Operation

The overall meshing process is summarised by the figure below:

snappyHexMesh overview

This includes:

• creation of the background mesh using the blockMesh utility (or any other hexahedral mesh generator)
• extraction of features on the surfaces with surfaceFeatureExtract utility
• setting up the snappyHexMeshDict input dictionary
• running snappyHexMesh in serial or parallel

Evolution of the snappy mesh for the iglooWithFridges tutorial is shown below:

# Configuration

Meshing controls are set in the snappyHexMeshDict located in the case system directory. This has five main sections, described in the following sections:

• geometry: specification of the input surfaces
• castellatedMeshControls: starting from any pure hex mesh, refine and optionally load balance when running in parallel. The refinement is specified both according to surfaces, volumes and gaps
• snapControls: guaranteed mesh quality whilst morphing to geometric surfaces and features
• addLayersControls: prismatic layers are inserted by shrinking an existing mesh and creating an infill, subject to the same mesh quality constraints
• meshQualityControls: mesh quality settings enforced during the snapping and layer addition phases