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

[Other] converting fluent .msh file to openfoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 7, 2019, 11:17
Smile converting fluent .msh file to openfoam
  #1
New Member
 
Lauren Johnston
Join Date: Mar 2019
Posts: 16
Rep Power: 7
laurenj95 is on a distinguished road
Hi,

I have a .msh file which opens in fluent but I am getting the following error message when I try to convert the fluent file to openfoam:


--> 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 am using the following command in openfoam:

fluentMeshToFoam <mesh_file>.msh


(I am using OF version 6)

Any help would be much appreciated!

Lauren
laurenj95 is offline   Reply With Quote

Old   October 7, 2019, 19:27
Default
  #2
Senior Member
 
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 407
Rep Power: 14
Светлана is on a distinguished road
How did you create the .msh file?
Светлана is offline   Reply With Quote

Old   October 8, 2019, 03:38
Default
  #3
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
If it's a 3d mesh try
Code:
fluent3DMeshToFoam <mesh_file>.msh 
https://openfoamwiki.net/index.php/Fluent3DMeshToFoam


If the mesh was created on Windows try to convert this to Unix formatting first:
Code:
dos2unix <mesh_file>.msh

Last edited by piotr.mecht; October 8, 2019 at 03:44. Reason: one more tip
piotr.mecht is offline   Reply With Quote

Old   October 8, 2019, 04:21
Default
  #4
New Member
 
Lauren Johnston
Join Date: Mar 2019
Posts: 16
Rep Power: 7
laurenj95 is on a distinguished road
Hi,

I meshed the geometry in VMTK
laurenj95 is offline   Reply With Quote

Old   October 8, 2019, 04:22
Default
  #5
New Member
 
Lauren Johnston
Join Date: Mar 2019
Posts: 16
Rep Power: 7
laurenj95 is on a distinguished road
Quote:
Originally Posted by piotr.mecht View Post
If it's a 3d mesh try
Code:
fluent3DMeshToFoam <mesh_file>.msh 
https://openfoamwiki.net/index.php/Fluent3DMeshToFoam


If the mesh was created on Windows try to convert this to Unix formatting first:
Code:
dos2unix <mesh_file>.msh
I have also tried the command

fluent3DMeshToFoam but I get the following message:

--> FOAM FATAL IO ERROR:
wrong token type - expected int64_t, found on line 0 the word 'a'

file: IStringStream.sourceFile at line 0.

From function Foam::Istream& Foam:perator>>(Foam::Istream&, int64_t&)
in file primitives/ints/int64/int64IO.C at line 62.

FOAM exiting


The mesh was created in VMTK on a linux PC.
laurenj95 is offline   Reply With Quote

Old   October 8, 2019, 15:04
Default
  #6
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Quote:
Originally Posted by laurenj95 View Post
--> FOAM FATAL IO ERROR:
wrong token type - expected int64_t, found on line 0 the word 'a'

IStream errors are due to input variable incompatibilities. This one e.g. expects some number in the first read line, but it gets some word beginning from the letter 'a'.

Can you copy your mesh file header with some first lines? It should look a bit like (opened in some text editor):
Code:
(0 grid written by ANSYS Meshing
    nodes:        (10 (id start end type)    (x    y    z    ...))
    faces:        (13    (id start end type elemType) (v-0 v-1 .. v-n right cell left-cell ...))
    cells:        (12 (id start end type elemtype))
    parent-face (59 (start end parent child) (nchilds child0 child1 ...))

)
(2 3)
(10 (0 1 3d00 0))
(13 (0 1 ac6a 0))
(12 (0 1 37dd 0))
(10 (4 1 32dc 1 3))(
Is it written with ASCII? OpenFOAM converters do not accept binary input. Are you sure it is Fluent mesh? GMSH also uses *.msh extension
piotr.mecht is offline   Reply With Quote

Old   October 9, 2019, 06:27
Default
  #7
New Member
 
Lauren Johnston
Join Date: Mar 2019
Posts: 16
Rep Power: 7
laurenj95 is on a distinguished road
Here is the first few lines of my .msh file:


(0 "GAMBIT to Fluent File")
(0 "Dimension:")
(2 3)

(10 (0 1 691ef 1 3))
(10 (1 1 691ef 1 3)(
-1.2803401947e+01 -1.3421555519e+01 -5.0188274384e+01
-1.3403158188e+01 -1.3795591354e+01 -4.9609939575e+01
-1.3658709526e+01 -1.3156168938e+01 -5.0240833282e+01
1.1650079489e+00 -4.0743322372e+00 -4.4399948120e+01
1.3966637850e+00 -4.2284913063e+00 -4.5130626678e+01
1.4664224386e+00 -3.4754595757e+00 -4.5022266388e+01


I have made sure it is ASCII format and it the mesh works in Fluent.

Thanks,
Lauren
laurenj95 is offline   Reply With Quote

Reply

Tags
fluent, mesh conversion, openfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
OpenFoam "Permission denied" and "command not found" problems. iyidaniel@yahoo.co.uk OpenFOAM Running, Solving & CFD 11 January 2, 2018 06:47
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 10:59
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44


All times are GMT -4. The time now is 07:51.