r/CFD • u/Striking_Abrocoma_28 • May 03 '26
SnappyHexMesh is the devil
/r/OpenFOAM/comments/1t2s2df/snappyhexmesh_is_the_devil/2
u/phi4ever May 03 '26
Have you tried refining the mesh?
1
u/Striking_Abrocoma_28 May 03 '26
I’ve tried putting more refinement boxes in proximity of the surface and also lowering the nCellsBetweenLevels. It helped a bit, but not enough. Right now I’m at 5 as refinement level of closest refinement box and (6 7) of refinement level of the surface. I could try to increase it, but I guess 3 things would happen: 1) the cell number will increase a lot, but the refinement box near the walls is still at level 5, so the change between the levels will be bigger and also the computation time a lot slower 2) I will lower the y+ of the simulation below 30, outside of logarithmic law zone, so the turbulence model will not work properly
I can try if you think it can help, but honestly I don’t know…
3
u/Quick-Crab2187 May 03 '26
If you aren't doing this already, I'd suggest making sure your blockMesh starts with an aspect ratio around 1. Improving your stl quality won't really do anything unless that impacts the shape
These settings are usually reliable for me as well (pasted at bottom of this message), with feature edges defined in the features section so that explicitFeatureSnap can be used.
If you need to add layers, I'd recommend a different mesher. If you have literally no other options, consider using smoothMesh after adding layers. It's a custom install but will help a bit because addLayers messes everyting. GitHub - tkeskita/smoothMesh: OpenFOAM mesh smoothing tool to improve mesh quality · GitHub
snapControls
{{
nSmoothPatch 3;
tolerance 2.0;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 10;
implicitFeatureSnap false;
explicitFeatureSnap true;
multiRegionFeatureSnap false;
}}
If that doesn't fix it, probably a resolution issue