Skip to content
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

AllBldOuts more forgiving and support for 0 #728

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

ebranlard
Copy link
Contributor

Ready to merge

Feature or improvement description
AllBldNdsOuts would fail if the user specified 0 blades or more than the current number of blades. This fix is more forgiving, and returns when the number of outputs is 0 to avoid accessing some unallocated array.

Impacted areas of the software
AeroDyn

Copy link
Collaborator

@andrew-platt andrew-platt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@bjonkman
Copy link
Contributor

@ebranlard, I'm trying to understand where it might have accessed an unallocated array. It looks like the loops would go from 1 to 0, which means they would (should?) be skipped. Did you actually experience that behavior, other than just not generating ANY blade output if, for example, you had set this to output 3 blades on a 2 blade turbine?

@ebranlard
Copy link
Contributor Author

If I recall, the issue occurs about line 222, p%BldNd_NumOuts is >0, but p%BldNd_OutParam is not allocated, which is likely the real issue (I didn't take care of it). I've seen the issue either by setting the BldNd_BladesOut=0 or BldNd_BladesOut>NumBlades. In all cases, I have several channels in OutListAD.

@bjonkman
Copy link
Contributor

Thanks! I'll look closer. I'm pretty sure this logic is used in ElastoDyn and BeamDyn, too, so I wanted to double check (though they might not get to that part of the code if there aren't any blades).

bjonkman added a commit to bjonkman/openfast that referenced this pull request Apr 26, 2021
andrew-platt pushed a commit that referenced this pull request Apr 27, 2021
* ED: AllBldOuts more forgiving and support for 0

ED equivalent of #728
@rafmudaf rafmudaf mentioned this pull request May 12, 2021
11 tasks
@ebranlard ebranlard deleted the f/allnds branch May 26, 2021 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants