AWAE: bugfix -- IfW needs HubPosition and rotor rad #1476
Merged
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.
This PR is ready for merging.
Feature or improvement description
InflowWind always calculates the disk average velocity and the velocity at the hub. AWAE was not setting the HubPosition or the RotorRad variables for IfW. So depending on the compiler and optimizations, IfW would sometimes fail in AWAE when the wrong random garbage was in those memory locations (interestingly the GH compiler did not trip on this issue). This was found using GCC 10.4.0 on a mac with double precision release compiles.
Related issue, if one exists
The disk average outputs were introduced in #1240, which was merged in Oct 2022 for the 3.4.0 release. Surprisingly this did not cause issues until recently.
Impacted areas of the software
Only the AWAE module is affected, and only with certain compiler and optimizations.
Additional supporting information
Interestingly, commit
fd5cb5b5a
on the dev branch (just before the QuKi merge #1453) worked just fine. However nothing in #1453 should have any affect whatsoever on this. Also, this problem would vanish when run in debug.Test results, if applicable
Test results for the
TSinflow
andLESinflow
would occasionally fail with the above error (or similar) on some systems. Those now pass properly.