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

[snappyHexMesh] No layer in corners and high skewness

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By Lukas1
  • 2 Post By Lukas1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 22, 2023, 12:02
Default No layer in corners and high skewness
  #1
New Member
 
Lukas
Join Date: May 2023
Location: Aachen, Germany
Posts: 4
Rep Power: 3
Lukas1 is on a distinguished road
Hello everyone,

I am quite new to OpenFoam and I have problems with mesh creation with snappyHexMesh.
The case is a pipeline (bisected in the symmetry plane) with a constriction (see pipe.jpg). In the area of the constriction the mesh should be relatively fine, in the areas before and behind it rather coarse. Nevertheless, a continuous layer on the walls would certainly be useful in terms of mesh quality.
The surfaces of the constriction (2x vertical, 1x horizontal surface incl. radii) are included in the wallrefine.stl. The remaining wall surface is contained in wall.stl. I set the refinement in the constriction area using the distance. For the transition of the layer from coarse to fine I set relativeSizes to true.
The layer was created at the inner radius, at the outer radius the layer does not go through and leads to a poor mesh quality with high skewness (see mesh1.jpg & mesh2.jpg & mesh3.jpg). The results of checkMesh are attached (see checkMesh.jpg).
I worked based on Calum Douglas' tutorial (https://www.youtube.com/watch?v=ObsFQUiVi1U).
Does anyone have an idea how I can achieve a good mesh quality in this transition area/radius and, that the layer goes through at the outer radius?
I have already tried all settings for featureAngle, but was not successful. Above a certain value for featureAngle no layers are added at all.


Code SnappyHexMeshDict:


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

// Which of the steps to run
castellatedMesh true; // make basic mesh ?
snap true; // decide to snap back to surface ?
addLayers true; // decide to add viscous layers ?


geometry // Load in STL files here
{
inlet.stl {type triSurfaceMesh; name inlet;}
outlet.stl {type triSurfaceMesh; name outlet;}
wall.stl {type triSurfaceMesh; name wall;}
wallrefine.stl {type triSurfaceMesh; name wallrefine;}
xyplane.stl {type triSurfaceMesh; name xyplane;}
volume.stl {type triSurfaceMesh; name volume;}
};

castellatedMeshControls
{
maxLocalCells 1000000; //max cells per CPU core
maxGlobalCells 2000000; //max cells to use before mesh deletion step
minRefinementCells 10;
maxLoadUnbalance 0.10;
nCellsBetweenLevels 1; // expansion factor between each high & low refinement zone

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

features // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command
(
{file "inlet.eMesh"; level 1;}
{file "outlet.eMesh"; level 1;}
{file "wall.eMesh"; level 1;}
{file "wallrefine.eMesh"; level 1;}
{file "xyplane.eMesh"; level 1;}
);

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

refinementSurfaces // Surface-wise min and max refinement level
{
inlet {level (0 0);}
outlet {level (0 0);}
wall {level (1 1);}
wallrefine {level (1 1);}
xyplane {level (1 1);}
}


resolveFeatureAngle 30; // Resolve sharp angles // Default 30
refinementRegions // In descending levels of fine-ness
{wallrefine {mode distance; levels ((0.0015 5) (0.003 4) (0.02 3) (0.2 2));}}
locationInMesh (0.001 0.02 -0.001); //to decide which side of mesh to keep **
allowFreeStandingZoneFaces true;
}


// Settings for the snapping.
snapControls
{
nSmoothPatch 3;
tolerance 4.0;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 15; // default is 10

// New settings from openfoam 2.2 onwards for SHMesh

implicitFeatureSnap false; // default is false - detects without doing surfaceFeatureExtract
explicitFeatureSnap true; // default is true
multiRegionFeatureSnap false; // deafault is false - detects features between multiple surfaces

}



// Settings for the layer addition.
addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName
{
relativeSizes true;
layers
{
wall
{
nSurfaceLayers 3;
}
wallrefine
{
nSurfaceLayers 3;
}
}

expansionRatio 1.3;
finalLayerThickness 0.8;
minThickness 0.01;
nGrow 0; // was 1


// Advanced settings

featureAngle 130; // When not to extrude surface. 0 is flat, 90 is right angle.
nRelaxIter 3; //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh.
nSmoothSurfaceNormals 1; // Number of smoothing iterations of surface normals
nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction
nSmoothThickness 10; // Smooth layer thickness over surface patches
maxFaceThicknessRatio 0.5; // Stop layer growth on highly warped cells
maxThicknessToMedialRatio 0.3; // Reduce layer growth where ratio thickness to medial distance is large
minMedialAxisAngle 130; // Angle used to pick up medial axis points
nBufferCellsNoExtrude 0; // Create buffer region for new layer terminations
nLayerIter 50; // Overall max number of layer addition iterations
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minTetQuality 1e-9;
minArea -1;
minTwist 0.02;
minDeterminant 0.001;
minFaceWeight 0.02;
minVolRatio 0.01;
minTriangleTwist -1;

// Advanced

nSmoothScale 4;
errorReduction 0.75;
}

// Advanced

debug 0;


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;


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



Thank you in advance.

Lukas
Attached Images
File Type: jpg pipe.jpg (125.7 KB, 35 views)
File Type: jpg mesh1.jpg (180.3 KB, 33 views)
File Type: jpg mesh2.jpg (113.4 KB, 40 views)
File Type: jpg checkMesh.jpg (151.4 KB, 24 views)
File Type: jpg mesh3.jpg (87.1 KB, 27 views)
lourencosm and James_mCFD like this.
Lukas1 is offline   Reply With Quote

Old   May 23, 2023, 11:40
Default
  #2
New Member
 
Lukas
Join Date: May 2023
Location: Aachen, Germany
Posts: 4
Rep Power: 3
Lukas1 is on a distinguished road
Update:

By a small extension of the STL file wallrefine.stl to the wall surface (wall.stl) a continuous edge layer could be achieved (see mesh_1.jpg & mesh_2.jpg).
However, checkMesh still shows errors (see checkMesh_2.jpg), even if they have become less.
By evaluating where the errors (skewFaces, nonOrthogonalFaces) are located, it shows that they are located exclusively in one corner, although the geometry is completely symmetrical.
Does anyone have an explanation for these asymmetric errors or know what the reason could be? (see checkMesh_Faces.jpg & checkMesh_Faces_2.jpg)
Attached Images
File Type: jpg mesh_1.jpg (188.1 KB, 41 views)
File Type: jpg mesh_2.jpg (135.8 KB, 44 views)
File Type: jpg checkMesh_2.jpg (191.3 KB, 29 views)
File Type: jpg checkMesh_Faces_2.jpg (60.0 KB, 35 views)
File Type: jpg checkMesh_Faces.jpg (88.5 KB, 29 views)
lourencosm and Nidalsb like this.
Lukas1 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] Controlling y+ values with snappyHexMesh? cjm OpenFOAM Meshing & Mesh Conversion 67 July 10, 2019 19:56
Problem in CHT simulation with high heat capacity fluid Fole FLUENT 1 September 26, 2017 09:42
[snappyHexMesh] Meshing Naca0012 with snappyHexMesh kasimirXV OpenFOAM Meshing & Mesh Conversion 10 May 11, 2016 00:04
Unphysical peaks in the pressure field at sharp corners – why? jcamilleri STAR-CCM+ 0 March 5, 2016 06:35
Skewness & Decomposition Marc FLUENT 2 July 5, 2007 15:54


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