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

[Gmsh] GMSH and OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2007, 10:11
Default Oooh, sorry, for this silly qu
  #21
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Oooh, sorry, for this silly question (how to use checkMesh)!!

But I think that I can have trouble if I don't know how to use "-autoInvert", don't I?

Lam
lam is offline   Reply With Quote

Old   March 21, 2007, 10:31
Default checkMesh ie.
  #22
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
checkMesh <root> <case>

ie. for cavity in icoFoam

$ run
$ cd tutorials/icoFoam
$ checkMesh . cavity
rafal is offline   Reply With Quote

Old   March 21, 2007, 10:39
Default Thanks Rafal, I have alread
  #23
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Thanks Rafal,

I have already managed to use "checkMesh", no problem.
But it's "-autoconvert" that I do not know to use.
CAn you help me?

Thanks in advance.
Lam
lam is offline   Reply With Quote

Old   March 21, 2007, 10:41
Default discuss ate last line of my pr
  #24
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
discuss ate last line of my previous post:
gmshToFoam <root> <case> <.msh> -autoInvert
i would try this and read all messages. there is also -verbose flag which gives you more info
rafal is offline   Reply With Quote

Old   March 21, 2007, 10:43
Default discuss ate last line of my pr
  #25
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
discuss ate last line of my previous post:
gmshToFoam <root> <case> <.msh> -autoInvert
i would try this. There is also -verbose flag which gives you more info
rafal is offline   Reply With Quote

Old   March 21, 2007, 12:54
Default Thamks a lot Rafal, I will
  #26
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Thamks a lot Rafal,

I will try this command when I will be face to a complex mesh.

Regards,

Lam
lam is offline   Reply With Quote

Old   March 24, 2007, 13:00
Default Hi, I am using OpenFOAM on
  #27
New Member
 
kmurphy
Join Date: Mar 2009
Posts: 10
Rep Power: 17
kmurphy is on a distinguished road
Hi,

I am using OpenFOAM on a 2D problem (with two regions) and am having convergence issues. I think this may be due to the (poor) mesh that I have generated with blockMesh and wish to try a mesh generated by GMSH. However when I try to transform a .msh file using gmsh2ToFoam I get the error

FOAM FATAL ERROR : faces deallocated

I have read (and I think understood) the other posts that have referred to this error. In those post the grids being generated were 3D while in this case I want to generate a 2D grid.

Is it possible to import a 2D grid from GMSH?
Or if anyone has an 2D example or can tell what step I may have missed I would appreciate it.

Thanks in advance,
Kieran
kmurphy is offline   Reply With Quote

Old   March 24, 2007, 20:10
Default Hi kmurphy, As you know all t
  #28
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
Hi kmurphy,
As you know all the OpenFOAM meshes (and the meshes its converters handle) need to be 3D. To solve a 2D case you need to construct a 3D mesh with one cell height in Gmsh.

How about using the Extrude command? For example the following is extruding a 2D mesh of a square (meshed by triangles) to a 3D mesh (with prisms):

Point(1)={0,0,0,.1};Point(2)={1,0,0,.1};Point(3)={ 1,1,0,.1};Point(4)={0,1,0,.1};
Line(5)={1,2};Line(6)={2,3};Line(7)={3,4};Line(8)= {4,1};
Line Loop(9)={5,6,7,8};Plane Surface(10)={9};
Extrude {0,0,1}{Surface{10};Layers{1};Recombine;}

Takuya
7islands is offline   Reply With Quote

Old   March 29, 2007, 06:06
Default Hi Takuya, Thanks, that is
  #29
New Member
 
kmurphy
Join Date: Mar 2009
Posts: 10
Rep Power: 17
kmurphy is on a distinguished road
Hi Takuya,

Thanks, that is exactly the effect that I was trying to get. In my attempts of a 3D representations of my 2D problem I had screwed up by ignoring the Layers command.

Regards,
Kieran
kmurphy is offline   Reply With Quote

Old   February 6, 2008, 05:16
Default Hi everybody! I tried to impo
  #30
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
Hi everybody!
I tried to import a .msh file using gmshToFoam. Everything seems to have gone the right way (it created the right files in the right place, the mesh is visible with paraFoam) BUT all the external faces have been put in one patch, so it's very difficult to give to OpenFOAM the right boundary conditions (it would be a nasty work to separate the patches manually). I'm using gmsh 2.0.8 with OpenFOAM 1.4.1 on a linux Fedora machine.
Hope someone can help, thanks!
Marzio
marziolettich is offline   Reply With Quote

Old   February 6, 2008, 05:34
Default Hi Marzio, You should defi
  #31
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi Marzio,

You should define your boundary faces as Physical groups before the import of the file. Then you can edit the files to put the right boundary conditions.

Regards,

Francesco
francesco_b is offline   Reply With Quote

Old   February 6, 2008, 05:41
Default And also don't forget to defin
  #32
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
And also don't forget to define your internal mesh as a physical volume.

T.
7islands is offline   Reply With Quote

Old   February 6, 2008, 05:43
Default Hi, I usually use the utili
  #33
Member
 
Jason Dale
Join Date: Mar 2009
Location: UK
Posts: 80
Rep Power: 17
jason is on a distinguished road
Hi,

I usually use the utility autoPatch or the other utility patchTool which I think you can find on the wiki. The patchTool utility lets you play around with the patches (select/name/merge/delete etc) in its own graphics window. I find it very useful for setting up boundary conditions.

Regards

Jason
jason is offline   Reply With Quote

Old   February 6, 2008, 05:45
Default Thanks! I would have never exp
  #34
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
Thanks! I would have never expected to get an answer so quickly! I've just started with gmesh and I will try to use your suggestion soom. In the meanwhile, I've found a compromise: if you use an older version than gmesh (I've just tried 1.65.0), the gmshToFoam utility creates a patch for each of the surfaces that define the original volume. Well, this could be annoying if most of them are of the same physical type (and would need to be grouped together), but it doesn't compromise the import.
Grazie ancora e ciao!
Marzio
marziolettich is offline   Reply With Quote

Old   February 6, 2008, 05:56
Default try also gmsh2ToFoam found som
  #35
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
try also gmsh2ToFoam found somewhere on Wiki or forum
rafal is offline   Reply With Quote

Old   February 6, 2008, 06:10
Default Well, this must be the most ef
  #36
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
Well, this must be the most efficient MessageBoard in the whole CFD community!
Thank you everybody.. I suppose that the surfaces you don't explicitly put in a physical group are treated as a unique "default group", or am I wrong?
Anyway, I will try each suggestion.
Thank you again (I wrote this in italian language in my previous message because I've read only Francesco's reply)
Marzio
marziolettich is offline   Reply With Quote

Old   February 6, 2008, 06:36
Default Hi Marzio, gmsh2ToFoam uses t
  #37
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
Hi Marzio,
gmsh2ToFoam uses the elementary surface definitions when no physical group definition is found (which is the behavior much like gmshToFoam + Gmsh-1.65.0). If that's sufficient for you I also recommend gmsh2ToFoam [1].

[1] http://openfoamwiki.net/index.php/Contrib_gmshFoam

Takuya
7islands is offline   Reply With Quote

Old   February 6, 2008, 07:37
Default Thank you Takuya! The whole pr
  #38
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
Thank you Takuya! The whole project gmshFoam is quite interesting.
Once I have compiled with wmake the gmsh2ToFoam source OpenFOAM should recognize the command as any other utility or there's some other thing I should do?
Bye,
Marzio
marziolettich is offline   Reply With Quote

Old   February 6, 2008, 08:29
Default To build gmsh2ToFoam unpacking
  #39
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
To build gmsh2ToFoam unpacking the .tar.gz and running ./Allwmake is all you have to do.

T.
7islands is offline   Reply With Quote

Old   February 6, 2008, 09:46
Default I know I'm abusing your patien
  #40
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
I know I'm abusing your patience... I must treat gmsh2ToFoam as a user-written application, right? So I untarred it and then I used wmake (I follow the OF manual). In this way, I need to specify the path every time I want to use gmsh2ToFoam or there's a variable I must set to make the command recognizable in every folder in the OF tree? I also run ./Allwmake as you said, to be true it's still running! I need to understand these matters since I'll have to modify some solvers and utilities to go on with my project and it would be very impractical if I had to recompile everything each time. I know I sound a little naive and I recognize there are many newbies like me that keep making the same questions but the search tool doesn't work and I'm not able to find a straight answer to my doubts.
Thank you and regards,
Marzio
marziolettich 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
[Gmsh] Converting gmsh to OpenFoam Friendly OpenFOAM Meshing & Mesh Conversion 3 June 26, 2018 06:46
[Gmsh] gmsh 2.6.0 conversion to OpenFoam 160 rosswin OpenFOAM Meshing & Mesh Conversion 0 March 5, 2013 08:34
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 04:52
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56


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