|
[Sponsors] |
[snappyHexMesh] snappyHesMesh boundary layer addition phase removes edges |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 56
Rep Power: 15 ![]() |
Hi,
I think I've managed to find a nice layer addition procedure for SnappyHexMesh. Otherwise the result looks fine, but the layer addition seems to remove some edges at sharp features, see the top part of this figure: with_layers.jpg The top edges were fine after snapping phase, before layer addition: without_layers.jpg Does anyone know why this happens? It's possible to fix this issue by separating the surfaces into different patches, but it's a cumbersome workaround.. BR, Tuomo |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27 ![]() |
Hello,
If you are using the OpenCFD branch (openfoam.com), try using the mergePatchFacesAngle parameter in addLayersControls: Code:
// When to merge patch faces. Default is featureAngle. Useful when featureAngle is large. mergePatchFacesAngle 45; |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Member
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 56
Rep Power: 15 ![]() |
Hi,
Quote:
I've been testing the layer addition, and so far the best results I've got when I've used the settings below, and then grown layers incrementally by rerunning snappyHexMesh with only the layer addition option enabled, adding only 2 layers at a time. Between the runs I only decrease finalLayerThickness and minThickness. This approach seems to produce layers almost everywhere nicely, but I have no idea why this stepwise growing approach seems to work, but growing all layers in one go does not.. any insights? Code:
addLayersControls { // Layer sizing relativeSizes true; expansionRatio 1.3; finalLayerThickness 0.3; // 0.15; minThickness 0.1; // 0.05; nGrow 0; // Mesh dependencies featureAngle 130; mergePatchFacesAngle 45; // OpenFOAM.com option layerTerminationAngle -180; // OpenFOAM.com option maxFaceThicknessRatio 0.5; // Patch displacement nSmoothSurfaceNormals 1; nSmoothThickness 10; // Medial axis analysis minMedialAxisAngle 90; maxThicknessToMedialRatio 0.3; nSmoothNormals 3; slipFeatureAngle 30; // Mesh shrinking nRelaxIter 3; nBufferCellsNoExtrude 0; nLayerIter 50; nRelaxedIter 0; nOuterIter 3; // OpenFOAM.com option layers { inlet { nSurfaceLayers 0; } outlet { nSurfaceLayers 0; } walls { nSurfaceLayers 2; } } } meshQualityControls { maxNonOrtho 35; relaxed { maxNonOrtho 75; } // for layer addition maxBoundarySkewness 20; maxInternalSkewness 4; maxConcave 80; minVol 1e-15; minTetQuality 1e-15; minArea -1; minTwist 0.02; minDeterminant 0.001; minFaceWeight 0.05; minVolRatio 0.01; minTriangleTwist -1; nSmoothScale 4; errorReduction 0.75; } |
||
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27 ![]() |
Have you tried the multi pass layer addition feature implemented since v2206 release? It looks like you're doing the same thing manually.
https://www.openfoam.com/news/main-n...hexmesh-layers Snappy computes the total layer thickness and then moves the mesh away from the surface in order to insert the layers. When doing so, it has to morph the existing mesh and it sometimes results in bad cell quality which prevent it to add layers (to maintain mesh quality). The stepwise approach might help thanks to the smaller mesh motion it requires. Just my feeling about it though. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Member
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 56
Rep Power: 15 ![]() |
Hi,
thanks again @Yann! Turned out that the problem was in openfoam.org version of snappyHexMesh. Openfoam.com version seems to work nicely! Yes, the multi pass layer addition of openfoam.com is very useful, I could get all the layers in one go! I ended up using nOuterIter = maximum number of layers divided by 2. Here is an example: sharp_edge.png I'm wondering about the layers near 90 degree corners like this one below, would it be better not to have layers here? I mean, might there be some numerical trouble when the flow is in right to left direction..? Openfoam.org version of Snappy does not make layers in this area, maybe there is still some parameter to be tuned for openfoam.com? corners.png BR, Tuomo |
|
![]() |
![]() |
![]() |
![]() |
#6 | |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27 ![]() |
Quote:
To avoid getting layers here, you could set the featureAngle below 90°, but it will not add layers in any sharp angle on your geometry. The only way to avoid adding layers in this specific place would be to have a separate patch for it so you can control the layers parameters for this patch. Regards, Yann |
||
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 56
Rep Power: 15 ![]() |
FYI I've now added what I've learned about snappyHexMesh boundary layer addtion to my Blender SnappyHexMesh GUI add-on (see the discussion thread) for ease of use!
|
|
![]() |
![]() |
![]() |
![]() |
#8 |
Member
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 56
Rep Power: 15 ![]() |
Hi,
optimized layer parameters further, here is the result when using Feature Angle 130. Turned out that nSmoothDisplacement iterations are really important! Screenshot_2023-12-16_19-45-13.png and this one using Feature Angle 45. For some reason collapsing happens at second edge and not the first from the corner. Screenshot_2023-12-16_19-51-29.png This one is with Feature Angle 95, seems like something in between.. Screenshot_2023-12-16_20-19-07.png |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27 ![]() |
Hello Tuomo,
I like the first one ![]() Out of curiosity, have you tried to use your settings on another geometry? |
|
![]() |
![]() |
![]() |
![]() |
#10 | |
Member
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 56
Rep Power: 15 ![]() |
Hi Yann,
Ok, but the real question is, does your solver like it too? ![]() Quote:
BR, Tuomo |
||
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
SimpleFoam & Theater | jipai | OpenFOAM Running, Solving & CFD | 3 | June 18, 2019 10:11 |
Basic Nozzle-Expander Design | karmavatar | CFX | 20 | March 20, 2016 08:44 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 04:05 |
Convective Heat Transfer - Heat Exchanger | Mark | CFX | 6 | November 15, 2004 15:55 |
errors | Fahad | Main CFD Forum | 0 | March 23, 2004 13:20 |