CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   SnappyHexMesh (

nicchani June 11, 2009 09:41

Hi, I'm new to OpenFoam and CFD in general. I have to mesh an aerofoil and as I will have to do it automatically I considered SnappyHexMesh as a good option because I can mesh from command line. However I have read that it doesn't handle well sharp edges and may not be suitable for some cases. Also it looks quite complex, and I can't find a tutorial where I see the necessary commands. Is there another mesher I could use for this like Salome for example?


wolle1982 June 17, 2009 08:22

Hi nicchani,

sHM is not suitable for 2d-airofil meshing. refining in x and y direction it also refines in z direction. so the 2D situation is gone...

for a 2D airfoil the blockMesh is very suitable. ther you also have command input and ones created a "master-blockmeshdict"-file you can easily mesh any airfoil. it can also be automated by excel e.g.

problem with salome, the BL on the surface does not grow straight rectangular.

meshing with salome a 3d case shows up problems while exporting. it doesn't support pyramid which you need as connection between hexaeders and tetraeders.

nicchani June 17, 2009 10:00

thanks for your reply! I was trying with Salome. I'm sorry but I didn't understand the problem with Salome.

I will have a look at blockmesh too. The problem I see with blockmesh is that every time the geometry changes, I would have to change the whole file. Is that right?

wolle1982 June 18, 2009 04:59

1 Attachment(s)

if you have a hybrid mesh in salome, means you have tets and hex with a connection layer of pyramids, how do you get it out of salome? the unv-export doesn't support pyramids. you would get impermeable cells. you could work around that by defining a cellset and transform that after...but don't ask me.


a simple airfoilgrid in blockmesh would be a c-grid consisting of 6 blocks. I attached a blockMeshDict file for you. it is a simple airfoil (AH93). i think it already has a AoA.

Yes, for each airfoil you will have to change the file...but that is not so much work. just change the airfoil coordinates. changing the AoA would be made better with the boundary conditions (inlet stream direction).

for a better grid (more rectangle cells on the surface) you can increase the number of blocks from 6 to the coordinate numbers. then you get the best result. I wrote myself a excel-sheet that does it automatically for me. doing this is very simple since it works always after one procedure.

in the attached file in the header is a little legend embedded so one can see how it is built. one trick is, that you use even numbers for the top layer and uneven numbers for the behind layer. so you can easily tell the vertices apart.

that helped?

nicchani June 18, 2009 05:37

yes! thanks! I'll have a look at it and i'll ask if i have any doubts! danke! :)

Anneg December 9, 2009 11:50


Thanks for posting the blockMeshDict file as en example.
Just a small question: is it a AH93 airfoil, or a NACA0012, as indicated in the file header?

wolle1982 December 9, 2009 12:05


sorry don't know. it's been too long, but if you plot it you will see. if it looks like a symmetrc airfoil, it is a NACA0012. otherwise it is a AH93

All times are GMT -4. The time now is 20:18.