Wrong face normals after Mesh conversion (OpenFOAM)

Hello everyone,

I am not sure if this is the correct forum to post questions about VMTK mesh generation and conversion as it is not available in Slicer directly afaik. But I hope that you can still give me a hint to solve my problem.

I generate a volume mesh using VMTK and want to use it for my OpenFOAM CFD simulations. So vmtkmeshgenerator → tetrahedralize → vmtkmeshwrite to fluent .msh → fluent3DMeshToFoam.
This works well when I don’t generate a boundary layer with VMTK and checkMesh(OpenFOAM utility to check mesh quality) is happy with the result. As soon as I add a boundary layer, checkMesh complains about Boundary openness, open cells, incorrect orientation of faces and some more.
I looked at the nonClosedCells in Paraview and found that after either the conversion from .vtu to .msh or from .msh to OpenFOAM, some surface normals get flipped (point inside).
Has someone experienced something similar?

I also want to thank everyone who contributes to the VMTK and the community, the tool is quite awesome :slight_smile:

Out of prior experience OpenFOAM doesn’t care about the normal directions. Can you post the checkMesh log after you add boundary layers?

Thank you for the answer!
Maybe the normals are not even the problem. But it was a difference I observed in ParaView when I compared the .vtu and the OpenFOAM mesh. Anyways, I added the output of checkMesh. Without boundary layer all checks pass.

Mesh stats
points: 262435
faces: 2858629
internal faces: 2723203
cells: 1395458
faces per cell: 4
boundary patches: 18
point zones: 0
face zones: 1
cell zones: 1

Overall number of cells of each type:
hexahedra: 0
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 1395458
polyhedra: 0

Checking topology…
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces…
Patch Faces Points Surface topology
surface3 134655 67421 ok (non-closed singly connected)
surface4 44 29 ok (non-closed singly connected)
surface5 53 35 ok (non-closed singly connected)
surface6 45 30 ok (non-closed singly connected)
surface7 45 30 ok (non-closed singly connected)
surface8 45 30 ok (non-closed singly connected)
surface9 45 30 ok (non-closed singly connected)
surface10 42 28 ok (non-closed singly connected)
surface11 47 31 ok (non-closed singly connected)
surface12 47 31 ok (non-closed singly connected)
surface13 41 27 ok (non-closed singly connected)
surface14 44 29 ok (non-closed singly connected)
surface15 47 31 ok (non-closed singly connected)
surface16 44 29 ok (non-closed singly connected)
surface17 44 29 ok (non-closed singly connected)
surface18 47 31 ok (non-closed singly connected)
surface19 45 30 ok (non-closed singly connected)
surface20 46 31 ok (non-closed singly connected)

Checking faceZone topology for multiply connected surfaces…
FaceZone Faces Points Surface topology
default-interior 2723203 262435 multiply connected (shared edge)
<<Writing 262406 conflicting points to set nonManifoldPoints

Checking basic cellZone addressing…
CellZone Cells Points Volume BoundingBox
blood 1395458 262435 45977.86658932771 (119.41390991 91.79798126199999 54.573120117) (265.490448 360.74209595 372.64675903)

Checking geometry…
Overall domain bounding box (119.41390991 91.79798126199999 54.573120117) (265.490448 360.74209595 372.64675903)
Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
Mesh has 3 solution (non-empty) directions (1 1 1)
***Boundary openness (-7.382893700545746e-05 -0.0002968648354511357 5.438690675129859e-05) possible hole in boundary description.
***Open cells found, max cell openness: 1, number of open cells 194
<<Writing 194 non closed cells to set nonClosedCells
<<Writing 15 cells with high aspect ratio to set highAspectRatioCells
Minimum face area = 0.0005043367761588986. Maximum face area = 3.372726896690943. Face area magnitudes OK.
***Zero or negative cell volume detected. Minimum negative volume: -3.641907377523641e-15, Number of negative volume cells: 8
<<Writing 8 zero volume cells to set zeroVolumeCells
Mesh non-orthogonality Max: 167.3542963814607 average: 25.91906820336919
*Number of severely non-orthogonal (> 70 degrees) faces: 610.
***Number of non-orthogonality errors: 161.
<<Writing 771 non-orthogonal faces to set nonOrthoFaces
***Error in face pyramids: 207 faces are incorrectly oriented.
<<Writing 205 faces with incorrect orientation to set wrongOrientedFaces
***Max skewness = 521.9001544542002, 32 highly skew faces detected which may impair the quality of the results
<<Writing 32 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 6 mesh checks.

End

I lowered the edgelengthfactor for vmtkmeshgenerator and this finer mesh (with boundary layer) passes all checkMesh tests.

2 Likes