-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raise Error if a Mesh Cell is skewed above threshold #235
Conversation
Changing to draft as author suggest that the PR is not ready and content needs discussion. |
Codecov Report
@@ Coverage Diff @@
## main #235 +/- ##
=======================================
Coverage 41.94% 41.94%
=======================================
Files 13 13
Lines 4005 4005
=======================================
Hits 1680 1680
Misses 2325 2325
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a very minor change in the .pyf file, otherwise, this is good to go
Purpose
I am optimising a two element-airfoil. Because of the proximity of those elements, the mesh quality deteriorates fast. To fix this, i check if the variable
adflow.killsignals.fatalfail
is set totrue
. When this is the case, I regenerate a mesh.Unfortunately, this method is to slow as the variable is only set when the mesh has negative volumes.
This PR should addresses this in the following way:
Calculate the skewness as described here. If it goes above a certain threshold defined in the regular python-wrapper (e.g.
meshMaxSkewness: 0.4
), ADflow errors out by means of settingadflow.killsignals.fatalfail
totrue
.I introduced three new options:
useSkewnessCheck
activates the the code in this PR when set toTrue
meshMaxSkewness
ADflow throws an error if one's cell skewness is above this valueprintBadlySkewedCells
prints the indices of the cells whose skewness is abovemeshMaxSkewness
(equivalent toprintNegativeVolumes
)Expected time until merged
Probably a couple of weeks.
Type of change
Testing
I copied the
cube_4x4x4.cgns
file and coarsed it to a 1x1x1 cube. I also set the wallBC on all faces. This is necesairy to prohibitidwarp
from warping everything. You find it here: cube_1x1x1.zipThe idea is to warp each face of each axis two times. Once by slightly less than 1 and the other time slightly more than 1.
Warping by 1 gives a skewness of 0.5. So i set the
meshMaxSkewness
to0.5
and test ifadflow.killsignals.fatalfail
isFalse
in the first case andTrue
in the seccond.Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable