CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

Error when using gmshToFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 23, 2014, 11:50
Default Error when using gmshToFoam
  #1
Member
 
Join Date: Aug 2013
Posts: 60
Rep Power: 3
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, 05:04
Default
  #2
Member
 
Laurent Fitschy
Join Date: May 2011
Posts: 39
Rep Power: 6
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.
GDTech is offline   Reply With Quote

Old   April 15, 2014, 22:26
Default
  #3
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 4
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, 08:06
Default
  #4
Member
 
Laurent Fitschy
Join Date: May 2011
Posts: 39
Rep Power: 6
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, 7 views)
GDTech is offline   Reply With Quote

Old   April 16, 2014, 12:41
Default
  #5
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 4
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, 03:25
Default
  #6
Member
 
Laurent Fitschy
Join Date: May 2011
Posts: 39
Rep Power: 6
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, 03:53
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,109
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
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 03:54. Reason: typo
alexeym is offline   Reply With Quote

Reply

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
GmshToFoam FOAM FATAL ERROR faces deallocated Tobias Prousa (Prousa) Open Source Meshers: Gmsh, Netgen, CGNS, ... 14 January 31, 2012 11:45
gmshToFoam teminates on Segmentation fault XXLRay OpenFOAM 9 December 7, 2011 03:10
How to define patches after gmshToFoam ? seb_j OpenFOAM 8 July 13, 2011 09:25
gmshToFoam problem: not the same mesh in Gmsh vs. paraview zhernadi Open Source Meshers: Gmsh, Netgen, CGNS, ... 8 July 7, 2011 02:28
gmshToFoam problem. nilashansen Open Source Meshers: Gmsh, Netgen, CGNS, ... 5 December 28, 2009 13:41


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