snappyHexMesh addLayer extrudes nearby patches
Hello, I have been trying to use the addLayer function in my external flow studies. At the moment, I don't have very good control of layer generation near feature edges. So instead of generating layers on all walls, I find that only having layers on bottom surfaces is pretty easy to be done (which means generated layers do not run into each other).
Now I am trying to extend the usage of layer generation in my studies - I would like to use layers on the elevated horizontal surfaces. If you look at the image below, I meshed a box sitting in the domain with layers on the ground and top patch of the box. The box sides and top are created as two different boundaries.
One issue I found is that the layer generation on the top patch of the box extruded the side patches (green lines). Is this behavior intended? Or is there a way to avoid the side patches to be extruded?
My add layer dictionary looks like this:
addLayersControls
{
relativeSizes yes;
thicknessModel firstAndRelativeFinal;
firstLayerThickness 0.10;
finalLayerThickness 0.80;
minThickness 0.1; //Minimum overall thickness of all layers, below which surface is not extruded
nGrow 0; //Close to the features and patches where the layers are not grown, the layer growth can be delayed.
// Value gives number of layers of cells where point extrusion is cancelled. With default value 0 points are extruded directly next to the feature.
featureAngle 160; //Angle above which surface is not extruded
nSmoothSurfaceNormals 3; //Number of smoothing iterations of surface normals
nSmoothThickness 10; //Smooth layer thickness over surface patches
minMedialAxisAngle 90; //Angle used to pick up medial axis points
nSmoothNormals 5; //Number of smoothing iterations of interior mesh movement direction
nBufferCellsNoExtrude 3; //Create buffer region for new layer terminations, i.e. gradually step down number of layers. Set to less than 0 to terminate layer in one go
nLayerIter 30; //Overall max number of layer addition iterations
nRelaxIter 5;
nRelaxedIter 20; //Number of relaxation steps (where relaxed mesh quality parameters are used)
mergePatchFacesAngle 130; //Merging multiple faces into one big face generally helps with layer addition.
//Default
maxFaceThicknessRatio 0.5; //Face thickness ratio above which surface is not extruded, useful for warped cells
maxThicknessToMedialRatio 0.3; //Will reduce the layer growth where ratio of thickness to medial distance is large (typically in narrow cavities)
slipFeatureAngle 30; //Allow the sliding of points on the patch without the layer grown if angle to the patch extrusion direction is larger.
layerTerminationAngle -180; // Do not extrude around sharp edge if not both faces are extruded. Set to -180 always attempt extrusion
layers
{
g-inner
{
nSurfaceLayers 5;
}
g-outer
{
nSurfaceLayers 5;
}
w-study-roof
{
nSurfaceLayers 5;
}
}
// Advanced settings
meshShrinker displacementMotionSolver;
solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity quadratic inverseDistance 1(wall);
}
// Additional reporting: if there are just a few faces where there
// are mesh errors (after adding the layers) print their face centres.
// This helps in tracking down problematic mesh areas.
additionalReporting true;
}