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

Fix for repeated calls to calculate_wake returning incorrect values. #381

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

bayc
Copy link
Collaborator

@bayc bayc commented Mar 9, 2022

Not ready to be merged

Feature or improvement description
This bugfix adds _sorted versions of the respective variables that get sorted based on wind direction during the initialization step for use within the solver. In the finalize step after the solve completes, the sorted variables are unsorted and stored in a new variable, therefore allowing repeated calls to calculate_wake and maintaining the sorting of the required variables.

Related issue, if one exists
Closes #378

Impacted areas of the software
Most of the simulation software, though I am not 100% that I have properly covered all the initialization of the variables (@rafmudaf could use your eyes here).

Additional supporting information
The code in issue #378 now produces the expected result of:

image

@bayc bayc added bug Something isn't working v3 Label to denote focus on v3 labels Mar 9, 2022
@bayc bayc added this to the v3.1.0 milestone Mar 9, 2022
@bayc bayc requested review from paulf81 and rafmudaf March 9, 2022 00:19
@bayc bayc self-assigned this Mar 9, 2022
@paulf81
Copy link
Collaborator

paulf81 commented Mar 9, 2022

thanks @bayc ! I made the following checks:

-example 1: Results are unchanged compared to when run on main branch

  • example 7: AEP result is unchanged when I add additional unnecessary calls to calculate wake
    -example 2: Visualizations all look reasonable
    -example 14: Visualization looks reasonable
  • other examples: Work as expected

Looks good!

@bayc
Copy link
Collaborator Author

bayc commented Mar 29, 2022

@rafmudaf I updated the tests here to use the _sorted versions of u, v, w and x, y, z. Let me know what you think!

@bayc bayc changed the base branch from main to develop March 31, 2022 15:42
@bayc bayc merged commit 2341a1b into NREL:develop Mar 31, 2022
@bayc bayc deleted the bugfix/repeated_calc_wake_calls branch March 31, 2022 15:49
@rafmudaf rafmudaf mentioned this pull request Mar 31, 2022
5 tasks
@rafmudaf rafmudaf mentioned this pull request Nov 16, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 Label to denote focus on v3
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Repeated calls to calculate wake can result in wrong wake calculations
3 participants