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

[snappyHexMesh] Adding layers distorts internal mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes
  • 2 Post By AtoHM
  • 2 Post By Yann
  • 1 Post By Tobermory
  • 1 Post By Tobermory
  • 2 Post By Yann
  • 2 Post By Tobermory
  • 1 Post By Tobermory

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 6, 2023, 10:58
Default Adding layers distorts internal mesh
  #1
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
I am finding that if I add a thick layer on one of the domain boundaries, SHM makes a real mess of the mesh at the other surfaces, as it shrinks the internal mesh to make way for the layer. In the example below, the mesh at the top of the cube is stretched horribly. Is there any way to control this better (other than to use a thinner layer)? I couldn't see anything in the snappyHexMeshDict controls ... any suggestions would be welcomed.

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

castellatedMesh true;
snap            true;
addLayers       true;

geometry { 
    domain
    {
        type triSurfaceMesh;
        file "cube.stl";
        name cubeSTL;                     // name of this surf inside SHM
        regions {
            top    { name cube_top ;}     // STL patch name and final name of the patch
            sides  { name cube_sides ;}
            bottom { name cube_bottom ;}
        }
    }
};



castellatedMeshControls  {
    maxLocalCells 1000000;            //default 100000;
    maxGlobalCells 5000000;            //default 2000000;
    minRefinementCells 10;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 5;

    //feature edge refinement - eMesh read from constant/triSurface
    features (         
        { file "cube.eMesh"; level 1; }
    );

    //surface refinement
    refinementSurfaces {
        cubeSTL { 	level (1 1);
					regions {
						top { level (1 1);  patchinfo { type wall; } }
						sides { level (1 1);  patchinfo { type wall; } }
						bottom { level (1 1);  patchinfo { type wall; } }
					}
                }
    }
    resolveFeatureAngle 30;

    //volume refinement
    refinementRegions { 
    }
    
    //other mesh parameters
    locationInMesh (0 0 2);
    allowFreeStandingZoneFaces true;
}


snapControls {
    nSmoothPatch 3;
    tolerance 2.0;
    nSolveIter 30;
    nRelaxIter 5;
    nFeatureSnapIter 10;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;
}

addLayersControls {
    relativeSizes false;
    firstLayerThickness 0.02;
    thickness 0.2;
    layers {
        Zneg {nSurfaceLayers 5;}
     }

    minThickness 0.005;
    nGrow 0;
    featureAngle 160;
    slipFeatureAngle 30;
    nRelaxIter 5;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
    nRelaxedIter 20;
}

meshQualityControls {   #include "meshQualityDict" }
writeFlags ( scalarLevels    layerSets     layerFields );
mergeTolerance 1e-6;
Attached Images
File Type: jpg before layer addition.jpg (94.4 KB, 36 views)
File Type: jpg after layer addition.jpg (98.1 KB, 33 views)
Tobermory is offline   Reply With Quote

 


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
2 ways to mesh a multiRegion case - one works, the other fails boffin5 OpenFOAM Running, Solving & CFD 16 March 27, 2023 12:58
[snappyHexMesh] Holes in internal mesh when adding boundary layer snappyHex otaolafr OpenFOAM Meshing & Mesh Conversion 3 February 8, 2021 08:19
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 07:05
[snappyHexMesh] Adding layers goes wrong with SnappyHexMesh Elise OpenFOAM Meshing & Mesh Conversion 1 April 22, 2013 02:32
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


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