|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Cortex Shedding
Join Date: Jan 2025
Posts: 3
Rep Power: 2 ![]() |
I know this question has been asked a million times but I just wanted to ask again in case there have been any new developments. I do external aerodynamics of complex geometries that need me to resolve the boundary layer and I have found it impossible to generate a satisfactory mesh with inflation layers.
I have tried snappyhexmesh which invariably collapses the inflation layers with even slightly complex curves. I have tried the approach of adding one layer at a time after the snapping step and that suffers the same fate. I have also tried modifying the meshqualitydict to make the mesh quality parameters less stringent but that leads to horrible quality meshes with negative volume cells. I have also tried cfmesh. It is able to generate an inflation layer but the mesh quality is really bad. Also, the prism cells it generates are very thin compared to the outer mesh. I have played around with the SHM and cfmesh parameters for a while now and I am just not able to make a good quality mesh with inflation layers. So, the following are my questions: 1. Have there been any new developments or are there any alternate tools I could try that could help me generate a good quality mesh (preferably hex dominant) with inflation layers? 2. For those who have had success using SHM and/or cfmesh for external aerodynamics, could you tell me the parameters you used? I get that these could be case dependent, but it will help me get an idea. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 873
Rep Power: 19 ![]() |
Have you checked out Joel's YT library (https://www.youtube.com/@wolfdynamicsCFD) - he has some excellent videos that walk through the SHM settings, and provide some useful hints that I hadn't come across before.
|
|
|
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2021
Posts: 292
Rep Power: 6 ![]() |
Hey!
I personally think snappy is increasingly reliable, even with its prismatic layers although we have to be reasonable about how many layers we want don't go and try to get 25 good layers in one go. But I have found that it can create 5 layers reliably with good coverage on most geometries. Provided that the surrounding mesh is fine enough near the walls, it might be sufficient to have a decent solution in the boundary layer.Anyway, here is my latest snappyHexMeshDict: Code:
addLayersControls
{
relativeSizes true;
layers
{
".*"
{
nSurfaceLayers 5;
}
}
expansionRatio 1.2;
//finalLayerThickness 0.8;
minThickness 0.1;
thickness 0.8;
nGrow 0;
featureAngle 180;
nRelaxIter 10;
nSmoothSurfaceNormals 2;
nSmoothNormals 3;
nSmoothThickness 5;
maxFaceThicknessRatio 0.5; //0.8 to get last layer as thick as first surrounding cell
maxThicknessToMedialRatio 0.5; //0.9 to get last layer as thick as first surrounding cell
minMedialAxisAngle 90;
nBufferCellsNoExtrude 0;
nLayerIter 10;
nOuterIter 5;
// Do not extrude around sharp edge if not both faces are extruded.
// Default is 0.5*featureAngle. Set to -180 always attempt extrusion
//layerTerminationAngle -180;
// Optional: do not extrude any point where
// (false) : all surrounding faces are not fully extruded
// (true) : all surrounding points are not extruded
// Default is false.
// detectExtrusionIsland true;
//- Use displacementMotionSolver to shrink mesh
meshShrinker displacementMotionSolver;
//- Use laplacian for shrinking
solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity quadratic inverseDistance 1(wall);
}
}
Code:
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 70;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minVol 1e-15;
minTetQuality -1e15;
minArea 1e-30; // -1;
minTwist 0.01; // 0.05;
minDeterminant 0.001;
minFaceWeight 0.01; // 0.05;
minVolRatio 0.01;
minTriangleTwist 0.6;
nSmoothScale 4;
errorReduction 0.75;
}
Layers are still added to sharp corners and the mesh quality is decent enough. The big change was to set the featureAngle to 180. nOuterIter is also really nice to improve robustness. |
|
|
|
|
|
|
|
|
#4 |
|
New Member
Marius Winkler
Join Date: Jun 2024
Posts: 1
Rep Power: 0 ![]() |
Hi,
I can only second Alczem's tip with nOuterIter introduced in v2312 https://www.openfoam.com/news/main-n...#snappy_layers This definitely helped. Just add: nOuterIter 15; //i use as many iterations as I want layers for best results to your addLayersControls. Also the new "castellatedBufferLayer" sounds very promising. If I understand it right, it avoids the mesh-shrinking usually used to add the layers and adds the layers before snapping which should be more robust in theory. I played with it for 30 min and couldn't really get it to work tbh. If you want to try it, Im curios for your results: https://www.openfoam.com/news/main-n...#snappyhexmesh What I will try if I find the time: tetMesh with gmsh -> convert to polyhedral mesh with polyDualMesh and then add layers with SHM. I also think a cfMesh as a base with addedLayers by snappy could work. If you need full wall resolution I think the best open-source tool is salome with netgen. But there you are limited to tetrahedral meshes. The conversion to a polyhedral mesh with openfoam usually destroys the layers for complex geomtries. |
|
|
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2021
Posts: 292
Rep Power: 6 ![]() |
Hey,
One more trick that I have used quite often is generate the mesh without any boundary layers with snappyHexMesh, then use the utility generateBoundaryLayers from the cfMesh executable to generate only one "thick" boundary layer, and finally use the utility refineWallLayer several times on the patches you need to create more layers by subdividing this initial layer. This a bit convoluted, but quite robust since the bulk of the mesh is generated by snappy which is reliable (apart from the layer addition ), the first thick layer does not degrade the mesh quality, and you can then manually control the layer generation.For external aerodynamics, that should work nicely even for complex geometries, and the mesh quality should be fine. The only downside is that it can't handle internal walls, baffles or multiregion cases since cfMesh is used. You would have to create baffles before the layer addition, split the mesh, generate the layers, and then stitch the mesh back. Regarding cfMesh on Windows, please only use the executable that you can download online (cfMesh-v1.1.1). It runs in a terminal similarly to OpenFoam and the same commands are available, but the meshes are generated way faster and without errors usually. I don't know what is wrong with the current implementation packaged with the precompiled OpenFoam exe, but I don't use it anymore. |
|
|
|
|
|
![]() |
| Tags |
| boundary layer, cfmesh, inflation layer, meshing, snappyhexmesh |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [ICEM] How to specify inflation layers around a curved surface in ICEM CFD? | murali666 | ANSYS Meshing & Geometry | 0 | August 31, 2022 06:34 |
| Inflation layers for multiphase flow | Bdew8556 | Main CFD Forum | 0 | April 27, 2022 09:27 |
| How to contribute to the community of OpenFOAM users and to the OpenFOAM technology | wyldckat | OpenFOAM | 17 | November 10, 2017 16:54 |
| [ANSYS Meshing] Inflation layers problem | frossi | ANSYS Meshing & Geometry | 0 | July 2, 2016 19:41 |
| Fluent diverges when using inflation layers | ziggo | FLUENT | 4 | August 9, 2013 13:11 |