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

[Gmsh] Error when using gmshToFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By GDTech

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2014, 11:50
Default Error when using gmshToFoam
  #1
Member
 
Join Date: Aug 2013
Posts: 60
Rep Power: 13
sur4j is on a distinguished road
I am trying to mesh a test component in GMSH but am having problems.

I meshed the component using the [Mesh] [3D] option and then saved as a .msh extension. When I tried to run this in OpenFOAM using gmshToFoam I got the following error:
Code:
Create time

Starting to read mesh format at line 2
Read format version 2.2  ascii 0

Starting to read physical names at line 5
Physical names:3
    Surface 1    frontAndBack
    Surface 2    base
    Surface 3    walls

Starting to read points at line 11
Vertices to be read:74
Vertices read:74

Starting to read cells at line 88
Cells to be read:122

Mapping region 1 to Foam patch 0
Mapping region 3 to Foam patch 1
Mapping region 2 to Foam patch 2
Cells:
    total:0
    hex  :0
    prism:0
    pyr  :0
    tet  :0



--> FOAM FATAL IO ERROR: 
No cells read from file "gmshtest.msh"
Does your file specify any 3D elements (hex=5, prism=6, pyramid=7, tet=4)?
Perhaps you have not exported the 3D elements?

file: gmshtest.msh at line 212.

    From function readCells(..)
    in file gmshToFoam.C at line 726.

FOAM exiting
Could someone please try this out and check it it works or please explain what I am doing wrong?

Thank you.

Last edited by sur4j; March 23, 2014 at 14:25.
sur4j is offline   Reply With Quote

Old   April 3, 2014, 06:04
Default
  #2
Member
 
Laurent Fitschy
Join Date: May 2011
Posts: 40
Rep Power: 15
GDTech is on a distinguished road
Hi,

I think you forgot to create a physical volume containing your 3D mesh as follow :

Quote:
Physical Volume("fluid") = {1};
Regards,
Laurent.
bkassar and advait like this.
GDTech is offline   Reply With Quote

Old   April 15, 2014, 23:26
Default
  #3
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 14
lramutti is on a distinguished road
Hello Laurent,

I also have the same problem. In my case, I have imported a geometry created in CAD and I am trying to mesh it. How can define the fluid based on the provided parameters in gmsh?

Regards,

Lucas
lramutti is offline   Reply With Quote

Old   April 16, 2014, 09:06
Default
  #4
Member
 
Laurent Fitschy
Join Date: May 2011
Posts: 40
Rep Power: 15
GDTech is on a distinguished road
Hi Lucas,

Check your elementary entities (menubar -> tools -> visibility) and add IDs of your volume(s) to the Physical Volume like this :

Code:
Physical Volume("fluid") = {1,2,3};
If you do not have any volume elementary entity, you have to define (at least) one volume entity with its bounding surfaces (geometry -> elementary entities -> add -> volume).

Regards,
Laurent.
Attached Images
File Type: jpg visibility.jpg (36.0 KB, 51 views)
GDTech is offline   Reply With Quote

Old   April 16, 2014, 13:41
Default
  #5
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 14
lramutti is on a distinguished road
Hello Laurent,

Thanks for replying. I have tried to implement your suggestion however it seems that an elementary entity called surface 1 is already there for the analyzed STL. I tried to hit apply to see if it makes a difference and then refine but for some strange reason when I try to convert my .msh file into OpenFOAM I still get this message

--> FOAM FATAL IO ERROR:
No cells read from file "Harran_clean.msh"
Does your file specify any 3D elements (hex=5, prism=6, pyramid=7, tet=4)?
Perhaps you have not exported the 3D elements?

file: Harran_clean.msh at line 13832697.


Then, I open my .geo file and it says the following:

Merge "Harran_clean.stl";
Surface Loop(2) = {1};


Would you mind if I forward to your e-mail my STL?

Regards,

Lucas
lramutti is offline   Reply With Quote

Old   April 17, 2014, 04:25
Default
  #6
Member
 
Laurent Fitschy
Join Date: May 2011
Posts: 40
Rep Power: 15
GDTech is on a distinguished road
From my knowledge, gmsh is not able to build a 3D mesh from STL file. It handles STEP and IGES from CAD software.

Go to menubar -> tools -> statistics -> "mesh" tab and you will see you don't have any 3D mesh elements ...
GDTech is offline   Reply With Quote

Old   April 17, 2014, 04:53
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

in fact you've forgotten to add one line to your geo file:

Code:
Merge "your-stl-file.stl";
Surface Loop(2) = {1};
Volume(3) = {2};
and created msh file can be converted with gmshToFoam without errors (at least it was possible with my rather simple geometry).

Last edited by alexeym; April 17, 2014 at 04:54. Reason: typo
alexeym is offline   Reply With Quote

Reply


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
[Gmsh] New version of gmshToFoam? stootoon OpenFOAM Meshing & Mesh Conversion 7 February 14, 2022 10:01
[Gmsh] gmshToFoam problem. nilashansen OpenFOAM Meshing & Mesh Conversion 11 June 5, 2016 11:45
[Gmsh] Cell to node connectivity after 'gmshToFoam' Jibran OpenFOAM Meshing & Mesh Conversion 1 June 8, 2015 10:09
[Gmsh] gmshTofoam pbm with cyclicAMI acahuzac OpenFOAM Meshing & Mesh Conversion 2 October 20, 2014 04:53
[Gmsh] gmshToFoam command mvinassa OpenFOAM Meshing & Mesh Conversion 1 April 25, 2014 08:36


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