-
Notifications
You must be signed in to change notification settings - Fork 57
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
Precise thickness and volume constraints for non-trapezoidal wings #127
Conversation
Codecov Report
@@ Coverage Diff @@
## main #127 +/- ##
==========================================
+ Coverage 62.56% 62.60% +0.04%
==========================================
Files 43 43
Lines 11186 11207 +21
==========================================
+ Hits 6998 7016 +18
- Misses 4188 4191 +3
📣 Codecov can now indicate which changes are the most critical in Pull Requests. 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.
Looks good! I just have one comment on the inputs, but it's not related to the specific additions of this PR
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.
The changes look good. I only have one minor comment on the coding style regarding the different uses of the nSpan
variable. I left it to one of the routines you added but obviously applies to both. Let me know what you think and we can either slightly modify it or I can just approve it if you don't want to make that change.
pygeo/constraints/DVCon.py
Outdated
) | ||
|
||
# nSpan needs to be the total number of sections for the remainder of the function | ||
nSpan = sum(nSpan) |
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.
I am not sure if I like this change to what nSpan
is mid-way through the routine. Initially its the list of spanwise section counts, but then it is switched to the total count. I guess it would be a bit better if we used a different variable for the total (or the span list)? I am not sure how useful my comment is but thought this type of using the same variable name for two things might be confusing?
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.
I agree that the current approach is not very clean. I can propose two alternatives that would keep nSpan
as an integer:
- Add a separate kwarg that is a list defining the fraction of
nSpan
that gets allocated to each segment, e.g.[0.5, 0.5]
. - Don't add any additional arguments. For a given uniform distribution in parametric space, 'snap' the closest point to the intermediate location and resample the curves. This would change the default behavior.
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.
Turns out Anil was referring to the variable names in the function, not the API. I will update the variable names to be clearer.
Purpose
For non-trapezoidal wings, we use
leList
andteList
with length greater than 2 to define the locations between the root and tip. However, the points currently used in the thickness and volume constraints do not exactly match these intermediate locations. This is documented behavior in DVCon.As an alternative, I added the option to pass a list for
nSpan
instead of an integer. Doing so will interpolate within each segment defined byleList
andteList
and match the intermediate locations. The behavior is unchanged if an integer is passed. I included an example of a cranked arrow wing below.Thickness constraints with
nSpan=10
:Thickness constraints with
nSpan=[5, 5]
:The constraints now match the wing break location and follow the chordwise direction.
Expected time until merged
One week
Type of change
Testing
I added tests for thickness and volume constraints with a list for
nSpan
.Checklist
flake8
andblack
to make sure the code adheres to PEP-8 and is consistently formatted