Difference between revisions of "Polyhedral mesh generation"

From OpenFOAMWiki
(2D polyhedral mesh initial article)
 
(Added combinePatchFaces to list, fixed enumeration)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
  
 
In that case, the workflow is as follows:
 
In that case, the workflow is as follows:
1. Import a tetrahedral mesh into OpenFoam, e. g. by using gmshToFoam
+
# Import a tetrahedral mesh into OpenFoam, e. g. by using gmshToFoam <br> [[File:Original tet.png|250px]]
2. Generate a polyhedral mesh using polyDualMesh. polyDualMesh will put the new mesh into a new time directory "latestTime + deltaT"
+
# Generate a polyhedral mesh using polyDualMesh. polyDualMesh will put the new mesh into a new time directory "latestTime + deltaT"
3. Move the polymesh files from the new directory (e. g. "0.1/polyMesh/*") to the base mesh folder (e. g. "constant/polyMesh/"). After running polyDualMesh, your mesh will have two cells in the third dimension, which is not what you want to have in a 2D case.
+
# Move the polymesh files from the new directory (e. g. "0.1/polyMesh/*") to the base mesh folder (e. g. "constant/polyMesh/"). After running polyDualMesh, your mesh will have two cells in the third dimension, which is not what you want to have in a 2D case. <br> [[File:PolyDualMesh.png|250px]]
4. Delete the time directory (e. g. 0.1)
+
# Delete the time directory (e. g. 0.1)
5. run the setSet application to create a cell set that contains only one layer of cells
+
# run the setSet application to create a cell set that contains only one layer of cells
6. run subsetMesh to create a new mesh that contains only the previously selected cell set
+
# run subsetMesh to create a new mesh that contains only the previously selected cell set <br> [[File:CleanPolyMesh.png|250px]]
 +
# run combinePatchFaces to fix the count mismatch of faces on both sides of the patch (after the previous step the front and back patches will not have the same count of faces)
 +
 
 +
 
 +
Sample case: [[File:Autopoly.tar.gz]]

Latest revision as of 17:32, 23 June 2011

You can generate a polyhedral mesh from a tetrahedral mesh using the utility polyDualMesh. This is fairly straightforward, unless you are trying to generate a 2D polyhedral mesh.

In that case, the workflow is as follows:

  1. Import a tetrahedral mesh into OpenFoam, e. g. by using gmshToFoam
    Original tet.png
  2. Generate a polyhedral mesh using polyDualMesh. polyDualMesh will put the new mesh into a new time directory "latestTime + deltaT"
  3. Move the polymesh files from the new directory (e. g. "0.1/polyMesh/*") to the base mesh folder (e. g. "constant/polyMesh/"). After running polyDualMesh, your mesh will have two cells in the third dimension, which is not what you want to have in a 2D case.
    PolyDualMesh.png
  4. Delete the time directory (e. g. 0.1)
  5. run the setSet application to create a cell set that contains only one layer of cells
  6. run subsetMesh to create a new mesh that contains only the previously selected cell set
    CleanPolyMesh.png
  7. run combinePatchFaces to fix the count mismatch of faces on both sides of the patch (after the previous step the front and back patches will not have the same count of faces)


Sample case: File:Autopoly.tar.gz