CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > enGrid

Exporting mesh for an OpenFOAM chtMultiRegion case

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 2 Post By wyldckat
  • 5 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 25, 2014, 15:46
Default Exporting mesh for an OpenFOAM chtMultiRegion case
  #1
New Member
 
akrasemann
Join Date: Dec 2013
Posts: 17
Rep Power: 12
akrasemann is on a distinguished road
Hi,

I'm in the process of setting up a simple -but working- case for the OpenFoam chtMultiRegionFoam solver.

The basic scenario I'm modelling is a solid that separates two fluid regions in motion, i.e. a simple version of a heat exchanger. As the geometry I want to assess in the end is a rather complex one, I started of using enGrid for mesh generation, due to the very useful boundary layer creation utility.

The 'Simple heat exchanger' tutorial provided at https://github.com/enGits/engrid/wik...heat-exchanger was very useful to get to know the process of mesh creation as well as exporting mesh data to OpenFOAM.

So I ended up with a tetrahedral and prismatic mesh in enGrid, which is depicted in the attachments.

In the tutorial it is mentioned, that the enGrid export function OpenFOAM (polyhedral) should be used. This works fine and setting up the case in OpenFOAM is straightforward afterwards.

The issue I'm facing is that due to the OpenFOAM (polyhedral) export function the grid is obviously converted to a prismatic and polyhedral grid, which doesn't look that good (see attachment).

My question to the community is: How do you handle the process of mesh generation for multi region cases? Any way to get the region information processed with the OpenFOAM (grid only) export function, as this function does keep the original grid? I would appreciate all your comments on that topic.

Andreas
Attached Images
File Type: png enGrid.png (81.0 KB, 267 views)
File Type: jpg OF.jpg (85.9 KB, 249 views)
akrasemann is offline   Reply With Quote

Old   January 26, 2014, 09:26
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Andreas and welcome to the forum!

What you're seeing is the decomposed mesh. Use the "polyhedron" option in the reader for ".OpenFOAM" file extension... it's the check box "Use VTKPolyhedron".

Then use filter the "Extract cells by region", in order to get an accurate display of the mesh.

In addition, which exact enGrid version are you using and which installation steps did you follow?

Best regards,
Bruno
manuc and rugg like this.
__________________
wyldckat is offline   Reply With Quote

Old   January 26, 2014, 11:41
Default
  #3
New Member
 
akrasemann
Join Date: Dec 2013
Posts: 17
Rep Power: 12
akrasemann is on a distinguished road
Hi Bruno,

thank you very much for the quick and helpful answer. In the attachment one can see the mesh how it looks in paraview 3.12.0, if I tick the "Use VTKPolyhedron" option. The "Extract cells by region" I couldn't find, but the "Include Zones" option doesn't change the output.

I use the enGrid 1.4.0 version on an ubuntu 13.10 system. The installation procedure I followed was the one recommended for ubuntu on https://github.com/enGits/engrid/wik...D-Installation

The reason I had a closer look at the mesh was that I obtain a divergent solution in the temperature field. Seeing the mesh without the "Use VTKPolyhedron" option, I thought the mesh might be the reason. But obviously the grid is not that bad, although it is no longer based on tetrahedra. The basic shape of a single cell shouldn't affect the solver that way.

Greetings and thanks again,

Andreas
Attached Images
File Type: png OF.png (10.6 KB, 210 views)
akrasemann is offline   Reply With Quote

Old   January 26, 2014, 13:02
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by akrasemann View Post
The "Extract cells by region" I couldn't find,
It's a filter... check in the "Filters" menu
wyldckat is offline   Reply With Quote

Old   January 27, 2014, 03:34
Default
  #5
New Member
 
akrasemann
Join Date: Dec 2013
Posts: 17
Rep Power: 12
akrasemann is on a distinguished road
Thanks again. Everything is fine!

So I need to re-access my set up in order to see where the trouble comes from. But this is then an OpenFOAM issue rather then an enGrid one.
akrasemann is offline   Reply With Quote

Old   December 3, 2014, 04:56
Default
  #6
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Andreas and welcome to the forum!

What you're seeing is the decomposed mesh. Use the "polyhedron" option in the reader for ".OpenFOAM" file extension... it's the check box "Use VTKPolyhedron".

Then use filter the "Extract cells by region", in order to get an accurate display of the mesh.

In addition, which exact enGrid version are you using and which installation steps did you follow?

Best regards,
Bruno
Hello Bruno!

Long time no see, how r u.

Now Im using this polyDualMesh to convert my tet mesh. Im using OpenFOAM 2.3.x. tet mesh generated by ICEM. there are also some extra lines on it. see the pictures:

the reason why im sure this is not induced by paraview is that I compare the cells on this two:

in tet there is about 5000 cells. in the poly mesh, there are about 20000 cells.

Do u know what should I do?


Update: I ask my friend to use gmsh to generate a tet mesh, it works perfect. But why it does not work on ICEM?
Attached Images
File Type: png 1.PNG (49.2 KB, 80 views)
File Type: jpg 2.jpg (86.6 KB, 136 views)

Last edited by sharonyue; December 3, 2014 at 06:15.
sharonyue is offline   Reply With Quote

Old   December 8, 2014, 13:36
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi sharonyue,

Quote:
Originally Posted by sharonyue View Post
Long time no see, how r u.
Currently still trying to discover how to distort space and time, in order to be able to answer everyone on the forum, as well as do my own work. The answers I found so far all indicate it's not possible, at least not in this universe alone . Other than that... I'm fine, or at least I think so I hope you are also as well.


Quote:
Originally Posted by sharonyue View Post
in tet there is about 5000 cells. in the poly mesh, there are about 20000 cells.
Are you familiar with the dual mesh concept? Essentially polyDualMesh will create cells whose vertices are the centres of the tetrahedral cells. The extra cells you're seeing near the walls are probably because the algorithm is not able to properly correlate how the tetrahedral cells relate to each other and therefore the cells near the wall get split into multiple cells, instead of getting converted to polyhedral cells.


Quote:
Originally Posted by sharonyue View Post
Update: I ask my friend to use gmsh to generate a tet mesh, it works perfect.
Can you provide an image demonstrating this?
In addition, can you provide these test cases, so that I or anyone else can look at this with more detail? Because ICEM is very expensive

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 8, 2014, 14:58
Default
  #8
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi sharonyue,


Currently still trying to discover how to distort space and time, in order to be able to answer everyone on the forum, as well as do my own work. The answers I found so far all indicate it's not possible, at least not in this universe alone . Other than that... I'm fine, or at least I think so I hope you are also as well.



Are you familiar with the dual mesh concept? Essentially polyDualMesh will create cells whose vertices are the centres of the tetrahedral cells. The extra cells you're seeing near the walls are probably because the algorithm is not able to properly correlate how the tetrahedral cells relate to each other and therefore the cells near the wall get split into multiple cells, instead of getting converted to polyhedral cells.



Can you provide an image demonstrating this?
In addition, can you provide these test cases, so that I or anyone else can look at this with more detail? Because ICEM is very expensive

Best regards,
Bruno
Hello!

Kool, busy is good thing! wish there r more ppl like u who is like to help the others on CFD field. lol

unlucky, I just deleted the mesh(tet from gmsh) file made by my friend. But I can upload my own case, this case's mesh is generated by ICEM. u can see how it works wrong. after running polyDualMesh, cell numbers is 4 times bigger. So I think it does not do anything but cut the cells...at least on this ICEM tet mesh.

Actually I have no idea about the polyDualMesh, I just found this mesh is cheap compared with tet mesh. u can see this thread:

http://www.symscape.com/polyhedral-t...esh-comparison

It arouses my interest, so I just play around with this utility, lol.
Anyway, if you have interest into my case, download this one. I will upload the other case(made by gmsh) tmr.

https://www.dropbox.com/s/cp7z9ue6tw...ly.tar.gz?dl=0

u can check it out by the cell numbers, and the internal cells. I upload a pic of internal cells. Thank u bro,

btw, I just have this only one pic. I sent this pic to my friend to tell him that his mesh is compatible with polyDualMesh perfectly.
Attached Images
File Type: jpg gmsh.jpg (39.3 KB, 112 views)
File Type: png tet by ICEM.PNG (87.5 KB, 132 views)
sharonyue is offline   Reply With Quote

Old   December 9, 2014, 11:38
Default
  #9
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
My friend gave me the mesh, see it here:

ICEM:
https://www.dropbox.com/s/abdfz55f1n...em.tar.gz?dl=0

Gmsh:
https://www.dropbox.com/s/vvg8fq7ygm...sh.tar.gz?dl=0
sharonyue is offline   Reply With Quote

Old   December 13, 2014, 20:16
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi sharonyue,

I was really curious about this and here's what I found:
  1. At first, I was going to complain that the gmsh mesh wasn't tetrahedral, it only has prisms. But that's not the issue.
  2. When I executed:
    Code:
    polyDualMesh 45
    This appeared midway of the output for the ICEM mesh:
    Code:
    Detected 1 faceZones. Preserving these by marking their points, edges and faces as features.
    Inserting all faces in faceZone int_BODY as features.
  3. If you run it with the "-help" option, you get this (on 2.3.x):
    Code:
    Usage: polyDualMesh [OPTIONS] <featureAngle [0-180]>
    options:
      -case <dir>       specify alternate case directory, default is the cwd
      -concaveMultiCells
                        split cells on concave boundary edges into multiple cells
      -doNotPreserveFaceZones
                        disable the default behaviour of preserving faceZones by
                        having multiple faces inbetween cells
      -noFunctionObjects
                        do not execute functionObjects
      -overwrite        overwrite existing mesh/results files
      -splitAllFaces    have multiple faces inbetween cells
      -srcDoc           display source code in browser
      -doc              display application documentation in browser
      -help             print the usage
    
    Using: OpenFOAM-2.3.x (see www.OpenFOAM.org)
  4. So I then tried:
    Code:
    polyDualMesh 45 -doNotPreserveFaceZones
    And it seems to have worked as intended.
Attached are 3 images:
  1. Comparison of original meshes.
  2. Comparison of the result of using the command from step #2.
  3. Comparison of the result of using the command from step #4, which looks a lot more like what you were looking for.
Best regards,
Bruno
Attached Images
File Type: jpg original mesh.jpg (80.9 KB, 158 views)
File Type: jpg polyDualMesh.jpg (91.0 KB, 152 views)
File Type: jpg polyDualMesh - without zones.jpg (83.0 KB, 160 views)
elvis, sharonyue, amin.z and 2 others like this.
wyldckat is offline   Reply With Quote

Old   December 14, 2014, 10:01
Default
  #11
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Attached are 3 images:
  1. Comparison of original meshes.
  2. Comparison of the result of using the command from step #2.
  3. Comparison of the result of using the command from step #4, which looks a lot more like what you were looking for.
Best regards,
Bruno
Wonderful!!! haha, let me just leave the gmsh alone, cuz I dont have gmsh, I will try your method on ICEM and see magic! super good!

Thank u!!
sharonyue is offline   Reply With Quote

Old   December 22, 2014, 10:27
Default
  #12
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Um. I check the mesh carefully, and try some cases. At the boundaries, there are many small faces there. see:



But this one I think its neat!!:


http://www.cfd-online.com/Forums/ope...ce-object.html

I tried with some cases but I can not remove those fine mesh. but if I make the angle to be 180. its very smooth but looks there is no feature edge.

But I think this is not a big problem. however, if there is a way I can remove the small faces at the boundaries, I will be very happy lol.
Attached Images
File Type: jpg polyDualMesh - without zones.jpg (68.5 KB, 766 views)
File Type: png 8459.png (25.8 KB, 763 views)
sharonyue is offline   Reply With Quote

Old   January 11, 2015, 17:39
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi sharonyue,

Quote:
Originally Posted by sharonyue View Post
however, if there is a way I can remove the small faces at the boundaries, I will be very happy lol.
Finally managed to give a quick look into this.
As far as I can see, there is no way to remove those faces at the boundaries, since those are keeping the final mesh true to the original mesh topology.

One possible solution is to do what enGrid allows us to do, which is to add prismatic boundary layers to the surfaces, before converting to polyhedral cells. That way you will get the final mesh as you want, because those prismatic cells should already have the final desired shape.

Best regards,
Bruno
sharonyue likes this.
wyldckat is offline   Reply With Quote

Old   October 1, 2015, 15:32
Default
  #14
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
Dear Bruno,

For polydualMesh, is it possible to visualize the polyhedral cells with different numbers of faces?

In my cases, I have a mesh with polyhedral cells, which are reconstructed from a finer mesh. Now I am trying to plot it out but had some problem with it.
For paraview, if we would like to visualize the polyhedral cells, is there any particularl data format? Thank you.

best regards,
OFFO

Quote:
Originally Posted by wyldckat View Post
Hi sharonyue,


Finally managed to give a quick look into this.
As far as I can see, there is no way to remove those faces at the boundaries, since those are keeping the final mesh true to the original mesh topology.

One possible solution is to do what enGrid allows us to do, which is to add prismatic boundary layers to the surfaces, before converting to polyhedral cells. That way you will get the final mesh as you want, because those prismatic cells should already have the final desired shape.

Best regards,
Bruno
openfoammaofnepo is offline   Reply With Quote

Old   October 4, 2015, 16:26
Default
  #15
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer @OFFO: Not enough information. The best I can do is point you to this FAQ: http://openfoamwiki.net/index.php/FA...is_in_ParaView
wyldckat 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
[Other] vtk mesh or Abaqus mesh to OpenFOAM bigphil OpenFOAM Meshing & Mesh Conversion 27 November 23, 2015 17:31
[Salome] OpenFoam case and salome mesh marialiste OpenFOAM Meshing & Mesh Conversion 1 December 4, 2013 14:56
OpenFOAM Foundation releases OpenFOAM 2.2.2 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 October 14, 2013 07:18
Can't run a case in HelyxOS with an imported mesh from Fluent HHOS OpenFOAM Running, Solving & CFD 0 July 2, 2013 06:25
OpenFOAM Training and Workshop Zagreb 2628Jan2006 hjasak OpenFOAM 1 February 2, 2006 21:07


All times are GMT -4. The time now is 06:17.