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

[Gmsh] Error converting Gmsh mesh to OpenFOAM format

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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: 16
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, 10 views)
File Type: txt ErrorMessage.txt (2.4 KB, 15 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: 45
Rep Power: 17
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.

http://www.cfd-online.com/Forums/ope...-x-import.html
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: 16
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: 45
Rep Power: 17
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANSYS Meshing] Automated ANSYS mesh export in ASCII (OpenFOAM) format siny ANSYS Meshing & Geometry 1 January 17, 2020 10:17
[Technical] How to convert Corner-grid format to OpenFOAM mesh ELwardi OpenFOAM Meshing & Mesh Conversion 0 April 20, 2019 13:05
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
To convert Mesh from OpenFoam to GMSH gara1988 OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:43
[Gmsh] gmshToFoam problem: not the same mesh in Gmsh vs. paraview zhernadi OpenFOAM Meshing & Mesh Conversion 8 July 7, 2011 03:28


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