CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing Format & General Technical (http://www.cfd-online.com/Forums/openfoam-meshing-technical/)
-   -   Polyhedral mesh generation (http://www.cfd-online.com/Forums/openfoam-meshing-technical/61911-polyhedral-mesh-generation.html)

lr103476 September 8, 2006 10:25

Hi, Does anyone know if the
 
Hi,

Does anyone know if the current version OpenFOAM 1.3 has the capability of polyhedral mesh generation such that 2d cells has 6 faces or more.

The following link shows what I mean, but I dont know to what extend this link is up to date:

http://www.mfix.org/mwiki/index.php/Mesh_Handling%2C_Generation_and_Conversion#P olyhedral_Mesh_Generation

If not ready in the current version, does anyone know an open-source alternative until this blockMesh utility is made ready to handle this.

Regards, Frank

olesen September 8, 2006 10:34

I thought that polyDualMesh mi
 
I thought that polyDualMesh might have helped with creating one from a tet mesh.
Haven't tried it myself though.
Let us know how you fare.

/mark

bastil December 2, 2007 09:11

Hi all, I tried to convert
 
Hi all,

I tried to convert a tet mesh into a polyhedral mesh using polyDualMesh. This seems to work.

However, visualising this mesh seems to be challenging. I do not know a open source tool ou there that is capable in visualising these polyhedral meshes, am I right? Or is there an opportunity?

lillberg December 2, 2007 09:53

Hi, Convert to VTK (foamToV
 
Hi,

Convert to VTK (foamToVTK) and use latest paraview binaries 3.2.1, available at http://www.paraview.org/New/download.html

Regards

//Eric

hsieh December 2, 2007 10:13

Hi, Can someone explain exa
 
Hi,

Can someone explain exactly what polyDualMesh do? What will be the benefits of going from Tet to polyhedral mesh in this case (by combining Tets) except for fewer elements (but will have the same number of faces, correct)?

Thanks!

Pei

lillberg December 2, 2007 10:26

Not exactly! You reduce the nu
 
Not exactly! You reduce the number of cells with approximately 80% and the number of faces only with 20% which gives you a lot smaller dataset to carry around. In the same time you have almost the same accuracy since it primarily depends on the number of faces. You'll have an increase in typical dX with some 20-50% but your degrees of freedom in the mesh are almost the same.

//Eric

bastil December 2, 2007 10:27

Thanks Erik, I will try. Is pa
 
Thanks Erik, I will try. Is paraview now able to handle Polyhedral? Is this also true for foamTovtk from OF 1.4.1?

BastiL



Hi,

Convert to VTK (foamToVTK) and use latest paraview binaries 3.2.1, available at http://www.paraview.org/New/download.html

Regards

//Eric

bastil December 2, 2007 10:43

I get the following using foam
 
I get the following using foamToVTK of OF 1.4.1:

#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 ?? in "/lib/libc.so.6"
#3 Foam::polyMesh::readUpdate() in "/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#4 Foam::fvMesh::readUpdate() in "/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libfiniteVolume.so"
#5 Foam::vtkMesh::readUpdate() in "/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linux64GccDPOpt/foamToVTK"
#6 main in "/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linux64GccDPOpt/foamToVTK"
#7 __libc_start_main in "/lib/libc.so.6"
#8 Foam::regIOobject::readIfModified() in "/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linux64GccDPOpt/foamToVTK"
segmentation fault

No VTK is finally created

lillberg December 2, 2007 11:24

Hmm... strange, never had any
 
Hmm... strange, never had any problems with VTK conversion. Try -latestTime switch if you have something incompatible in the other time directories. Make sure you don't have any fields in the time directory you're trying to convert to VTK that where not created from defaults or through running mapFields.

//Eric

lillberg December 2, 2007 11:26

Here's an image of a hex/polyH
 
Here's an image of a hex/polyHedral mesh as seen in paraview 3.3.0

http://www.cfd-online.com/OpenFOAM_D...ges/1/6040.gif

lillberg December 2, 2007 11:59

Ooops... that picture didn't c
 
Ooops... that picture didn't come out very well, let's try this one

http://www.cfd-online.com/OpenFOAM_D...ges/1/6042.gif

bastil December 2, 2007 12:04

I am sorry the picture is litt
 
I am sorry the picture is little small I can not see much... Paraview 3.3.0 is a internal development version as it can not be downloaded so far, right? However 3.2.1 should be ok?

I tried to reconstruct what is happening: I have a tetra-mesh with prism-layers. Checkmesh reports no errors. Afterwards using polyDualMesh (feature angle 90deg, do not know what this is good for?) i get warnings:

--> FOAM Warning :
From function calcDual
in file polyDualMesh.C at line 1140
Incorrect orientation on internal edge:463769(0.341353 -0.196117 0.301625)(0.341353 -0.196956 0.302462)

I get this for different edges... Afterwards CheckMesh crashes with a segmentation fault. Seems like there is a problem....

bastil December 2, 2007 12:06

Hi Eric, thanks for the lar
 
Hi Eric,

thanks for the larger picture - your meshes look extremly nice. ehat tools do you use for generating theses hybrid hexa-poly meshes? Any ideas about my conversation problems?

BastiL

lillberg December 2, 2007 14:22

Try something smaller than 90
 
Try something smaller than 90 deg feature angle since it represents the maximum angle between two neighboring surface normals on a surface without corners. That is, the mesh will consider your surface shape a corner if the angel is larger than this value. I typically use something between 45 and 80 depending on the tet mesh resolution on highly curved surfaces. This might be the root of your problem. Looking at my picture the curved surface in the middle would (wrongly) be treated as a corner if the feature angle was set to some 30 deg. Here I used 75 degrees, but anything abowe 45 usually works. In your case virtually no corners are treated as such.

I often use Gambit or T-grid for tet/hex + tet-prism b-layer mesh generation and then convert the mesh using polyDualMesh. The result is in the picture.

Good luck!

//Eric

lillberg December 2, 2007 14:36

Btw, the latest paraview is do
 
Btw, the latest paraview is downloadable from the same site using the svn repos found at the end of the page. Compilation is really easy, just follow the instructions supplied with the distro.

//Eric

bastil December 2, 2007 15:37

Hi Eric, thanks so much for
 
Hi Eric,

thanks so much for your great help and explanation of feaure angle. I tried different feature angles now and still have trouble with it. I found out first warnings different from the others:

Create time

Create polyMesh for time = 0

Feature:60
minCos :0.5

--> FOAM Warning :
From function boundBox::boundBox(const pointField& points)
in file meshes/boundBox/boundBox.C at line 52
cannot find bounding box for zero sized pointFieldreturning zero
--> FOAM Warning :
From function calcDual
in file polyDualMesh.C at line 1025
Incorrect orientation on boundary edge:40913(0.0449507 -0.177984 0.283496)(0.0485079 -0.180224 0.285736)

... more edge warnings ....

--> FOAM Warning :
From function calcDual
in file polyDualMesh.C at line 1140
Incorrect orientation on internal edge:463772(0.333385 -0.196118 0.301625)(0.333385 -0.196957 0.302462)
nInternalFaces:964348
nFaces:1004682
nCells:190892
nFaces:1004682 patchSizes:
11
(
172
176
5329
7507
7322
2802
4224
1362
1715
7990
1735
)
patchStarts:
11
(
964348
964520
964696
970025
977532
984854
987656
991880
993242
994957
1002947
)

Writing dualMesh to 1
End

As mentioned before: CheckMesh reports no errors on the tet-Mesh but stops with a segmentation fault while checking the poly mesh.

lillberg December 2, 2007 17:50

Seems to me that your original
 
Seems to me that your original mesh is wrong somehow .
How did you generate it?
What does checkMesh tell you about the original mesh?
Are there any strange geometrical features in your mesh, like zero thickness walls, interior faces etc.

//Eric

bastil December 2, 2007 18:27

Hi Eric, its a tetrahedral
 
Hi Eric,

its a tetrahedral mesh with prism layers generated in GridPro. It runs well and CheckMesh thinks its ok:

Create polyMesh for time = constant

Time = constant

Mesh stats
points: 190892
edges: 964348
faces: 1412547
internal faces: 1336849
cells: 639090
boundary patches: 11
point zones: 0
face zones: 0
cell zones: 2

Number of cells of each type:
hexahedra: 0
prisms: 193036
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 446054
polyhedra: 0

Checking topology...
Boundary definition OK.
Point usage OK.
Upper triangular ordering OK.
Topological cell zip-up check OK.
Face vertices OK.
Face-face connectivity OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface
wt-inlet 296 172 ok (not multiply connected)
wt-outlet 304 176 ok (not multiply connected)
wt-walls 10119 5231 ok (not multiply connected)
a.forebody 14611 7417 ok (not multiply connected)
a.side 14275 7322 ok (not multiply connected)
a.top 5362 2802 ok (not multiply connected)
a.bot 8138 4224 ok (not multiply connected)
a.baklite 2586 1362 ok (not multiply connected)
a.rear 3287 1715 ok (not multiply connected)
wt-sym 15332 7990 ok (not multiply connected)
wt-sym-quad:22 1388 1735 ok (not multiply connected)

Checking geometry...
Domain bounding box: (-1 -1 -0.05) (4 5.0354e-07 1.24999)
Boundary openness (1.57876e-17 1.28209e-15 6.74944e-17) OK.
Max cell openness = 3.60863e-16 OK.
Max aspect ratio = 11.0021 OK.
Minumum face area = 4.52742e-07. Maximum face area = 0.0133246. Face area magnitudes OK.
Min volume = 1.71943e-10. Max volume = 0.000443001. Total volume = 6.44374. Cell volumes OK.
Mesh non-orthogonality Max: 67.352 average: 17.3122
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 2.39857 OK.
Min/max edge length = 0.000557864 0.206334 OK.
All angles in faces OK.
Face flatness (1 = flat, 0 = butterfly) : average = 0.999968 min = 0.998242
All face flatness OK.

Mesh OK.

End

It has no special features like internal walls.

BastiL

mattijs December 3, 2007 13:45

Haven't seen this problem befo
 
Haven't seen this problem before with polyDualMesh. Can you ship the tet mesh so I can try it over here?

(m dot janssens at opencfd.co.uk)

bastil December 3, 2007 15:05

Hi Matthijs, I sent you an
 
Hi Matthijs,

I sent you an email. Hopefully it is not to large.

BastiL


All times are GMT -4. The time now is 08:38.