CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

gmsh to openFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 22, 2011, 14:40
Post gmsh to openFoam
  #1
New Member
 
Patrick Pazour
Join Date: Nov 2011
Posts: 9
Rep Power: 6
Artex85 is on a distinguished road
Dear Forum Users,

Today I started with gmsh (2.4.2), unfortunately my knowledge is still too low for understanding the error messages at the converting. The goal is to convert the .msh file into a openFOAM (1.5-dev) mesh. After overloading the google search button, i downloaded the bugfix for the gmshToFoam.C (gmshToFoam: small fix for gmsh 2.4.x import) and copied it over the old one. Somewho know how to compile the new file? Or have other ideas?

First of all i created a simple cylinder:

Code:
r = 15;
h = 50;

lc = 4;

Point(1) = {0, 0, 0, lc};
Point(2) = {0, r, 0, lc};
Point(3) = {0, -r, 0, lc};
Point(4) = {r, 0, 0, lc};
Point(5) = {-r, 0, 0, lc};

Circle(1) = {5, 1, 2};
Circle(2) = {2, 1, 4};
Circle(3) = {4, 1, 3};
Circle(4) = {3, 1, 5};

Line Loop(5) = {2, 3, 4, 1};
Plane Surface(6) = {5};
Extrude {0, 0, h} {
  Surface{6};Layers{10};
}
Physical Surface("inlet") = {6};
Physical Surface("outlet") = {28};
Physical Surface("walls") = {27, 15, 19, 23};
Physical Volume("inner") = {1};
Here is the error message from gmshToFoam:
Code:
ubuntu@ubuntu:~/OpenFOAM/ubuntu-1.5-dev/run/mySolver_heissgas/pipe$ gmshToFoam rohr.msh

Exec   : gmshToFoam rohr.msh
Date   : Nov 22 2011
Time   : 18:09:23
Host   : ubuntu
PID    : 4728
Case   : /home/ubuntu/OpenFOAM/ubuntu-1.5-dev/run/mySolver_heissgas/pipe
nProcs : 1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Found $MeshFormat tag; assuming version 2 file format.
Starting to read physical names at line 5
Physical names:4


wrong token type - expected string found on line 0 the label 1

file: IStringStream.sourceFile at line 0.

    From function operator>>(Istream&, string&)
    in file primitives/strings/string/stringIO.C at line 57.

FOAM exiting

ubuntu@ubuntu:~/OpenFOAM/ubuntu-1.5-dev/run/mySolver_heissgas/pipe$
Solution: Just downloaded an old gmsh version (2.2.6), and all is fine...

Last edited by Artex85; December 18, 2011 at 09:40. Reason: done
Artex85 is offline   Reply With Quote

Old   December 2, 2011, 04:31
Default
  #2
New Member
 
Join Date: Nov 2011
Posts: 14
Rep Power: 6
XXLRay is on a distinguished road
Your mesh foramt looks wrong. My mesh created in gmsh looks as follows:

Code:
$MeshFormat
2.1 0 8
$EndMeshFormat
$Nodes
175
1 0 0 0
...
175 49.80471076454903 18.51136030950413 64.10544445835805
$EndNodes
$Elements
1333
1 15 3 0 1 0 1
...
1333 4 3 0 72 0 135 136 70 69
$EndElements
How did you exactly create your mesh? I simply chose "Save Mesh" from the GUI.
XXLRay is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2D Mesh Generation Tutorial for GMSH aeroslacker Open Source Meshers: Gmsh, Netgen, CGNS, ... 12 January 19, 2012 04:52
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 06:55
CAD -> gMsh -> enGrid -> OpenFOAM Problem AlGates OpenFOAM 7 August 6, 2010 12:46
Import problem ARC Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 February 27, 2010 11:56
Error converting Gmsh mesh to OpenFOAM format Martin_ OpenFOAM Meshing & Mesh Conversion 3 December 9, 2009 10:35


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