CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: snappyHexMesh and Others (
-   -   Distance to Medial Axis (

kalyangoparaju May 14, 2012 00:46

Distance to Medial Axis
1 Attachment(s)

Can someone tell me what exactly are

1. minThicknessToMedialRatio
2. minMedianAxisAngle.

I am trying to grow layers on a round tip so as to achieve a first cell height of around 5e-6m which gives me a y+=1. I observe that there are layers in other parts of the wing except the round tip once I decrease the minThickness of the first layer below a certain threshold.

Attachment 13103

I have a feeling that the above parameters can influence the layer addition process.

Kalyan Goparaju

SirWombat May 14, 2012 03:11


A first guess: the ratio of the average cell thickness at each "corner" to the maximum thickness of a cell.
A seconf thought: It could also be the ratio of the thickness of a single cell to the averaged overall layer thickness (==distance from the surface to first cell of the background mesh).

To see what changes in those parameter does to your layers, you might try to switch of all quality controls, i.e. like this:


    maxNonOrtho 180;
    maxBoundarySkewness -1;
    maxInternalSkewness -1;
    maxConcave 180;
    minVol -1e30;
    minTetQuality -1e30;
    minArea -1;
    minTwist -1e30;
    minDeterminant -1;
    minFaceWeight -1;
    minVolRatio -1;
    minTriangleTwist -1;
    nSmoothScale 4;
    errorReduction 0.75;

If you keep your quality controls too high, you will simply filter all bad cells and never find out about the effect of the changes in your layer parameters! So yes, you need to switch them off. Really! Try it!

Try a

minMedianAxisAngle 90;
and then start from

maxThicknessToMedialRatio 1.0;
and have a look at the result. You may then slightly reduce that ratio to 0.9 and maybe all the way down to 0.1 and you will see the changes in paraview.
Make sure that

nRelaxIter 5;
is set good number: it's the number of iterations SHM uses to move the mesh away from the surface where you want your layers on.

When you are satisfied with your mesh you will have to start on meshQualityControls, carefully increasing single parameters (start with maxNonOrtho- and the Skewness-parameters.
When running SHM have a look at the output and check your LayerIteration-process and make sure that after a few iterations, the mesh meets your quality demands.
Use checkMesh to create sets of problematic cells and view them in paraview!

If the layer iteration process does not converge, start with changes on your layer settings (those two ratios are a good start). Use the sets checkMesh creates to view your changes.

Note: Even with the tighest quality-controls you won't make a bad mesh into a good mesh. Better start with a good mesh and let SHM use the quality-controls to iterate it to a perfect mesh!

kalyangoparaju May 14, 2012 12:10

Thanks for the reply.

Deactivating the mesh quality controls does the work and inserts the layers on the parts where it was not inserting before. But now, if I run checkMesh, there are cells where the aspect ratio is reaching around 2000 and these cells are near the tip where there were no layers before. I increased the density at that region but that just increased the aspect ratio. I am confused as to what to change to decrease this problem.

My base mesh from blockMesh has an aspect ratio of 1:1


SirWombat May 14, 2012 14:48

You need to play with your layer-settings! Try


maxFaceThicknessRatio 1.0;
maxThicknessToMedialRatio 0.1;
minMedianAxisAngle 90;

and use a few Layer-Iterations, let's say

nLayerIter 5;
then under quality controls start off with

maxNonOrtho 75;
maxBoundarySkewness 20;
maxInternalSkewness 15;

keep all others switched off.

See what snappyHexMesh does when iterating those layers. Keep a sharp eye on those cells filtered by the quality controls during iterations!

Hope to get you started! Good luck (which is sometimes needed with SHM)!

All times are GMT -4. The time now is 03:33.