|
[Sponsors] |
July 17, 2005, 12:45 |
GmshToFoam correct face orientation
|
#1 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Hello,
I built a mesh using gmsh and converted it to FOAM using gmshToFoam. When I run checkMesh, I get the following error: Owner cell vertex labels: 8(31771 10586 1329 10765 10591 1330 10764 31766) bool primitiveMesh::checkFacePyramids(const bool, const scalar, labelHashSet*) const: face 93327 points the wrong way. Pyramid volume: -3.34611e-09 Face 4(10765 1328 47 1329) area: 5.23744e-06 Ownercell: 28043 Owner cell vertex labels: 8(10586 1329 47 1341 10581 1328 10765 31771) --> FOAM Serious Error : Error in face pyramids: faces pointing the wrong way! Writing 29260 faces with incorrect orientation to set wrongOrientedFaces It seems there is a problem with the orientation of some faces. I would like to know if openFOAM has a tool to correct the above error. Because in gmsh I can't seem to correct the problem. |
|
July 18, 2005, 03:34 |
Hi,
Try the modified gmshTo
|
#2 |
Member
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17 |
Hi,
Try the modified gmshToFoam from this forum, see if it helps. Ervin |
|
July 29, 2005, 13:29 |
Yes, this version works OK.
|
#3 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Yes, this version works OK.
Although it would be nice if the program could automatically detect if the element needs to be inverted or not. Because I ended up converting the mesh, assigning BC, solving and then I used the -invertHex option and did it all again. I also have only tested it with a mesh in which all elements needed to be inverted. I haven't tested it with a mesh that has some elements that need to be inverted and others that do not. |
|
August 2, 2005, 20:48 |
I just tested this version in
|
#4 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
I just tested this version in a mesh where only some elements needed to be inverted and it did not work. I tried to modify the gmshToFoam to detect and invert automatically but I don't know the specific functions to do that.
What I wanted to do was to compute dot product of the normal of a face with the vector from the face center point to the element centroid point. Maybe computing the volume could also indicate the if the element needs to be inverted or not. Any suggestions? |
|
August 3, 2005, 18:32 |
element centroid:
when you
|
#5 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
element centroid:
when you have a cellShape: (cells[cellI++] = cellShape(tet, tetPoints)) you can ask it for its centre (see cellShape.H). You can also ask for the faces of the cellShape (cellShape::faces) and each of the faces for their centre and area vector (face.H) If you have something working & tested can you send it back? |
|
August 4, 2005, 18:01 |
Hi Mattijs Janssens,
I alre
|
#6 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Hi Mattijs Janssens,
I already fixed this problem using my own routine in C to invert the whole mesh in the same direction (outwards or inwards). I can send you this code if you like. However, I think it would "nicer" to do it using OpenFOAM classes. |
|
August 5, 2005, 12:57 |
I agree it would be nicer. You
|
#7 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
I agree it would be nicer. You feel like adding it to gmshToFoam? With a bit of searching you should be able to find out the information you need.
The Foam orientation of cells is somewhere in the user guide (chapter 6 i think) |
|
August 5, 2005, 13:45 |
Hi Mattijs Janssens,
I ju
|
#8 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Hi Mattijs Janssens,
I just altered the gmshToFoam.C file: gmshToFoam.C Please note, I haven't tested it on meshes with prisms. Although it produces several warnings, it seems to work with hexahedral mesh. Please give it a try. |
|
August 8, 2005, 15:16 |
Hi Billy,
thanks. I changed
|
#9 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Hi Billy,
thanks. I changed it to test on cellShape and put the inverting under a switch. Seems to work for prism cases as well. gmshToFoam.C |
|
August 8, 2005, 16:19 |
Hi Mattijs Janssens,
It loo
|
#10 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Hi Mattijs Janssens,
It looks like a better implementation than mine. I have tested it on a hexahedral mesh and it worked OK. However, is it possible to hide those warnings during conversion? It seems to slow down the process. |
|
August 8, 2005, 17:47 |
Hi Billy,
Could you warn th
|
#11 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Hi Billy,
Could you warn the GMSH author that his cell shape orientation is incorrect? I think it should be solved in gmsh. I'd rather not hide the warning in Foam. If it is terminal output that is slowing you down redirect gmshToFoam output to a file. |
|
October 26, 2005, 15:35 |
Hi,
I just tried to convert
|
#12 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Hi,
I just tried to convert a gmsh file with only prisms and autoinvert gave me a strange result. Maybe it is not working with prisms or there is a mixup with gmsh orientation. |
|
October 26, 2005, 16:11 |
I altered the gmshToFoam file
|
#13 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
I altered the gmshToFoam file and this reordering seems to work better:
// Reorder prism. prismPoints[0] = cell[3]; prismPoints[1] = cell[4]; prismPoints[2] = cell[5]; prismPoints[3] = cell[0]; prismPoints[4] = cell[1]; prismPoints[5] = cell[2]; |
|
November 25, 2005, 15:42 |
There is a new gmsh out (1.61)
|
#14 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
There is a new gmsh out (1.61) which says in the changelog:
"hexas and prisms are now always saved with positive volume" !! Can someone test this and get back to me? |
|
November 26, 2005, 13:54 |
Hi,
I have already download
|
#15 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Hi,
I have already downloaded it and it looks good. I also like the STL remesher! |
|
November 26, 2005, 14:01 |
So the 1.2 gmshToFoam works wi
|
#16 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
So the 1.2 gmshToFoam works without any switches or your changes?
|
|
November 26, 2005, 14:08 |
I haven't tested that yet. I o
|
#17 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
I haven't tested that yet. I only installed the windows version for now, but I will test it in a few days.
|
|
November 26, 2005, 15:20 |
Hi,
I tested with both pris
|
#18 |
Senior Member
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17 |
Hi,
I tested with both prisms and hexas and it seems that using this new version of gmsh (1.61), you do not need -autoInvert switch. I imported them using gmshToFoam and then tested them using checkMesh. I didn't actually run a simulation on them yet. |
|
November 27, 2005, 05:55 |
Excellent news!
checkMesh s
|
#19 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Excellent news!
checkMesh should be good enough. |
|
November 27, 2005, 07:40 |
Hi,
I tried this new gmsh (
|
#20 |
Guest
Posts: n/a
|
Hi,
I tried this new gmsh (1.61) on some .stl file but got some error when I tried gmshToFoam, perhaps I did something wrong. I haven't tried this program before. Looks nice anyway. And gmsh can do hex-meshing (bodyfitted)? If so, I think I'll take a closer look but I have no earlier experience with gmsh... You use it as preprocessor instead of blockMesh, right? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Error while running SnappyHex in parallel | mg.mithun | OpenFOAM Meshing & Mesh Conversion | 1 | February 10, 2016 13:13 |
could not correct the face handedness for ... | oozcan | FLUENT | 2 | February 10, 2016 12:30 |
Error message: 8 face(s) not in face lists of adjacent cells | jyoung79 | FLUENT | 0 | November 10, 2012 16:09 |
correct the face handedness | kk | FLUENT | 4 | February 16, 2007 09:42 |
Orientation of Face Variable Macros | hirokata | FLUENT | 0 | February 17, 2006 00:12 |