CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] How to generate Layers at the corner

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 6, 2019, 11:17
Default How to generate Layers at the corner
  #1
New Member
 
amin
Join Date: Jun 2015
Posts: 5
Rep Power: 10
amin.nbkh is on a distinguished road
Dear Foamers,


I've been trying for quite some time to generate a decent Mesh in a wind tunnel using helyxHexMesh (Engys version) and snappyHexMesh but the problem is that they both fail to grow layers at the corners of the duct (Image attached).
I tried with many modifications and different parameters (including featureAngle= 180 which Engys suggested for such cases) but non of them worked.
My ultimate goal is to bound y+ between 30 to 300 but the coarse grid at the corner is causing trouble particularly through the nozzle (flow of high velocity).
Is there any chance to improve it using snappy/helyxHM ?


Any Help would be highly appreciated.


Code:



/*--------------------------------*- C++ -*----------------------------------*\
|       o          |                                                          |
|    o     o       | OpenFOAM (Engys Edition):                                |
|   o   O   o      | Version: 2.1_engysEdition-1.0                            |
|    o     o       | Web:     http://www.engys.com                            |
|       o          |                                                          |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;

debug 1;

snap            true;

addLayers       true;

autoBlockMesh   false;

crackDetection  false;

geometry
{
    inlet.stl
    {
        type            triSurfaceMesh;
        name            inlet;
    }

    outlet.stl
    {
        type            triSurfaceMesh;

        name            outlet;
    }

    walls.stl
    {
        type            triSurfaceMesh;
        name            walls;
    }

}

castellatedMeshControls
{
    features
    (
        {
        file    "walls.eMesh";
        level  4;
        refineFeatureEdgeOnly   false;
        }
    );

    nCellsBetweenLevels 3;
    refinementSurfaces
    {
        walls
        {

          level           (4  6);
          refineSurfaceBoundary true;
          featureRefineAngle 20;
        }

        inlet
        {
                level           (0  0);
                patchInfo
                {
                        type    patch;
                }
        }

        outlet
        {
                level           (0  0);
                patchInfo
                {
                        type    patch;
                }
        }
    }

    refinementRegions
    {

        walls
        {
                 mode            distance;
                 levels          ( ( 0.015 4 ) );
        }

     }

    locationInMesh ( 0.0  0.0  0.0 );
    maxLocalCells   100000000;
    maxGlobalCells  1000000000;
    minRefinementCells 100;
    maxLoadUnbalance 0.1;
    resolveFeatureAngle -60;
    featureRefineAngle 20;
    refineSurfaceBoundary true;
    allowFreeStandingZoneFaces false;
    balanceThenRefine true;
    nGapRefinements 0;
    minZoneRegionSize 0;

}

snapControls
{
    featureEdges
    {
    }
    nOuterIter      2;
    nPreFeatureIter 0;
    nSolveIter      10;
    nFeatureIter    50;
    globalFeatureEdges true;
    globalRegionSnap false;
    nSmoothPatch    2;
    tolerance       4;
    nRelaxIter      5;
    zoneFeatureSnapping true;
    directFeatureSnapping true;
    regionFeatureLines false;
    geometryFeatureLines true;
    snapSurfBoundary true;
//    collapseTol     0.25;
}

addLayersControls
{
    layers
    {
         "walls.*"
        {
            nSurfaceLayers  8;
            fch             0.001;
            expansionRatio 1.1;
        }

    }


    relativeSizes true;
    expansionRatio 1.2;
    finalLayerThickness 0.8;



    //- 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.2;
    nGrow 0;

     // Advanced settings

    featureAngle 180;

    //- What feature angle to try merge two faces
//    featureAngleMerge 45;

    // Terminate layers at feature edges specified with this angle (0 to disable)
    featureAngleTerminate 180;

    // At non-patched sides allow mesh to slip if extrusion direction makes
    // angle larger than slipFeatureAngle.
    slipFeatureAngle 30;

    //- 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 2.0;

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

    // Angle used to pick up medial axis points
    //minMedialAxisAngle 90;
    minMedianAxisAngle 90;

    // Maximum number of layer generation iterations
    maxLayerIter  30;

    // Try and grow around convex edges
    growConvexEdge true;

    // Try and grow around concave edges
    growConcaveEdge true;

    // Try to grow layers up non grown planar surfaces (inlets, symmetry etc)
    growUpPatches true;

    // Whether to re-balance based on predicted number of layer cells
    preBalance false;

    // Where layers collapse recover layers by this increment
    layerRecovery 1;

    nBufferCellsNoExtrude 0;
    nLayerIter 50;

}

meshQualityControls
{
    maxNonOrtho     65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave      80;
    minFlatness     0.5;
    minVol          1e-14;
    minTetQuality   -1e+30;
    minArea         1e-13;
    minTwist        0.05;
    minDeterminant  0.0001;
    minFaceWeight   0.08;
    minVolRatio     0.025;
    minTriangleTwist -0.99;
    nSmoothScale    10;
    errorReduction  0.75;
}

debug           0;

mergeTolerance  1e-06;


// ************************************************************************* //
Attached Images
File Type: png Screenshot from 2019-08-26 22-26-52.png (39.2 KB, 150 views)
File Type: png Screenshot from 2019-08-26 22-28-08.png (13.2 KB, 100 views)
File Type: png Screenshot from 2019-08-26 22-29-27.png (26.5 KB, 92 views)
amin.nbkh is offline   Reply With Quote

Old   September 8, 2019, 06:43
Default
  #2
New Member
 
Adam
Join Date: Jan 2019
Posts: 21
Rep Power: 7
boundary93 is on a distinguished road
Change the featureAngle in snappyHexMesh to a value higher than 90
boundary93 is offline   Reply With Quote

Old   September 9, 2019, 02:03
Default
  #3
Member
 
Damian Berghof
Join Date: May 2019
Posts: 41
Rep Power: 10
virengos will become famous soon enough
Hi Amin,
snappyHexMesh is really a good Mesher, but the learning curve is steep. You could also mesh this simple geometry with the Salome Meca Software in just 1 run and within seconds. Let me know if you need some support to do it!
best,
Damian
__________________
Get more support about Meshing with Salome and Visualization with ParaView in my growing groups
https://bit.ly/2lFfDkQ
https://bit.ly/2k2u8Pj
virengos is offline   Reply With Quote

Old   June 22, 2023, 10:46
Default
  #4
New Member
 
Ali Berk Kahraman
Join Date: Dec 2015
Location: Braunschweig, Germany
Posts: 13
Rep Power: 10
abkahraman is on a distinguished road
Hi Amin,


Were you able to figure this out? I am having the same problem and there seems to be no obvious answer online.
abkahraman is offline   Reply With Quote

Reply

Tags
layer addition, snappyhexmesh 3d


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] addLayersControls does not generate boundary layers rinaldialberto OpenFOAM Meshing & Mesh Conversion 2 July 12, 2018 11:22
[snappyHexMesh] Problem with prism layers at corner edges Fauster OpenFOAM Meshing & Mesh Conversion 1 September 30, 2016 00:25
[snappyHexMesh] SnappyHexMesh: can not generate Layers Qianchaoqun OpenFOAM Meshing & Mesh Conversion 0 August 10, 2016 03:17
Prism Layers in the corner bengy STAR-CCM+ 19 August 1, 2016 06:46
[snappyHexMesh] snappyHexMesh layers at the corner missing wc34071209 OpenFOAM Meshing & Mesh Conversion 3 February 12, 2014 11:32


All times are GMT -4. The time now is 07:15.