CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   MshToFoam (

hariya03 July 7, 2008 03:35

I have copied the .msh file co
I have copied the .msh file converted from adventure on windows to the folder smartvalve in simplefoam

The smartvalve is a new case I created by right clicking on the case browser and by using create case command.

The mesh file is placed in the smartvalve case folder. I have not did any proceedings in system and constant directories. First I started the mshToFoam command directly.

The mshToFoam command exits as like this


| ========= |

| \ / F ield | OpenFOAM: The Open Source CFD Toolbox

| \ / O peration | Version: 1.4.1

| \ / A nd | Web:

| \/ M anipulation |


Exec : mshToFoam OpenFOAM/harikr-1.4.1/run/tutorials/simpleFoam
smartvalve CFD

Date : Jul 04 2008

Time : 18:21:20

Host : D6

PID : 22462

Root : OpenFOAM/harikr-1.4.1/run/tutorials/simpleFoam

Case : smartvalve

Nprocs : 1

Create time

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

file: CFD at line 1.

From function void Istream::getBack(token& t)

in file db/IOstreams/IOstreams/Istream.C at line 44.

FOAM exiting

could advice me where I had make mistake?

gschaider July 7, 2008 04:20

Hi Hari! a) you are not ver
Hi Hari!

a) you are not very specific: what was the msh-file generated with? etc
b) from your introduction I assume that the msh-file worked on windows? Propably the file was touched on the windows-system and introduced LF/CR instead of only LF and now the converter is choking on the CR. See and use dos2unix on the file


hariya03 July 7, 2008 06:04

Thank you Mr.Bernhard, Sorr
Thank you Mr.Bernhard,

Sorry for the inconvenience.

I have created a mesh file from the IGES of a part by using ADVENTURE ON WINDOWS. I have saved it in .msh extension.

I rebooted to LINUX(OpenSUSE 10.3) and placed in directory as below

smartvalve is the new case directory i created.

When using mshToFoam command i used this mesh file cfd12.msh and the above said error occurs.

I am new to linux environment.

also with reference to your website where to execute the "tr" command

Would I need to convert the .msh file suit to unix system? If means how to do it.

Could you advice me where to use this dos2unix command as whether in MS command prompt or in UNIX Xterminal itself.


V.Hari Krishnan

gschaider July 7, 2008 10:23

Hi! dos2unix is installed o

dos2unix is installed on most Linux-systems (usually from the package of the same name)

Usage is easy (as the man-page will tell you): dos2unix test.msh


hariya03 July 9, 2008 03:22

Thank you Mr.Bernhard, The
Thank you Mr.Bernhard,

The problem is resolved. where the mistake is on myside. I have placed the mesh file in case directory instead of placing it in working directory

All times are GMT -4. The time now is 22:15.