CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: snappyHexMesh and Others (
-   -   SnappyHexMesh doesn't succeed in adding several layers (

eti0123456789 May 2, 2010 13:24

SnappyHexMesh doesn't succeed in adding several layers
1 Attachment(s)

I am using SnappyHexMesh with OF 1.6 to study a simple 2D wing. In order to use SnappyHexMesh, it is in fact a 3D case with a thin "wind tunnel". But SnappyHexMesh doesn't succeed in adding several layers in the boundary layer, it only creates one :
I tried to reduce constraints on mesh quality but this doesn't work.

Here is the addLayerControls :

relativeSizes true;

// Per final patch (so not geometry!) the layer information
nSurfaceLayers 10;

// Expansion factor for layer mesh
expansionRatio 2;

//- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
finalLayerThickness 0.5;

//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
minThickness 0.00000001;

//- If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
nGrow 10;

// Advanced settings

//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.
featureAngle 0;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 10;

// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 5;

// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 15;

// Smooth layer thickness over surface patches
nSmoothThickness 20;

// Stop layer growth on highly warped cells
maxFaceThicknessRatio 1000000000;

// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 10000000;

// Angle used to pick up medial axis points
minMedianAxisAngle 130;

// Create buffer region for new layer terminations
nBufferCellsNoExtrude 10;

// Overall max number of layer addition iterations
nLayerIter 50;
Can someone help me ?

Mo-ITB May 4, 2010 04:21


did you try to decrease the expansionratio and the finallayerthickness?
im having quite similar problems at the moment, if you find some good ideas,let us know :).

eti0123456789 May 15, 2010 09:41

I have found an idea, and that works quite well : firstly, I use SHM to make a thick layer, and then, I write a little bash script which uses the refineWallLayer tool to split the boundary layer. Here is the script :

for i in `seq 1 5`;
        refineWallLayer -overwrite name_of_the_patch 0.7;

But if anybody knows how to solve this problem using directly SHM, please help !

Mo-ITB May 18, 2010 11:00

hi eti,
thanks for your idea, i tried it and it really split my layers. but is it possible that we just run over the internal quality check of snappy?
if i run checkMesh after the layer refinement, it gives me some skew errors...
this is the same as when i use a mesh made by star-ccm+ and convert it to openfoam. it looks nice but does not pass the quality check.

eti, could you tell me which low-reynolds-model you use? i use LamBremhorst, but i have problems with high velocity on some spots, before the laminar layer can build up..

eti0123456789 May 18, 2010 13:05


I had also this problem of mesh quality, and to avoid that, the only solution I have found is to get the mesh refined near the surface and to reduce the number of "cuttings" with refineWallLayer so that the cells look better. There is also another thing which has effects, but I don't understand why : when I put the parameter "nSmoothThickness" to 0 in the SHMDict, the mesh is more likely to pass checkMesh.

For the turbulence model, up to now I have only used a k-omega SST model, and it seems to work well.

s.m April 9, 2013 02:36

hi eti,
would you please explain your text?
e.g. where should we add this text?
thank you very much.

All times are GMT -4. The time now is 17:45.