CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Technical] How does checkMesh calculate wrongOrientedFaces (https://www.cfd-online.com/Forums/openfoam-meshing/254728-how-does-checkmesh-calculate-wrongorientedfaces.html)

yjhp1016 February 27, 2024 18:02

How does checkMesh calculate wrongOrientedFaces
 
Hello, I often get error:" Error in face pyramids: 2 faces are incorrectly oriented." when I do checkMesh. I'm wondering how does checkMesh calculate this? I tried hard in reading source code, but didn't get the idea. Thanks for your help :)

cibanez March 7, 2024 03:24

Hi,

To check how those faces look like I recommend you to run checkMesh -writeAllFields to write the faceSet with wrongOrientedFaces and then foamToVTK -faceSet wrongOrientedFaces to generate a file in VTK/faceSet that you can open in Paraview.

A face is categorized as wrongly oriented when the facePyramidVolume becomes negative

Here you can see how a face is categorized as wrongly oriented when its face pyramid volume becames negative:
https://develop.openfoam.com/Develop...shCheck.C#L468

Here you can see how the pyramid volumes are being called. The signs make the volumes positive because the normal face vector points away from the owner cell:
https://develop.openfoam.com/Develop...shTools.C#L582

Here you can check the equation that is used to calculate the pyramid volume. This volume becomes negative when the angle between the height and the face normal is more than 90 degrees. The height vector goes from the face center to the cell center (apex) of either the neighbour or the owner cell.
https://develop.openfoam.com/Develop...pyramidI.H#L80

This means that you will get a wrongly oriented face when the normal of a face points in the opposite direction is supposed to. For a boundary face this means the face is so warped that the normal of the face points inwards to the computational domain instead of outwards.


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