CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] gmshToFoam wrong token type - expected word error (https://www.cfd-online.com/Forums/openfoam-meshing/223226-gmshtofoam-wrong-token-type-expected-word-error.html)

TheOneBird December 31, 2019 16:00

gmshToFoam wrong token type - expected word error
 
I am trying to convert a gmsh file to foam using the gmshToFoam utility. When I run the command I receive the following error:

Code:

--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 0 the variable $MeshFormat

file: IStringStream.sourceFile at line 0.

    From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&)
    in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting

The gmsh file be found here: https://gofile.io/?c=I77hRb

Also, the start of the gmsh file is as follows:

Code:

$MeshFormat
2.2 0 8
$EndMeshFormat
$PhysicalNames
21
3 1 "mesh"
2 2 "b2-periodic_1deg"
2 3 "b3-periodic_1deg"
2 4 "b4-periodic_1deg"
2 5 "b5-periodic_1deg"
2 6 "b6-periodic_1deg"
2 7 "b7-periodic_1deg"
2 8 "b8-subsonic_inflow_pt"
2 9 "b9-farfield_riem"
2 10 "b10-viscous_solid"
2 11 "b11-back_pressure"
2 12 "b12-singular_axis"
2 13 "b13-viscous_solid"
2 14 "b14-singular_axis"
2 15 "b15-viscous_solid"
2 16 "b16-farfield_riem"
2 17 "b17-farfield_riem"
2 18 "b18-to-stitch-a"
2 19 "b19-to-stitch-b"
2 20 "b20-to-stitch-a"
2 21 "b21-to-stitch-b"
$EndPhysicalNames
$Nodes
36994
1 -7.7389998436000e+00 0.0000000000000e+00 0.0000000000000e+00
2 -7.7390034604200e+00 9.5725001104946e-05 1.0968998657738e-02
3 -7.7390078108300e+00 2.1736027395078e-04 2.4907020378070e-02

Some help on this would be fantastic. Thanks!

mzzmrt December 31, 2019 16:25

I have imported your file via gmshToFoam with OpenFOAM 4.1 in Linux and no problem with the .msh file.


Here is the result:


https://ibb.co/TYjVyPv

TheOneBird December 31, 2019 16:35

Thanks for the quick reply mzzmrt.

Well that is certainly strange... I might have to change my OpenFOAM version to fix this. I am using OpenFOAM-dev (current version). If it is not too much of a problem, is there any chance you could upload the files/directory of the result of the gmshToFoam?
[edit]: I have fixed it by installing OpenFOAM5 additionally to OpenFOAM-dev. Thanks again!

Thank you heaps!

mzzmrt December 31, 2019 16:53

Here it is:


https://gofile.io/?c=guCFkj


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