|
[Sponsors] |
October 26, 2019, 21:03 |
Error converting gmsh to Openfoam
|
#1 |
New Member
Mike
Join Date: Dec 2016
Posts: 14
Rep Power: 9 |
I'm new to using gmsh, and am getting an error when trying to convert the gmsh *.msh file into openfoam format. It should be a relatively simple mesh (1st order, 2D mesh). I've attached the gmsh script in case I've made an error there. The openfoam error I'm getting is below. Anybody have any ideas what could be causing this?
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:5 Surface 1 inlet Surface 2 walls Surface 3 slipWalls Surface 4 farfield Surface 5 frontAndBack Starting to read points at line 117 Vertices to be read: 993644 Vertices read: 993644 Starting to read cells at line 1987509 Cells to be read:1632833 Unhandled element 15 at line 1987511in/on physical region ID: 0 Perhaps you created a higher order mesh? --> FOAM FATAL IO ERROR: Bad token - could not get int32 file: input at line 0. From function Foam::Istream& Foam:perator>>(Foam::Istream&, int32_t&) in file primitives/ints/int32/int32IO.C at line 85. FOAM exiting |
|
October 27, 2019, 02:45 |
|
#2 |
Member
Damian Berghof
Join Date: May 2019
Posts: 41
Rep Power: 11 |
Hello Mike,
have you checked already this: "Perhaps you created a higher order mesh?" See also this topic in the forum: GmshToFoam warnings gmshToFoam error best, Damian
__________________
Get more support about Meshing with Salome and Visualization with ParaView in my growing groups https://bit.ly/2lFfDkQ https://bit.ly/2k2u8Pj |
|
October 30, 2019, 23:48 |
|
#3 |
New Member
Mike
Join Date: Dec 2016
Posts: 14
Rep Power: 9 |
Hi Damien,
Yeah, it looks like I'm getting similar errors to those threads. I don't like the solution that they came up with though, so I guess I'm just going to try a different mesher... Thanks, Mike |
|
March 10, 2020, 06:46 |
|
#4 |
New Member
Arash
Join Date: May 2017
Posts: 17
Rep Power: 9 |
I'm using gmsh version 4.5.4, and openFoam v1912. gmshToFoam gives me the following error:
Code:
Unhandled element 15 at line 84358in/on physical region ID: 0 Perhaps you created a higher order mesh? FOAM FATAL IO ERROR: Bad token - could not get int32 file: input at line 0. From function Foam::Istream& Foam::operator>>(Foam::Istream&, int32_t&) in file primitives/ints/int32/int32IO.C at line 86. FOAM exiting In my case, I've used the ASCII4 for saving the mesh, it is a 3d mesh with 1-layer (an extruded 2d geometry) and no higher-order meshing is used. I appreciate any help. Cheers, Arash |
|
March 28, 2022, 03:55 |
Some Info
|
#5 |
New Member
Koushik
Join Date: Mar 2022
Posts: 1
Rep Power: 0 |
1. A block of code in gmshToFoam.c reads the particular line in file using IStringStream into 4 different label type variables. If one of them "elmType" the 3rd one in stream, does not match with expected types: The code is at line 941
if (elmType == MSHLINE) else if (elmType == MSHTRI) else if (elmType == MSHQUAD) else if (elmType == MSHTET) else if (elmType == MSHPRISM) else if (elmType == MSHHEX) else { } Then the error message will be displayed static label MSHLINE = 1; static label MSHTRI = 2; static label MSHQUAD = 3; static label MSHTET = 4; static label MSHHEX = 5; static label MSHPRISM = 6; static label MSHPYR = 7; These are the accepted enumerations. if the 3rd one eleType in stream is greater than 7 or does not fall in this range. Then the error exception will be raised |
|
March 22, 2024, 08:38 |
|
#6 |
New Member
FOAMraj
Join Date: Apr 2021
Posts: 19
Rep Power: 5 |
Hello,
The solution is to export to ASCII 2 format by unchecking both polar coordinates and save all elements. Then, the gmshToFoam command should work fine. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting Started with OpenFOAM | wyldckat | OpenFOAM | 26 | June 21, 2024 07:54 |
[Gmsh] Converting gmsh to OpenFoam | Friendly | OpenFOAM Meshing & Mesh Conversion | 3 | June 26, 2018 06:46 |
STL -> GMSH -> OpenFOAM | eric.m.tridas | OpenFOAM | 7 | September 7, 2011 13:06 |
[Technical] Salome + Gmsh or enGrid for OpenFOAM? | wwrfd | OpenFOAM Meshing & Mesh Conversion | 2 | July 21, 2011 11:38 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 11:56 |