CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: snappyHexMesh and Others (
-   -   holes / weird faces in SH OF2.0.1 (

wernsen November 25, 2011 20:57

holes / weird faces in SH OF2.0.1
1 Attachment(s)
Build : 2.0.1-51f1de99a4bc
Exec : snappyHexMesh

Hello there,

I have some holes within the mesh randomly. Even increasing surface ref level will still create small defects, mainly on the surface and not within the mesh. With OF 1.7 I did not see this behavior but as you might know there were the edge problems thus I changed to the newest version of OF, SHM respectively.

Does anyone have an idea how to get rid of this defects?


Attachment 10212

wyldckat November 26, 2011 04:31

Greetings Martin,

Yeah, I've stumbled on that bug a few months back and reported it here: - as seen on the last pictures and last comments.

I believe a partial solution for that bug was to reduce the number of some types of cells... hold on, I'll check Mattijs changes on the repository on that time... ah, as shown in the commit 3f9085f43276, change:
  • maxLocalCells 1000000;
  • maxLocalCells 100000;
If that isn't enough, then check the method I used on that bug report for generating the mesh in two stages (I believe the attached cases show how to do it).

Let me/us know which method(s) worked for you ;)

Best regards,

Aurelien Thinat November 29, 2011 08:24


I got a similar problem with CHT meshing (but maybe it's not related). (I just checked my post, pictures are not online anymore...).

Anyway, I solved it by importing the .stl file in another software (starccm+ in my case) and refine the surface mesh before exporting it again in stl format.


wernsen November 29, 2011 18:59

5 Attachment(s)
thanks for the new ideas but unfortunately the problem remains.

I attached some more detailed pictures to show that these flaws a really cracks in the mesh and now graphic problem.

Attachment 10254 Attachment 10255 Attachment 10256 Attachment 10257

With increasing the mesh resolution by increasing the nodes the flaws are much smaller but still there. While running SHM I get some problems with maximum displacement.

--> FOAM Warning : Displacement (-5.07599e-06 1.58947e-06 2.3745e-06) at mesh point 65344 coord (-0.00416673 -0.0869723 0.0625034) points through the surrounding patch faces

Furthermore I attached the log as well.

Attachment 10258

wyldckat December 1, 2011 03:43

Hi Martin,

Then I strongly suggest that you also report the problems you are having, either on the bug report above or file a new bug report, since yours is more specific than mine.

It might be asked of you to provide a simpler STL geometry that reproduces the error. I believe that the bug/issue tracker allows private bug reports, in case you want to provide an STL that is bound to confidentiality agreements or something like that. Although you should first confirm if it's really private or not, just in case...

If you don't want to file a report, or need the mesh to get actually done, then you might want to try and locally increase mesh resolution to minimize and/or remove those problems.

By the way, did you try the two pass method? Namely do the castellated mesh stage separated from the snapping stage?

Best regards,

wernsen December 6, 2011 10:54

Hey Bruno,

thanks for the advice. Actually I always run SHM in serial mode / 2 pass mode (first castellate, than only snap, than only layer). It is easier to see weather castellate is working before snapping.

In the meanwile I tried to change some things in the SHM-Dict to reduce the amount of flaws in the mesh. With increasing the levels it seams to disappear slightly (flaws are getting smaller).

If I find some time I will post the bug report as you did. How fast is the OF Crew?


wyldckat December 6, 2011 15:26

Hi Martin,


Originally Posted by wernsen (Post 334876)
How fast is the OF Crew?

By what I've seen so far, depends on several things:
  • Importance of bug;
  • Their current work load;
  • If it can be fixed for this version or the next version or waiting for sponsorship...
So, according to these, the bug gets fixed sooner or later... ;) Can be something between minutes to several months.

Either way, better report the bug with a good small case for easier replication of said bug.

Best regards,

kalle December 8, 2011 04:07


I've too been banging my head into this. My conclusion is however that there is no bug, and also actually no problem either, except some visualization issues. Create a set using setSet:

cellSet funnyCells new shapeToCell tetWedge

and have a look at those. You will see that they coincide with the strange looking cells. You will also find that there are some tetWedge cells that do seem to look correct. That seems to be due to their orientation. If you decrease opacity in paraview, you will see that they also look strange. (I use vtkPolyhedron=true, btw). Now, the nice thing is that paraviews native openfoam reader actually does a pretty good job displaying these. Create an empty file in you case directory and open it:

touch aa.foam
paraview aa.foam

You will now find that the mesh looks complete.

I did this on OF 2.0.x and Paraview 3.10.1.

p.s. For test cases, generate a sphere in paraview and save as STL. snappyhexmesh on such geometries normally gives tetWedge cells.


Titus May 18, 2012 13:49

I found the same holes in my meshes. It does not seem to be a visualization thing: when I make a slice the holes remain. Please take a look at my blog for pictures:



wyldckat May 19, 2012 17:47

Hi Titus,

I've seen these issues as well sometime ago. I only remember one of the solutions that were implemented with success: move the model to the center of the simulation space, so that both (0 0 0) and the center of the geometry coincide.

This is due to how snappyHexMesh works to detect surfaces, which is basically some kind of ray tracing method, or so I think.

Another solution that usually works is to adjust the base mesh until things work...

Best regards,

openfoam_user March 22, 2013 03:54

weird faces in SH OF2.2.x
2 Attachment(s)

I use snappyHexMesh-2.2.x.

After castellatedMesh I get pict1.jpg.
After snapping I get pict2.jpg.

Pict2.jpg is not nice at all, but checkMesh doesn't give me any kind of errors (mesh is OK).

How can I get a better rendering after snapping.

Best regards,

wyldckat March 24, 2013 12:39

Hi Stephane,

OpenFOAM 2.2 is a bit different when using snappyHexMesh:
If I read and remember correctly, one example is that you no longer need to run surfaceFeatureExtract, because snappy can handle features on its own now!

I haven't read things in more detail, so I don't know what specifically has changed, so... happy reading! And don't forget to check the tutorials once again!

Best regards,

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