CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Problems with SnappyHexMesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 13, 2020, 18:57
Default Problems with SnappyHexMesh
  #1
New Member
 
Joaquin Moreno
Join Date: Oct 2020
Posts: 5
Rep Power: 6
joaquinmorenou is on a distinguished road
Hi , I'm meshing a cylinder in a flume that have a sandbox right below the cylinder and my problem is that when I use snappy some areas of the blockMesh mesh dissapear. In particular the 1st and the 2nd block. Right below i attached the blockMesh and SnappyHexMeshFile.


Hope you can help me

The cylinder stl : https://drive.google.com/file/d/1xei...ew?usp=sharing

Code:
FoamFile
{
    version     2.0;
    format     ascii;
    class     dictionary;
    object     blockMeshDict;
}



convertToMeters     1.0;

vertices
(
    (0 0 0.08) //0
    (0.8 0 0.08) //1
    (0.8 0.6 0.08) //2
    (0 0.6 0.08) //3
    (0 0 0.16) //4
    (0.8 0 0.16) //5
    (0.8 0.6 0.16) //6
    (0 0.6 0.16) //7
    (0.32 0.22 0) //8
    (0.48 0.22 0) //9
    (0.48 0.38 0) //10
    (0.32 0.38 0) //11
    (0.32 0.22 0.08) //12
    (0.48 0.22 0.08) //13
    (0.48 0.38 0.08) //14
    (0.32 0.38 0.08) //15
    (0 0.22 0.08) //16
    (0.8 0.22 0.08) //17
    (0 0.38 0.08) // 18
    (0.8 0.38 0.08) // 19
    (0.32 0.22 0.16) // 20
    (0.48 0.22 0.16) // 21
    (0.48 0.38 0.16) // 22
    (0.32 0.38 0.16) // 23
    (0 0.22 0.16) // 24
    (0.8 0.22 0.16) // 25
    (0.8 0.38 0.16) // 26
    (0 0.38 0.16) // 27
);

blocks
(
    hex (0 1 17 16 4 5 25 24)  (160 44  16) simpleGrading (1 1 1)
    hex (18 19 2 3 27 26 6 7) (160 44 16) simpleGrading (1 1 1)
    hex (16 12 15 18 24 20 23 27) (64 32 16) simpleGrading (1 1 1)
    hex (12 13 14 15 20 21 22 23) (32 32 16) simpleGrading (1 1 1)
    hex (13 17 19 14 21 25 26 22) (64 32 16) simpleGrading (1 1 1)
    hex (8 9 10 11 12 13 14 15) (32 32 16) simpleGrading (1 1 1)
);
 
edges
(
);

patches
(
    patch inlet
    (
        (0 4 24 16)
        (16 24 27 18)
    (18 27 7 3)
    )
    patch outlet
    (
        (1 17 25 5)
    (17 19 26 25)
    (19 2 6 26)
    )
    symmetryPlane surface
    (
        (4 5 25 24)
    (27 26 6 7)
    (24 20 23 27)
    (20 21 22 23)
    (21 25 26 22)
    )
    wall bottom
    (
        (0 1 17 16)
        (18 19 2 3)
        (16 12 15 18)
    (13 17 19 14)
    (8 9 10 11)
        (0 1 5 4)
    (8 9 13 12)
    (11 8 12 15)
    (9 10 14 13)
        (3 7 6 2)
    (11 15 14 10)
    )
);

mergPatchPairs
(
);
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;
snap            false;
addLayers       false; //pour ajouter des couches près des parois


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
    Cylinder.stl
    {
        type triSurfaceMesh;
        name cylinder;
    }
        surface1
    {
        type searchableBox;
        min (-1 -1    -0.1 );
        max (1   1     0.2);
    }
};


castellatedMeshControls
{

    maxLocalCells 1000000;


    maxGlobalCells 4000000;

    minRefinementCells 0;

    maxLoadUnbalance 0.10;

    nCellsBetweenLevels 3;

    features
    ();

    refinementSurfaces
    {
        cylinder
        {
            level (1 1);
        }
    }

    resolveFeatureAngle 30;

    refinementRegions
    {   
    }

    locationInMesh (0.300001 0.24 0.12);


    allowFreeStandingZoneFaces true;
}



snapControls
{
    nSmoothPatch 3;

    tolerance 2.0;

    nSolveIter 30;

    nRelaxIter 5;

}

addLayersControls
{
   relativeSizes false;

    layers
    {
        "(cylinder).*"
        {
            nSurfaceLayers 20;// nb de couches à ajouter prés des parois
        }
    }

    expansionRatio 1.19;
    finalLayerThickness 0.00002;
    minThickness 0.00000001;

    nGrow 0;


    featureAngle 60;

    nRelaxIter 5;

    nSmoothSurfaceNormals 1;

    nSmoothNormals 3;

    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;

    maxThicknessToMedialRatio 0.3;

    minMedianAxisAngle 90;


    nBufferCellsNoExtrude 0;


    nLayerIter 50;

}



meshQualityControls
{
    maxNonOrtho 65;

    maxBoundarySkewness 20;
    maxInternalSkewness 4;

    maxConcave 80;

    minVol 1e-13;

    minTetQuality 1e-30;

    minArea -1;

    minTwist 0.05;

    minDeterminant 0.001;

    minFaceWeight 0.05;

    minVolRatio 0.01;

    minTriangleTwist -1;


    nSmoothScale 4;
    errorReduction 0.75;
}



debug 0;


mergeTolerance 1e-6;


// ************************************************************************* //

Last edited by joaquinmorenou; October 13, 2020 at 19:01. Reason: Link missing
joaquinmorenou is offline   Reply With Quote

Old   October 16, 2020, 02:29
Default
  #2
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 12
Swift is on a distinguished road
Hi Joaquinmorenou,


Your mistake is in your blockMesh file. You need to build up the blockMesh shape using shared vertices to tell blockMesh that it is one shape. If you decide to do this, I estimate that you need 36 vertices and 10 blocks definitions.


The easier way of solving your problem is to make an stl shape of your geometry and put that into a bigger blockmesh cube with one block and run snappy.



Thomas


p.s. next time show images of the problem or upload a minimal case that the community can just run. This will help you get answers quicker. I had to make a case to test for you.
Swift is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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] Problems with sharp angles in snappyhexmesh Mathia1510 OpenFOAM Meshing & Mesh Conversion 0 March 1, 2020 08:30
[snappyHexMesh] Problems with coarse/unsnapped cells in snappyHexMesh scareneb OpenFOAM Meshing & Mesh Conversion 2 August 13, 2014 07:13
[snappyHexMesh] snappyHexMesh problems 1.5->1.6 grtabor OpenFOAM Meshing & Mesh Conversion 5 May 18, 2012 03:00
[snappyHexMesh] SnappyhexMesh and Symmetryplane bastil OpenFOAM Meshing & Mesh Conversion 10 October 7, 2008 17:07
[snappyHexMesh] SnappyHexMesh not generate mesh first time mavimo OpenFOAM Meshing & Mesh Conversion 4 August 26, 2008 07:08


All times are GMT -4. The time now is 10:48.