OpenFOAM® v1806: Notable bug-fixes

29/06/2018

snappyHexMesh layer feature angle

This is a pure bug fix and not a feature extension. It might affect your snappyHexMesh meshes. In v1712 and earlier the featureAngle setting in the layer controls section of the snappyHexMeshDict

// Settings for the layer addition.
addLayersControls
{
    // When not to extrude surface. 0 is flat surface,
    // 90 is when two faces are perpendicular. Note that this
    // is the angle of the mesh surface (so after snapping) and not
    // the original geometry.
    featureAngle 130;
}

was not interpreted correctly (it was missing a degrees-to-radians conversion). Consequently in v1712 any setting greater than 60 degrees would disable all layer extrusion.

In below figures the effect (in v1806) of two feature angles is shown:

  • 45 degrees i.e. disabling all extrusion in sharp angles
  • 130 degrees, i.e. allowing extrusion in sharp angles)

[Picture]

[Picture]

Note: some default values of parameters are calculated from above featureAngle setting. These parameters are:

// When to merge patch faces. Default is featureAngle
//mergePatchFacesAngle 45;

// Do not extrude around sharp edge if not both faces are extruded.
// Default is 0.5*featureAngle. Set to -180 always attempt extrusion
//layerTerminationAngle -180;

// Optional: at non-patched sides allow mesh to slip if extrusion
// direction makes angle larger than slipFeatureAngle. Default is
// 0.5*featureAngle.
//slipFeatureAngle 30;

Hence if you change the featureAngle parameter in v1806 and would like to get exactly the same behaviour as v1712 you need to adjust these settings correspondingly. Expressed as a conversion table:

featureAngle v1712 featureAngle v1806 mergePatchFaces layerTermination slipFeature
0 0 0 0 0
30 58.4 30 15 15
45 38.3 45 22.5 22.5
60 180 60 30 30
75 180 75 37.5 37.5
90 180 90 45 45
120 180 120 60 60
130 180 130 65 65

Source code
$FOAM_UTILITIES/mesh/generation/snappyHexMesh
Examples
$FOAM_TUTORIALS/mesh/snappyHexMesh/addLayersToFaceZone