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

problem converting mesh from gmsh

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 17, 2011, 05:28
Default problem converting mesh from gmsh
  #1
New Member
 
Join Date: Apr 2011
Posts: 8
Rep Power: 6
Fried is on a distinguished road
Hello everyone,
as a OpenFoam user, I always build my mesh with gmsh and then export it with gmshToFoam.
Now, I have a problem I cannot solve. My geometry is a squared horizontal channel on which some vertical channels for inlet and outflow are placed. These channels are not aligned and they are cylindrical. I want to run a 3D simulation.
On gmsh everything is fine, all displayed and with correctly groups (boundaries) assigned. When I export to OpenFoam one of the channels disappears, a defaulfaces region is crated on the face of its intersection with the horizontal channels and in the output file I get this message:

Could not match gmsh face 4(27013 27044 27035 27052) to any of the interior or exterior faces that share the same 0th point

As I said, I checked more than once with gmsh and there everything looks fine. Changing mesh refinement on the sides does not change anything. I also have to say that if I try draw every single vertical channel alone it works.
Please, does anyone have an idea or a tip for that?
Fried is offline   Reply With Quote

Old   October 17, 2011, 16:29
Default
  #2
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Hi Fried

I have no clear idea (actually no clue). But maybe you could try the following:
2. Generate the parts separately import them to different cases then merge and stitch them with OF utilities (e.g. MergeMesh and stitchMesh)
1. Try rebuilding your Gmsh model in a strictly incremental way "commenting blocks of the .geo file" and exporting the mesh (after each change) to have a better idea of what went wrong
3. Maybe provide the .geo file

Good luck!
Hisham
Hisham is offline   Reply With Quote

Old   October 18, 2011, 03:36
Default
  #3
New Member
 
Join Date: Apr 2011
Posts: 8
Rep Power: 6
Fried is on a distinguished road
Hello Hisham,
thanks for the answer, I am going to look how the utilities you mentioned work (I guess the stitchMesh, if I want to make the vertexes coincide).
I post here the .geo file I use to build my geometry. Maybe this will give some inspiration? I already tried to make piece by piece and in that case it works; the problem is when I put all the channels at the same time.
Thanks again,
F.
Attached Files
File Type: txt TestChannels.txt (6.5 KB, 8 views)
Fried is offline   Reply With Quote

Old   October 18, 2011, 04:27
Default
  #4
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Hi Fried,

I ran gmshToFoam on the mesh. I guess maybe some external patches are not defined as physical surface. I would try to carefully review that, but I am sure you did! But why not do that again.

I found all volumes are defined as a physical vol. and I can't spot a bug really.

You may want to re-select your physical surfaces using the GUI and compare them to the ones you did before (just unbiased check)

You may also separate the extrude for the missing vol.

Regards
Hisham
Hisham is offline   Reply With Quote

Old   October 18, 2011, 04:38
Default
  #5
New Member
 
Join Date: Apr 2011
Posts: 8
Rep Power: 6
Fried is on a distinguished road
Hello Hisha,
thanks again for the tips. unluckily I already tried all the options you mentioned. I only have one doubt, concerning surface 3, since i define it using many loop lines: do I need to give them a -/+ direction? (actually I tried also this, then I don't think so...)
But from your answer, should I guess the problem is in gmsh?
Couldn't it be related to the gmshToFoam utility?
Any other idea looking to the geo file?
Thanks again,
Fried
Fried is offline   Reply With Quote

Old   October 18, 2011, 05:02
Default
  #6
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
It is obvious that there is no problem with gmsh. The error is either in the gmshToFoam or just an input error. It is always a good idea to eliminate the second possibility first.

Looking at gmshToFoam.C near line 954, there is a comment about internal faces and faceZones. What I understood is maybe you need to define some extra internal surfaces as physical surfaces and see if it works. They will not appear as patches (in boundary file) rather a faceZone.

Regards,
Hisham
Hisham is offline   Reply With Quote

Old   October 18, 2011, 07:52
Default
  #7
New Member
 
Join Date: Apr 2011
Posts: 8
Rep Power: 6
Fried is on a distinguished road
Hallo again Hisham,
I tried adding internal faces but again it didn't give the result I hope.
Then, I would like to try with stitchMesh, but I am not familiar enough to use it properly, I am afraid.
Please, could you drive me step by step (I mean, with the command lines for stitchMesh)?
I already created the two different meshes. Then, I don't know if I did correctly, I put them in two different directories and built them separately but now?
Thanks a lot in advance!
Regards,
Fried
Fried is offline   Reply With Quote

Old   October 18, 2011, 08:30
Default
  #8
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Sorry! I have not used these utilities before. Maybe search the forum or Google it. If results are not helpful, try starting a new thread on the topic to attract their users.

I would also suggest trying to play with gmshToFoam switches (gmshToFoam -help).

If all is not working, maybe use blockMesh with #codeStream (OF 2.x) support like the potentialFoam cylinder tutorial (better than typical blockMesh). Or else maybe draw a CAD model and import it to gmsh before meshing!

Regards
Hisham
Hisham is offline   Reply With Quote

Old   October 18, 2011, 08:53
Default
  #9
New Member
 
Join Date: Apr 2011
Posts: 8
Rep Power: 6
Fried is on a distinguished road
Ok, I will try with a new tread about merge/stitchMesh
Thanks for the help
F.
Fried is offline   Reply With Quote

Reply

Tags
gmshtofoam missing parts

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
SnappyHexMesh for internal Flow vishwa OpenFOAM Native Meshers: snappyHexMesh and Others 23 August 6, 2014 03:50
Converting Starccm+ mesh Ladnam OpenFOAM 0 September 14, 2011 06:30
CAD -> gMsh -> enGrid -> OpenFOAM Problem AlGates OpenFOAM 7 August 6, 2010 12:46
Converting mesh from gmsh newbee OpenFOAM Pre-Processing 21 January 22, 2010 07:51
Converting curved surfaces problem markdowlinguk Open Source Meshers: Gmsh, Netgen, CGNS, ... 4 August 2, 2007 08:05


All times are GMT -4. The time now is 02:24.