fix bug in bldprcnt following issue #3416 - #3424
Merged
Merged
Conversation
andrew-platt
approved these changes
Aug 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an edge-case in AeroDyn’s AeroAcoustics span-selection logic so that BldPrcnt=100 correctly uses the full blade span (instead of falling back to only the outermost nodes), aligning behavior with the documented meaning and the reported bug in #3416.
Changes:
- Changes the
startnodefallback initialization tomin(NumBlNds, 2)so “no node satisfies threshold” correctly degrades to “use the whole blade”. - Removes the now-redundant post-loop clamp of
startnode. - Adds a warning when
BldPrcntis smaller than the last blade element size (i.e., when the minimum-possible span selection is implicitly used).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Work on issue #3416
Thank you @Sparsh-Sharma for the detailed issue. You are very right that the code breaks for
BldPrcnt=100. Surprisingly enough, we never set it to 100%, and we never noticed the problem.I've adopted your suggestion of setting
p%startnode = min(p%NumBlNds, 2)instead ofp%startnode = max(1, p%NumBlNds - 1).Next, I think I am good to remove the check
p%startnode = max(min(p%NumBlNds,2),p%startnode), which should never be triggeredLastly, I added a warning if
BldPrcntis smaller than the last element size. I think that's the warning you were recommending. You wrote 'A warning ifBldPrcntis large enough that no node satisfies the threshold might also be worth adding, since the condition is silent today.', but I was a little lost. I think this happens whenBldPrcntis too small, not 'large enough'. Let me know if I am still missing something.I will also improve the documentation in the r-tests now