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

[Gmsh] Gmsh to Foam fails to read

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2023, 21:48
Default Gmsh to Foam fails to read
  #1
Senior Member
 
CFD_Lovers
Join Date: Mar 2015
Posts: 168
Rep Power: 11
sinatahmooresi is on a distinguished road
Hello FOAMers,



I am trying to import my *.msh created by Gmsh to OF when using "gmshToFoam" utility. I attached the *.geo file (attached as a text file geo.txt because of the uploading formats available) and the error message reads as:



Create time

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

Starting to read physical names at line 5
Physical names:9
Surface 191 Inlet
Surface 192 Bottom
Surface 193 Walls
Surface 195 Top
Surface 196 Inlet2
Surface 197 Nozzle1
Surface 198 Nozzle2
Surface 199 Hole
Volume 200 Whole

Skipping tag $Entities at line 17
Starting to read points at line 472
Vertices to be read:439


--> FOAM FATAL IO ERROR:
Attempt to get back from bad stream

file: IStringStream.sourceFile at line 0.

From function bool Foam::Istream::getBack(Foam::token &)
in file db/IOstreams/IOstreams/Istream.C at line 56.

FOAM exiting


I was wondering if anyone with gmsh experiences can help me out in this.
Attached Files
File Type: txt geo.txt (8.1 KB, 5 views)
sinatahmooresi is offline   Reply With Quote

Old   April 12, 2023, 10:52
Default
  #2
New Member
 
Wassim Abdel Nour
Join Date: Feb 2021
Location: France
Posts: 16
Blog Entries: 1
Rep Power: 5
wa$$im is on a distinguished road
The problem is not in the .geo file but most probably in how you export the mesh.

Try to write the msh file in version 2 ascii before converting it with gmshToFoam.
wa$$im is offline   Reply With Quote

Old   April 12, 2023, 17:33
Default
  #3
Senior Member
 
CFD_Lovers
Join Date: Mar 2015
Posts: 168
Rep Power: 11
sinatahmooresi is on a distinguished road
Hello Wassim,

Thank you for getting back to me. You are right. It worked when I changed the version to Version II, ASCII.



Best,

Sina
sinatahmooresi 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
[CGNS] CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 137 December 14, 2018 04:20
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 11:32
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04


All times are GMT -4. The time now is 16:55.