mdolab / pyhyp

pyHyp generates volume meshes from surface meshes using hyperbolic marching.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unattachedEdgesAreSymmetry fails on some surface meshes

sseraj opened this issue · comments

Type of issue

  • Bug

Description

The unattachedEdgesAreSymmetry option fails on certain surface meshes. When this fails, the volume mesh generated by pyHyp will have negative volumes along the symmetry plane. It is unclear why the failure occurs. Explicitly setting the symmetry boundary condition using the BC option is a possible workaround.

I have identified what was causing this issue for my case. It is not exactly a bug, but the implementation makes an assumption that is violated in fringe cases.

In the standard case, the magnitudes of the coordinates for all nodes of an unattached edge are summed, and the coordinate direction with the minimum sum is set as the symmetry direction. This makes sense because we expect the geometry to lie flat on the symmetry plane. However, when an unattached edge is coincident with one of the coordinate axes, this method cannot be used because there will be two zero directions.

In this case, a secondary check is performed. The vectors between nodes on the boundary edge and their adjacent nodes on the first interior edge are computed, and the magnitudes of the coordinates are summed over all vectors. The coordinate direction with the maximum sum is taken to be the symmetry direction. This assumes that the aforementioned vectors point primarily in the direction normal to the symmetry plane. This assumption does not always hold, such as for a highly swept wing.

It just so happened that my flat plate delta wing is highly swept and has an unattached edge that is coincident with an axis, leading to an error in the symmetry BC assignment.

Unless someone has an idea for a more general implementation, I will do the following:

  1. Add a warning in Fortran when the secondary check is triggered
  2. Update the docs to be more specific about the failure case

I am fine with not fixing this because:

  1. This issue only affects a very small subset of geometries.
  2. There is a straightforward solution in manually setting symmetry BCs using the BC option. (Translating the surface mesh, extruding, and translating back the volume mesh also works but is a bit hacky.)

Thanks for the extensive explanation, it is clear even for those like me who do not have relevant experience on "corner cases" and tweaking with pyHyp. I am fully onboard with your plan, sounds like there is no need to a more invasive fix.
Imho you can directly copy-paste your comment above in the documentation for point 2.

Thanks for the comment. I will go ahead with this in the next few days. Any other comments or suggestions in the meantime are welcome.