OpenFOAM® v1606+: New Meshing Functionality


snappyHexMesh refinement and unrefinement

snappyHexMesh has been extended to optionally not merge co-planar patch faces. This means that all cells will remain hexes or split-hexes and hence are more likely to be refined during dynamic refinement. Note that only refinement added by the dynamic refinement can be undone; it is not possible to undo the refinement added by snappyHexMesh. A new switch in snappyHexMeshDict controls whether or not to merge co-planar faces:

// Optional: avoid patch-face merging. Allows mesh to be used for
//           refinement/unrefinement
mergePatchFaces off; // default on
To apply this functionality, users should:
  • Generate A volumetric mesh using snappyHexMesh using the above settings
  • Use the dynamicMeshDict to specify the scalar field to drive the (un)refinement
  • Ensure that the maximum (and minimum) refinement levels no higher (or lower) than the levels employed for the initial mesh generation

motorBike: combination of snappyHexMesh followed by refinement/unrefinement

snappyHexMesh locations in mesh

The previous release v3.0+ offered initial support for specifying cellZones independently of the geometry. This involves the use of the keyword locationsInMesh instead of locationInMesh to specify both a location and a corresponding cellZone and results in all cells reachable from the location to be assigned to the cellZone. In this release this functionality has been completely rewritten to fix various problems with the initial implementation.


Two abutting cellZones (red and blue) are defined by singly providing two locations in mesh. This automatically constructs faceZones for the outside of the cellZones e.g. shown in green is the faceZone defined between the two cellZones.

snappyHexMesh improved support for layer generation

In version v3.0+ snappyHexMesh added support for layers on faceZones. In this version this has been extended to allow layers on complex configurations, e.g. crossing faceZones. The following image for a straight block mesh is coloured by processor index.


Here, layers are added to top and bottom and to two faceZones that both cross processor boundaries and each other.


Note that snappyHexMesh has automatically re-distributed the resulting mesh to keep a good load balance.

Automatic gap detection

The previous version introduced the optional automatic detection and refinement of close surface features. On complex cases this would spend large amounts of time refining small numbers of cells. In this release this functionality has been extended to switch to a bulk refinement mode beforehand, thus drastically speeding up this phase of snappyHexMesh.