Repository navigation
Fix radian input in Polar.correction3D - #87
Merged
Merged
Conversation
ptrbortolotti
approved these changes
Nov 17, 2026
ptrbortolotti
requested review from
ebranlard
and
a balanced review from Copilot
November 17, 2026 04:30
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the degree/radian consistency fix.
No open issues 🎉
What changed in this PR
Fixes issue #22 by making Polar.correction3D() handle equivalent degree and radian inputs consistently, while preserving degree-based explicit fit limits and output angles.
Changes:
- Uses radians consistently for internal calculations, including inferred lift slope and stall angle.
- Validates that optional fit limits are supplied together and documents output angle units.
- Adds regression coverage comparing lift and drag for degree and radian inputs across default blending, Heaviside blending, and explicit fit limits.
| File | Description |
|---|---|
openfast_toolbox/airfoils/tests/test_polar_manip.py |
Adds degree/radian equivalence regression tests. |
openfast_toolbox/airfoils/Polar.py |
Corrects internal angle conversions, validates fit limits, and clarifies output units. |
Review effort: Balanced
Collaborator
|
@rthedin please feel free to merge this in |
Collaborator
|
Thanks for finding and fixing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22.
Polar.correction3D()raisesUnboundLocalErrorfor a polar stored in radians. Use radians for the calculation throughout, including the inferred lift slope and stall angle. Explicit fit limits and the returned angle array remain in degrees, as before.The new regression test uses the existing FFA-W3-241 polar to compare lift and drag for equivalent degree and radian inputs. It covers default blending, Heaviside blending, and a user-supplied fit range. Thanks to the issue reporter for identifying the unit conversions.
Validation on Windows with Python 3.13: all 10 airfoil tests passed. The full suite had 91 passes and one failure in
linearization/tests/test_modesID.py::Test::test_HD. The same failure occurred on unmodifiedmain(90 passes).git diff --checkpassed.AI disclosure: Codex assisted with implementation and tests.