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

[Gmsh] gmsh to openFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2011, 13:40
Post gmsh to openFoam
  #1
New Member
 
Patrick Pazour
Join Date: Nov 2011
Posts: 9
Rep Power: 14
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 (http://www.cfd-online.com/Forums/ope...-x-import.html) 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 08:40. Reason: done
Artex85 is offline   Reply With Quote

Old   December 2, 2011, 03:31
Default
  #2
New Member
 
Join Date: Nov 2011
Posts: 14
Rep Power: 14
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


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
Getting Started with OpenFOAM wyldckat OpenFOAM 25 August 14, 2022 13:55
[Gmsh] Converting gmsh to OpenFoam Friendly OpenFOAM Meshing & Mesh Conversion 3 June 26, 2018 05:46
Can't convert my mesh created in Gmsh to OpenFOAM Crystal 95 OpenFOAM 1 May 2, 2018 10:42
[Technical] Salome + Gmsh or enGrid for OpenFOAM? wwrfd OpenFOAM Meshing & Mesh Conversion 2 July 21, 2011 10:38
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56


All times are GMT -4. The time now is 18:16.