I am a new user of OpenFOAM and I have some problems using gmshToFoam. When I convert an .msh file for using in OpenFOAM the resulting mesh is not the same. There might be some problems with boundaries linked (I have to create 'defaultFaces' boundaries, otherwise paraFoam fails).

I use 64bit Ubuntu 10.04 with OpenFoam 1.7.0, ParaView 3.8.0 and Gmsh 2.4.2. I write down my very simple example so anyone can reproduce this problem.

7. I studied the mesh in ParaView using paraFoam command and I noticed that the mesh is not the same and the boundary definitions are not correct.

8. I tried to run icoFoam and it solved the model without problems, but the solution is not realistic.

I think the problem comes from gmshToFoam, the OpenFOAM mesh is not the same as Gmsh mesh. Can you help me using a Gmsh mesh in OpenFOAM? If you can share any (tutorial) model for creating an OpenFOAM model using a Gmsh mesh, it would be also highly appreciated.

I'm not familiar with gmsh, but I had a similar problem:
I once notized with an other CAD tool (SALOME) that I can either export the geometry (usually very coarse) or the mesh I built for the geometry. Maybe you exported the geometry and not the mesh?

Hi, Zoltan!
A'm trying to make a simple example using gmsh and OpanFOAM. I have got a question for you: how did you make named physical surfaces as inlet, outlet and noslipwall? I have some troubles with it...

Chris, thank you for your reply. I will try Salome. I think .geo is for geomety and .msh is for the mesh in Gmsh.

Arina, I used Gmsh GUI to create this example, so it gave numbers as 'Physical Surface' index. I noted which index is for which boundary, then I used a text editor to modify the numbers in the .geo file to "inlet", "outlet" and "noslipwall". That's the trick.

Arina, I used Gmsh GUI to create this example, so it gave numbers as 'Physical Surface' index. I noted which index is for which boundary, then I used a text editor to modify the numbers in the .geo file to "inlet", "outlet" and "noslipwall". That's the trick.

Hi, Zoltan.
Thanks for quick reply. But I have one more question: did you open .geo and just replace for example Surface (50) to Surface ("inlet")?

I've been trying to get the physical surfaces into the boundary file, but with no success. I copied your exact file above, meshed it in gmsh, then used gmshToFoam, but those surfaces do not come across - I just get patch0 and defaultFaces. Any idea what I might be doing wrong?