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

[mesh manipulation] How to convert tetrahedral to polyhedral mesh in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2020, 22:09
Default How to convert tetrahedral to polyhedral mesh in OpenFOAM
  #1
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Hi everyone,

Hope you are fine and doing well.

I am trying to convert tetrahedral mesh to polyhedral mesh using polyDualMesh utility in OpenFOAM at:
https://openfoamwiki.net/index.php/P...esh_generation

I can work until step 4, but for the steps 5 and 6, there are some options in commands and I do not know how to use it correctly.
Could someone please help me to clear the command in steps 5 and 6.
My mesh now is as below.
Thank you in advance.
Attached Images
File Type: jpg meshconvert.jpg (183.5 KB, 151 views)
ndtrong is offline   Reply With Quote

Old   July 13, 2020, 07:17
Default
  #2
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
What are you trying to achieve? Convert a 3D tet-mesh into a 3D polyhedral mesh, or converting a 2D triangular mesh into a 2D polyhedral mesh.

Note, that the page you linked to was last modified in 2011. Things might be a little bit different now. The page you linked to, seems to be specifically about 2D meshes.

For a 3D mesh, I use the following steps:
  • import a tet mesh, e.g. ideasUNVToFoam
  • run polyDualMesh to create a polyhedral mesh
  • run combinePatchFaces to clean up the mesh

See the attached images for each step.
Attached Images
File Type: jpg cylinder.jpg (53.0 KB, 242 views)
File Type: jpg polyhedralMesh.jpg (47.2 KB, 231 views)
File Type: jpg combineFaces.jpg (46.0 KB, 231 views)
ndtrong and Nikoonz like this.
GerhardHolzinger is offline   Reply With Quote

Old   July 13, 2020, 09:10
Default
  #3
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
What are you trying to achieve? Convert a 3D tet-mesh into a 3D polyhedral mesh, or converting a 2D triangular mesh into a 2D polyhedral mesh.



Note, that the page you linked to was last modified in 2011. Things might be a little bit different now. The page you linked to, seems to be specifically about 2D meshes.



For a 3D mesh, I use the following steps:


  • import a tet mesh, e.g. ideasUNVToFoam
  • run polyDualMesh to create a polyhedral mesh
  • run combinePatchFaces to clean up the mesh



See the attached images for each step.


Hi,

Thanks for your comment
I am trying to convert 2D tetra to 2D polyhedral.
I understand that there are some modifications in that link then I do not know how to work correctly with that.
Could you please share with me some hints with setSet and subsetMesh. I really don’t understand it well.
ndtrong is offline   Reply With Quote

Old   July 14, 2020, 03:12
Default
  #4
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
For a 2D mesh, I would recommend the following approach:
  • Convert the 2D triangular mesh into a polyhedral mesh *
  • Extrude one cell layer from the front or back patch, discard the initial mesh


* Note: OpenFOAM only deals with 3D meshes, even in 2D cases. In a 2D case, the mesh is one cell in thickness. Thus, a triangular 2D mesh is in reality a prismatic mesh, with cells having a triangular base.

See the attached images for some snapshots of the process.
Attached Images
File Type: jpg elbowPolyDualMesh.jpg (63.3 KB, 145 views)
File Type: jpg elbowPolyExtruded.jpg (69.6 KB, 138 views)
GerhardHolzinger is offline   Reply With Quote

Old   July 14, 2020, 04:11
Default
  #5
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
For a 2D mesh, I would recommend the following approach:
  • Convert the 2D triangular mesh into a polyhedral mesh *
  • Extrude one cell layer from the front or back patch, discard the initial mesh


* Note: OpenFOAM only deals with 3D meshes, even in 2D cases. In a 2D case, the mesh is one cell in thickness. Thus, a triangular 2D mesh is in reality a prismatic mesh, with cells having a triangular base.

See the attached images for some snapshots of the process.
Thanks for your guidance,

Yes, I have already converted 2D triangular mesh into polyhedral mesh with step 2+3 as in tutorial and my mesh now has 2 layers as your 1st figure (please see the attachement).
However, I do not know how to extrude one cell layer from the front or back as you said and how to discard the initial mesh
Attached Images
File Type: jpg meshconvert_02.jpg (141.1 KB, 101 views)
ndtrong is offline   Reply With Quote

Old   July 16, 2020, 06:35
Default
  #6
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
For a 2D mesh, I would recommend the following approach:
  • Convert the 2D triangular mesh into a polyhedral mesh *
  • Extrude one cell layer from the front or back patch, discard the initial mesh


* Note: OpenFOAM only deals with 3D meshes, even in 2D cases. In a 2D case, the mesh is one cell in thickness. Thus, a triangular 2D mesh is in reality a prismatic mesh, with cells having a triangular base.

See the attached images for some snapshots of the process.
Hi,

I can make both front and back are polyhedral cell mesh but I do not know why my internalMesh is strange like this.

Could you please help me to explain it.
Attached Images
File Type: jpg back.jpg (88.1 KB, 107 views)
File Type: jpg front.jpg (87.9 KB, 90 views)
File Type: jpg internalMesh.jpg (118.7 KB, 104 views)
ndtrong is offline   Reply With Quote

Old   July 16, 2020, 16:01
Default
  #7
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Quote:
Originally Posted by ndtrong View Post
Thanks for your guidance,

Yes, I have already converted 2D triangular mesh into polyhedral mesh with step 2+3 as in tutorial and my mesh now has 2 layers as your 1st figure (please see the attachement).
However, I do not know how to extrude one cell layer from the front or back as you said and how to discard the initial mesh



See the commented extrudeMeshDict of OpenFOAM, e.g. here https://github.com/OpenFOAM/OpenFOAM...xtrudeMeshDict


This should be rather self-explanatory.
GerhardHolzinger is offline   Reply With Quote

Old   July 16, 2020, 21:20
Default
  #8
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
See the commented extrudeMeshDict of OpenFOAM, e.g. here https://github.com/OpenFOAM/OpenFOAM...xtrudeMeshDict


This should be rather self-explanatory.
Thank you so much for your suggestion with your link
The problem has been solved.
ndtrong 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
Problem converting from Tetrahedral to Polyhedral Mesh iakov1703 ANSYS 6 February 19, 2022 14:58
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
[CAD formats] Can OpenFOAM convert foam mesh to stl? liying02ts OpenFOAM Meshing & Mesh Conversion 10 December 30, 2018 10:03
[Other] vtk mesh or Abaqus mesh to OpenFOAM bigphil OpenFOAM Meshing & Mesh Conversion 27 November 23, 2015 17:31
[Technical] is possible to do tetrahedral or polyhedral mesh OpenFoam?? Ale_galleria OpenFOAM Meshing & Mesh Conversion 2 January 11, 2011 06:06


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