CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Meshing & Mesh Conversion (
-   -   Several problems with the mesh conversion utility when converting the meshes from Gridgen (

su_junwei July 25, 2008 22:22

Dear all These days,
Dear all

These days, I have been trying to convert the mesh exported from gridgen (v 15.11) to the openfoam native format, but get no luck. Below are the problems encountered during the conversion process.

1) gridgen -> fluent mesh -> fluentmeshToFoam
For 2D mesh, it seems well.
For 3D mesh, using fluentMeshToFoam(no errors found during the conversion, but the resulting mesh cannot be read by visIt and paraview), however using fluent3DMeshToFoam, the message below appears

Header: "exported from Gridgen 15.11R1"

--> FOAM FATAL ERROR : Do not understand characters:

From function fluentMeshToFoam::lexer
in file fluentMeshToFoam.L at line 703.

FOAM exiting

2) gridgen->anasys CFX -> cfxToFoam

The following error occured

--> FOAM FATAL IO ERROR : wrong token type - expected int found on line 2 the word 'Version'

file: cfx_ansys.grd at line 2.

From function operator>>(Istream&, int&)
in file primitives/int/intIO.C at line 74.

FOAM exiting

3) gridgen->CFX-4 -> cfxToFoam

The internal mesh was converted successfully.
but if you don't define any boundary condition and got a warning below, the file of "boundary" was written into the dir of ployMesh but with only one patch, yes it is meaningfull. But if you define the
boundary condition, the file of boundary was not written, but the message on the screen showed they are created.

Default patch type set to wall
--> FOAM Warning :
From function polyMesh::polyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 577
Found 8214 undefined faces in mesh; adding to default patch.
Writing polyMesh

4) gridgen->star CD -> starToFoam
starToFoam aborted with messages

--> FOAM FATAL IO ERROR : Unexpected \n

file: star.vrt at line 1.

From function starMesh::readPoints()
in file readPoints.C at line 100.

FOAM aborting

#0 Foam::error::printStack(Foam: at OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/OSspecific/Unix/printStack.C:203
#1 Foam::IOerror::abort() at OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/IOerror.C:209
#2 Foam: Foam::operator<<>(Foam:, Foam::errorManip<foam::ioerror>) at OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/errorManip.H:86
#3 starMesh::readPoints(double) at OpenFOAM/OpenFOAM-1.4.1/applications/utilities/mesh/conversion/starToFoam/readPo ints.C:105
#4 starMesh at OpenFOAM/OpenFOAM-1.4.1/applications/utilities/mesh/conversion/starToFoam/starMe sh.C:260
#5 main at OpenFOAM/OpenFOAM-1.4.1/applications/utilities/mesh/conversion/starToFoam/starTo Foam.C:65
#6 __libc_start_main in "/lib/"
#7 __gxx_personality_v0 in "/home/sujunwei/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPDebug/starToF oam"

5) gridgen -> plot3D -> plot3DToFoam

the utility aborted with messages

Reading 2 blocks
xDim:16 yDim:30 zDim:8
xDim:30 yDim:59 zDim:30
Reading block points
block 0:
Looking at cell 0 0 0 to determine orientation.
Right-handed block.

block 1:

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

file: 001.grd at line 42710.

From function void Istream::getBack(token& t)
in file db/IOstreams/IOstreams/Istream.C at line 44.

FOAM exiting

Have you encountered these problems, how do you solve it ? would you give me some suggestion on the conversion of mesh from gridgen into openfoam native format? Any response about the mesh conversion will be appreciated.

thanks, Junwei

dkingsley July 26, 2008 13:19

Did you use the Fluent analysi
Did you use the Fluent analysis software type or the older Fluent v4?

I have never got the Fluent v4 output to work, even transfers to Gambit were problematic.

Also, if you created the cas file on a windows machine, you should run the dos2unix command to convert the line endings.


su_junwei July 26, 2008 23:58

Dear dennis yes, I have tr
Dear dennis

yes, I have tried fluent V4, but get no luck.

I used the gridgen in opensuse with wine. after converting using dos2unix, it seems that fluent3DMeshToFoam doesn't work.


All times are GMT -4. The time now is 01:12.