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

[Gmsh] Trying to convert an already generated gmsh to OpenFOAM

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

Like Tree2Likes
  • 2 Post By mzzmrt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 7, 2019, 03:08
Default Trying to convert an already generated gmsh to OpenFOAM
  #1
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 471
Rep Power: 15
syavash is on a distinguished road
Dear mates,

I am new to Gmsh. I have tried to convert an existing 3-D gmsh file to OpenFOAM format using gmshToFoam utility. I was successful in opening the grid file and I have assigned names to the 2-D surfaces using Physical Groups-->Add. Also, I specified name to the volume. I have attached the geo file for more information (I have renamed it to txt so I can upload it!).

However, when I try to convert the modified gmsh file using gmshToFoam utility, I get messages like the following:

Code:
Unhandled element 12 at line ...
And in the end I have the following error message:

Code:
No cells read from file "test4"
Does your file specify any 3D elements (hex=5, prism=6, pyramid=7, tet=4)?
Perhaps you have not exported the 3D elements?

file: test4 at line 620821.

    From function readCells(..)
    in file gmshToFoam.C at line 726.

FOAM exiting
Unfortunately, the size of the initial gmsh file is large, so I put the link to the file below:

http://www.as.dlr.de/hiocfd/c3.6_gri...x32_p2.msh.bz2

The question is what I am doing wrong? Could anyone please tell me where the problem lies?

Regards,
Syavash
Attached Files
File Type: txt test4.txt (298 Bytes, 4 views)
syavash is offline   Reply With Quote

Old   May 7, 2019, 05:16
Default
  #2
Senior Member
 
Join Date: Mar 2014
Posts: 108
Rep Power: 9
mzzmrt is on a distinguished road
This may be a solution unless you don't have the original *.geo script of this mesh;

1. Open the file (phill_64x32x32_p2_gmsh) with gmsh
2. Create a 3D mesh with it (on the left menu: mesh>3D)
3. File>export test.mesh (as version 2 ascii format)
4. put this *.msh in the OpenFOAM case directory
5. run gmshToFoam test.msh
6. run autoPatch 80 - overwrite
7. run paraFoam to check the pacth names
8. configure the boundary, nut, U, P, etc. files according to this patch names (or change them in the boundary file) and types...



sourav90 and ifrit54 like this.

Last edited by mzzmrt; May 7, 2019 at 07:34. Reason: image upload
mzzmrt is offline   Reply With Quote

Old   May 7, 2019, 08:46
Default
  #3
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 471
Rep Power: 15
syavash is on a distinguished road
Quote:
Originally Posted by mzzmrt View Post
This may be a solution unless you don't have the original *.geo script of this mesh;

1. Open the file (phill_64x32x32_p2_gmsh) with gmsh
2. Create a 3D mesh with it (on the left menu: mesh>3D)
3. File>export test.mesh (as version 2 ascii format)
4. put this *.msh in the OpenFOAM case directory
5. run gmshToFoam test.msh
6. run autoPatch 80 - overwrite
7. run paraFoam to check the pacth names
8. configure the boundary, nut, U, P, etc. files according to this patch names (or change them in the boundary file) and types...




Wow! Thank you. The creation of the 3-D mesh did the trick.

Kind Regards,
Syavash
syavash is offline   Reply With Quote

Old   March 11, 2020, 11:15
Default
  #4
New Member
 
Arash
Join Date: May 2017
Posts: 16
Rep Power: 6
arashgmn is on a distinguished road
Quote:
Originally Posted by mzzmrt View Post
This may be a solution unless you don't have the original *.geo script of this mesh;

1. Open the file (phill_64x32x32_p2_gmsh) with gmsh
2. Create a 3D mesh with it (on the left menu: mesh>3D)
3. File>export test.mesh (as version 2 ascii format)
4. put this *.msh in the OpenFOAM case directory
5. run gmshToFoam test.msh
6. run autoPatch 80 - overwrite
7. run paraFoam to check the pacth names
8. configure the boundary, nut, U, P, etc. files according to this patch names (or change them in the boundary file) and types...



This won't identify the interior surfaces (for instance, when there are sliding sub-domains, the intersection can be defined as an interior physical group which is totally invisible to autoPatch.)
arashgmn is offline   Reply With Quote

Reply

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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 2 Today 01:18
Getting Started with OpenFOAM wyldckat OpenFOAM 24 October 2, 2019 22:35
Can't convert my mesh created in Gmsh to OpenFOAM Crystal 95 OpenFOAM 1 May 2, 2018 11:42
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 14:36
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 10:04


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