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

[snappyHexMesh] Weird 90° corners after castellatedMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2024, 20:35
Default Weird 90° corners after castellatedMesh
  #1
New Member
 
Jahir Bahena
Join Date: Feb 2024
Location: Mexico
Posts: 6
Rep Power: 2
Jahir is on a distinguished road
Hello.

This is my first post in this forum (lurking for a couple of months) and I hope it's not something trivial.

I'm working with an internal mesh using blockMesh + snappyHexMesh (I just started using sHM) and after some reading I've reached a decent mesh (at least after using castellatedMesh). What's worrying me is that there's a wierd corner on a fairly simple part of my geometry which I believe shouldn't have much problem. This is my sHMDict:



Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2312                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;
snap            false;
addLayers       false;


// 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
{
    inlet.stl
    {
        type triSurfaceMesh;
        name inlet;
    }
    outlet.stl
    {
        type triSurfaceMesh;
        name outlet;
    }
    atmosphere.stl
    {
        type triSurfaceMesh;
        name atmosphere;
    }
    walls1.stl
    {
        type triSurfaceMesh;
        name walls1;
    }
    walls2.stl
    {
        type triSurfaceMesh;
        name walls2;
    }
/*
    refinementBox
    {
        type box;
        min  (-1.0 -0.7 0.0);
        max  ( 8.0  0.7 2.5);
    }
*/
}

// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~

    // If local number of cells is >= maxLocalCells on any processor
    // switches from from refinement followed by balancing
    // (current method) to (weighted) balancing before refinement.
    maxLocalCells 10000000;

    // Overall cell limit (approximately). Refinement will stop immediately
    // upon reaching this number so a refinement level might not complete.
    // Note that this is the number of cells before removing the part which
    // is not 'visible' from the keepPoint. The final number of cells might
    // actually be a lot less.
    maxGlobalCells 20000000;

    // The surface refinement loop might spend lots of iterations refining just a
    // few cells. This setting will cause refinement to stop if <= minimumRefine
    // are selected for refinement. Note: it will at least do one iteration
    // (unless the number of cells to refine is 0)
    minRefinementCells 5;

    // Allow a certain level of imbalance during refining
    // (since balancing is quite expensive)
    // Expressed as fraction of perfect balance (= overall number of cells /
    // nProcs). 0=balance always.
    maxLoadUnbalance 0.10;


    // Number of buffer layers between different levels.
    // 1 means normal 2:1 refinement restriction, larger means slower
    // refinement.
    nCellsBetweenLevels 1;



    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies a level for any cell intersected by its edges.
    // This is a featureEdgeMesh, read from constant/triSurface for now.
    features
    (
        /*{
            file "tanque.eMesh";
            level 6;
        }*/
    );



    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies two levels for every surface. The first is the minimum level,
    // every cell intersecting a surface gets refined up to the minimum level.
    // The second level is the maximum level. Cells that 'see' multiple
    // intersections where the intersections make an
    // angle > resolveFeatureAngle get refined up to the maximum level.

    refinementSurfaces
    {
        inlet
        {
            // Surface-wise min and max refinement level
            level (0 0);
            patchInfo
            {
                type patch;
            }
        }
        outlet
        {
            // Surface-wise min and max refinement level
            level (0 0);
            patchInfo
            {
                type patch;
            }
        }
        atmosphere
        {
            // Surface-wise min and max refinement level
            level (0 0);
            patchInfo
            {
                type patch;
            }
        }
        walls1
        {
            // Surface-wise min and max refinement level
            level (0 0);
        }
        walls2
        {
            // Surface-wise min and max refinement level
            level (1 1);
        }
    }

    // Resolve sharp angles
    resolveFeatureAngle 5;


    // Region-wise refinement
    // ~~~~~~~~~~~~~~~~~~~~~~

    // Specifies refinement level for cells in relation to a surface. One of
    // three modes
    // - distance. 'levels' specifies per distance to the surface the
    //   wanted refinement level. The distances need to be specified in
    //   descending order.
    // - inside. 'levels' is only one entry and only the level is used. All
    //   cells inside the surface get refined up to the level. The surface
    //   needs to be closed for this to be possible.
    // - outside. Same but cells outside.

    refinementRegions
    {
        /*tanque.stl
        {
            mode inside;
            levels ((0 2));
        }*/
    }


    // Mesh selection
    // ~~~~~~~~~~~~~~

    // After refinement patches get added for all refinementSurfaces and
    // all cells intersecting the surfaces get put into these patches. The
    // section reachable from the locationInMesh is kept.
    // NOTE: This point should never be on a face, always inside a cell, even
    // after refinement.
    locationInMesh (1 1 1);


    // Whether any faceZones (as specified in the refinementSurfaces)
    // are only on the boundary of corresponding cellZones or also allow
    // free-standing zone faces. Not used if there are no faceZones.
    allowFreeStandingZoneFaces true;
}
The boundary walls2 is the floor which is being refined nicely for most of the geometry. walls1 contain the vertical and top walls and a bottom wall that I don't need to refine. I've used (0 1) refinement for walls1 but I just need the bottom cells refined. I've also tried many different resolveFeatureAngle values with no succes.

After moving up to the next step, what would be your advice to have a nice refinement?


EDIT: Turned out to be something trivial, the gap was formed because the element size 0 was larger than the length of that part of the geometry.
Attached Images
File Type: png orig_geom.png (20.3 KB, 9 views)
File Type: jpg snappy_wierd_corner.jpg (176.2 KB, 8 views)

Last edited by Jahir; February 23, 2024 at 22:06.
Jahir is offline   Reply With Quote

Reply


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] Layer coverage at 98% with collapses at corners oryx OpenFOAM Meshing & Mesh Conversion 1 December 4, 2023 19:04
[snappyHexMesh] Inflation Layers stop at the corners James_mCFD OpenFOAM Meshing & Mesh Conversion 3 December 4, 2023 07:42
[snappyHexMesh] Snapping problem on cells in corners (intersections between stl surfaces) finzeo OpenFOAM Meshing & Mesh Conversion 5 September 18, 2023 10:38
T-junktion - problem at corners Martinch FLUENT 0 February 16, 2021 16:28
[ICEM] Skewed elements at sharp corners Julian121 ANSYS Meshing & Geometry 3 January 11, 2019 03:55


All times are GMT -4. The time now is 12:49.