CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

SHM layer problem on inside mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2021, 18:04
Default SHM layer problem on inside mesh
  #1
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 288
Rep Power: 6
boffin5 is on a distinguished road
As part of debugging a multiRegion convergence problem, I am trying to improve the mesh. There are two regions, one of which is a heat exchanger. Its region is made by placing the point in mesh such that the outer domain is subtracted, leaving only the heat exchanger.


I am trying to create layers on the mesh, but when I activate layers in SHMDict, all I get is per the attached image, with no layers created. In the image showing a cross-section, the dimensions of the heat exchanger are 0.04 X 0.14 meters. I have a mesh enhancement box called 'refbox' specified; this box fully encloses the HX.


Here is the text of SHMDict:
Code:
castellatedMesh   true;
snap              true;
addLayers         true;

geometry
{
        rad
    {
        type triSurfaceMesh;
        file "radiator.stl";        
    }

    refbox
    {
        type triSurfaceMesh;
        file    "refbox.stl";
    }
       
    refinementBox
    {
        type searchableBox;
        min ( 2.1 -0.5 -0.1);
        max ( 2.3  0.5  0.1);
    }
};

// Settings for the castellatedMesh generation.

castellatedMeshControls
{

    maxLocalCells 2000000;

    maxGlobalCells 4000000;

    minRefinementCells 0;

    maxLoadUnbalance 0.10;

    nCellsBetweenLevels 1;    //5

    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    features
    (
        {
            file "radiator.eMesh";
            level 5;
        }
    );



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

    refinementSurfaces
    {
        rad
        {
            // Surface-wise min and max refinement level
            
            level (4 4);
            
            /*cellZone           solid;
            faceZone           solid;
            cellZoneInside    inside;*/
            
            radinlet      {level (4 4); patchInfo {type patch;}}
            radoutlet     {level (1 1); patchInfo {type patch;}}
            radwalltop    {level (1 1); patchInfo {type wall; }}
            radwallbottom {level (1 1); patchInfo {type wall; }}
            radwall-lh    {level (1 1); patchInfo {type wall; }}
            radwall-rh    {level (1 1); patchInfo {type wall; }}
        }
    }


    // Resolve sharp angles
    resolveFeatureAngle 30;
    

    // 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
    {
    
    refbox  
        {                
            mode inside;            //mode distance         
            levels ((1e15 5));      //levels ((0.02 4))
        }
        
    /*refinementBox
        {
            mode inside;
            levels ((1E15 5));
        }*/
    }

    locationInMesh (2.14 -0.20 0.11);

    allowFreeStandingZoneFaces no;
}

// Settings for the snapping.

snapControls
{
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 3;

    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 1.2;

    //- Number of mesh displacement relaxation iterations.
    nSolveIter 185;

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

    // Feature snapping

        //- Number of feature edge snapping iterations.
        //  Leave out altogether to disable.
        nFeatureSnapIter 5;

        //- Detect (geometric only) features by sampling the surface
        //  (default=false).
        implicitFeatureSnap false;

        //- Use castellatedMeshControls::features (default = true)
        explicitFeatureSnap true;

        //- Detect points on multiple surfaces (only for explicitFeatureSnap)
        multiRegionFeatureSnap false;
}

// Settings for the layer addition.
addLayersControls
{
    // 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
    layers
    {
        radinlet 
        {
            nSurfaceLayers  2;
        }        
        radoutlet
        {
            nSurfaceLayers  2;
         }
         radwalltop
        {
            nSurfaceLayers  2;
        }
         radwallbottom
        {
            nSurfaceLayers  2;
        }
         radwall-lh
        {
            nSurfaceLayers  2;
        }
         radwall-rh
        {
            nSurfaceLayers  2;
        }
     }

    // Expansion factor for layer mesh
    expansionRatio 1.1;

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

    // 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.0001;

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

    // Advanced settings

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

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

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

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

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

    // Angle used to pick up medial axis points
    // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
    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;
}
I thought the problem might have something to do with the mesh being inside, rather than outside the body. But I don't see a setting in SHMDict that pertains to that.


Might it be because I only have the radiator face patches in the layer settings, rather than a single volume? Although I don't specify a volume, the meshing proceeded okay, other than the inability create layers.



Any help resolving this problem will be greatly appreciated.
Attached Images
File Type: png radiator-mesh.png (36.1 KB, 8 views)
boffin5 is offline   Reply With Quote

Old   November 20, 2021, 07:26
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hi Alan,

I think your patch names are not properly defined. radinlet, radoutlet, etc are subregions of your rad geometry, and layers you be defined like this:

Code:
rad_radinlet 
{
    nSurfaceLayers  2;
}        
rad_radoutlet
{
    nSurfaceLayers  2;
}
rad_radwalltop
{
    nSurfaceLayers  2;
}
rad_radwallbottom
{
    nSurfaceLayers  2;
}
rad_radwall-lh
{
    nSurfaceLayers  2;
}
rad_radwall-rh
{
    nSurfaceLayers  2;
}
You can verify it by checking your snappyHexMesh log. You will see the patch names listed at the beginning of snappyHexMesh. I guess on your current setting you should probably also see something when snappy start the layer addition step.

Cheer,
Yann
Yann 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
SU2-7.0.1 on ubuntu 18.04 hyunko SU2 Installation 7 March 16, 2020 05:37
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 05:17
[snappyHexMesh] SHM doesn't create cellZones for one region Eko OpenFOAM Meshing & Mesh Conversion 10 January 24, 2018 03:03
[snappyHexMesh] SHM is not extruding/adding Layers everywhere matthiasd OpenFOAM Meshing & Mesh Conversion 2 October 16, 2016 17:45
[snappyHexMesh] Snapping problem, non orthogonal faces Zephiro88 OpenFOAM Meshing & Mesh Conversion 7 April 17, 2015 03:56


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