CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: snappyHexMesh and Others (
-   -   keyword nGrow undefined in "...snappyHexMeshDict.addLayersControls" (

rama13 April 11, 2013 09:36

keyword nGrow undefined in "...snappyHexMeshDict.addLayersControls"
1 Attachment(s)
Hi all OpenFOAMers,

I'm using snappyHexMesh (OF v.2.2).
Unfortunately the process breaks down with the following error:


keyword nGrow is undefined in dictionary "/home/damiano/openfoamcourse/spillway/system/snappyHexMeshDict.addLayersControls"

file: /home/damiano/openfoamcourse/spillway/system/snappyHexMeshDict.addLayersControls from line 201 to line 271.

    From function dictionary::lookupEntry(const word&, bool, bool) const
    in file db/dictionary/dictionary.C at line 402.

FOAM exiting

even if I specify keyword nGrow in my snappyHexMeshDict:

// Settings for the layer addition.
    // Are the thickness parameters below relative to the undistorted
    // size of the refined cell outside layer (true) or absolute sizes (false).
    relativeSizes true;

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

    // Expansion factor for layer mesh
    expansionRatio 1.3; //1.0;

    // 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.
    // is the thickness of the layer furthest away from the wall.
    // See relativeSizes parameter.
    finalLayerThickness 0.7; //0.3;

    // 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.
    // See relativeSizes parameter.
    minThickness 0.25 //0.1;

    // 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.
    // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
    nGrow 1;

    // Advanced settings

    // When not to extrude surface. 0 is flat surface, 90 is when two faces
    // are perpendicular
    featureAngle 60;

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

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

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

    // Smooth layer thickness over surface patches
    nSmoothThickness 10;

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

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

    // Angle used to pick up medial axis points
    // Note: changed(corrected) w.r.t 16x! 90 degrees corresponds to 130 in 16x.
    minMedianAxisAngle 90;

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

    // Overall max number of layer addition iterations. The mesher will exit
    // if it reaches this number of iterations; possibly with an illegal
    // mesh.
    nLayerIter 50;

Please find the whole snappyHexMeshDict in attachment.
Any ideas?!

Thanks for your attention,

hakonbar April 15, 2013 08:26

Errors like this are usually due to there being brackets out of place in the dictionary. In this case there seems to be one on line 54 that shouldn't be there. Try removing it, and run snappyHexMesh again.

rama13 April 16, 2013 10:06

Hi Håkon

first of all I would like to thank you.
Then I was able to solve the problem by deleting the file and modifying another one from probably you were right, it was just a matter of misplaced brackets or smth like that!

All the bests

All times are GMT -4. The time now is 20:00.