CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Meshing & Mesh Conversion

Error converting Gmsh mesh to OpenFOAM format

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 8, 2009, 10:16
Default Error converting Gmsh mesh to OpenFOAM format
  #1
New Member
 
Martin Vymazal
Join Date: Dec 2009
Posts: 16
Rep Power: 7
Martin_ is on a distinguished road
Dear OpenFOAM users,

I've been using gmsh for some time now and I'm very happy with this grid generator. I'd also like to work with OpenFOAM, but I'm not able to convert a simple mesh (cube with all faces defined as physical in my geo file) using gmsh2ToFoam. I went through the forum, followed some advices but nothing helped me to solve my problem. The error message I get is this:

--> FOAM Warning :
From function polyMesh: polyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 577
Found 136 undefined faces in mesh; adding to default patch.

I'm not sure if the problem is caused by the msh file created by gmsh or if my testcase which I use for conversion is missing some important information. One thing I'm particularly uncertain about is whether the orientation of the faces of the cube matters or not (should all face normals point outside the cube, for example?). Could anyone please be so kind and either give me a hint or provide me with some conversion testcase which works (can be a very simple one)?
I'm using OpenFOAM 1.6 and gmsh 2.4.2.
The complete output of OpenFOAM and the whole case directory are attached.

Thank you very much

Martin Vymazal

P.S. I hade to remove Cube.msh from the attached folder ConversionTest.tar.gz because the size of attachments is limited. However, the msh file can be reproduced by running 'gmsh -3 Cube.geo'. The file Cube.geo is included.
Attached Files
File Type: gz ConversionTest.tar.gz (7.1 KB, 8 views)
File Type: txt ErrorMessage.txt (2.4 KB, 14 views)

Last edited by Martin_; December 8, 2009 at 15:24.
Martin_ is offline   Reply With Quote

Old   December 9, 2009, 07:43
Default
  #2
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 43
Rep Power: 8
elorriaux is on a distinguished road
Hello Martin,

upgrade to OpenFOAM-1.6.x, it includes a fix for gmsh >= 2.4 format, or downgrade to gmsh 2.3.

Regards,

Etienne.

gmshToFoam: small fix for gmsh 2.4.x import
elorriaux is offline   Reply With Quote

Old   December 9, 2009, 08:53
Default
  #3
New Member
 
Martin Vymazal
Join Date: Dec 2009
Posts: 16
Rep Power: 7
Martin_ is on a distinguished road
Hello Etienne,

thank you for the reply. I was not exact in my previous post. I have OpenFOAM 1.6.x and I'm already using your fix (thanks for it). I tried to generate the mesh with Gmsh 2.2 and with Gmsh 2.3 and in both cases, the error remains the same. I tried both the legacy ('version 1') format of msh files and the version 2 format. The only difference is that when I use the old format, I have 150 undefined faces in mesh, while with version 2 format, I have 156 undefined faces. As a first step, I'd like to know if the problem is with my installation of OpenFOAM or if it is caused by the gmsh file. Could you please be so kind and provide me (even with a very simple) gmsh file that works for you?

Best regards,

Martin Vymazal
Martin_ is offline   Reply With Quote

Old   December 9, 2009, 10:35
Default
  #4
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 43
Rep Power: 8
elorriaux is on a distinguished road
Hi again,

it's just a warning, I've never searched the reason of the warning, but it's not fatal, don't care about it. I've already used many gmsh meshes (I only use version 2 format since a long time) showing this warning without any problem.

I've tried your mesh file (with gmsh dev version), and I'm also getting this warning, but the mesh is valid, run checkMesh on your case. The only warning you will get with your mesh concerns non orthogonal faces. It's due to your non structured tetrahedral mesh which is not recommanded for CFD. You should use a structured hexahedral mesh (in gmsh, just do a simple square and mesh it using transfinite and recombine functionalities, then extrude it and recombine to get a structured hex meshed cube). But in any case, your mesh is valid after conversion.

You can also check that the defaultFaces patch (the one concerned by the warning) contains 0 faces (you can edit constant/polyMesh/boundary to check it).

Regards, Etienne.

edit: why are you using gmsh2ToFoam? Just use the standard gmshToFoam utility provided in OF-1.6.x.
elorriaux is offline   Reply With Quote

Reply

Tags
converter, gmsh, gmsh2tofoam, msh, openfoam

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
vtk mesh or Abaqus mesh to OpenFOAM bigphil Open Source Meshers: Gmsh, Netgen, CGNS, ... 19 August 16, 2011 04:14
problem when converting mesh (made by ICEM) using fluentMeshToFoam Forrest_Lei OpenFOAM 11 October 16, 2009 06:28
gmsh to openfoam sarajags_89 OpenFOAM 1 October 8, 2009 05:15
OpenFOAM native format data visualization and workflow zeliboba OpenFOAM Post-Processing 0 September 12, 2008 08:44


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