Skip to content

Conversation

SengersB
Copy link

@SengersB SengersB commented Aug 29, 2025

Bug fix and very small dev in Fitch wind farm parameterization

TYPE: bug fix

KEYWORDS: fitch, wind farm parameterization, turbine, wind farm, wind energy

SOURCE: Balthazar Sengers, Fraunhofer IWES

DESCRIPTION OF CHANGES:
Problem:

  1. In the standard Fitch wind farm parameterization, the local (grid cell) wind speed is used to calculate power and thrust. This wind speed is however reduced because of induction. Power and thrust curves (look-up tables) are determined using free inflow wind speed.
  2. The turbine thrust is a relevant metric that is not outputted.

Solution:

  1. The axial induction factor is calculated and used to correct the local (grid cell) wind speed back to the free inflow wind speed. This is done in 2 iterations. Alternatively, code could be rewritten so that this becomes an additional option for 'windfarm_opt'.
  2. The turbine thrust is calculated and passed through so it can be outputted now.

ISSUE: For use when this PR closes an issue.
Fixes #123

LIST OF MODIFIED FILES: list of changed files (use git diff --name-status master to get formatted list)
Registry/Registry.EM_COMMON
dyn_em/module_first_rk_step_part1.F
phys/module_pbl_driver.F
phys/module_wind_fitch.F
LICENSE.txt

TESTS CONDUCTED:

  1. Yes, demonstrated in paper: https://doi.org/10.5194/wes-9-1689-2024
  2. I don't see any fails

RELEASE NOTE:
Fitch wind farm parameterization: correct local (grid cell) wind speed to free wind speed using axial induction correction proposed by Vollmer et al. (2024) https://doi.org/10.5194/wes-9-1689-2024

@SengersB SengersB requested review from a team as code owners August 29, 2025 08:16
@weiwangncar
Copy link
Collaborator

@SengersB Thank you very much for your contribution to the WRF model. Your code has many many differences from the develop branch in our repository. For example, your LICENSE.txt file is different from our version. There maybe many more modified files (out of 267 files) are not part of your bug fix. Please clone the latest WRF model code, and add only the code that pertaining to the bug fix to this PR.

@SengersB
Copy link
Author

SengersB commented Sep 3, 2025

@weiwangncar Thanks for the quick response. I used the branch release-v4.7.1 as a base. Is that not correct?

@weiwangncar
Copy link
Collaborator

@SengersB Starting from WRF v4.7.1 is good. But did you really changed 267 files to implement your Fitch fix? It is unlikely. You should identify the files changed in your original code, and add them to the new release. If you started with WRFv4.7.1, the changes that are already in that version should not show up as updates. See this page for information on how to make code changes.

@weiwangncar
Copy link
Collaborator

@SengersB Is your intention to contribute your modification to our repository? Or do you plan to maintain the code in your own branch?

@SengersB
Copy link
Author

SengersB commented Sep 4, 2025

@weiwangncar I have started over fresh from release-r4.7.1 made sure my modification were added. git diff --name-only dev_AIF_r471 other/release-v4.7.1 now only gives the 5 files listed above. Pending clarification on the LICENSE.txt, I hope this is what you need to review and merge.

My intention is to contribute the modification to your repository, so to be part of the next (bugfix) release. We are not maintaining the code ourselves.
Thanks!

@weiwangncar
Copy link
Collaborator

@SengersB It still says 'Files changed 278'. See the last item on top of your PR message.

@SengersB
Copy link
Author

SengersB commented Sep 5, 2025

@weiwangncar That is compared to your branch wrf-model:develop. Should I use this branch as a base?

@weiwangncar weiwangncar changed the base branch from develop to master September 5, 2025 08:54
@weiwangncar weiwangncar changed the base branch from master to develop September 5, 2025 08:54
@weiwangncar
Copy link
Collaborator

@SengersB Our master and develop branches are the same. You should first clone the WRF repository code (make sure that code is version 4.7.1 by checking the top level README file), and then add your changes in those five files to the cloned code. Please see the page I provided early for instructions.

@SengersB SengersB reopened this Sep 8, 2025
@SengersB
Copy link
Author

SengersB commented Sep 8, 2025

@weiwangncar Alright turns out I just had to rebase.
Apologies for the oversight and the mess of closing and reopening the pull request.
Anyway, now it shows that only 5 files are changes, as intended.

Pending clarification on the LICENSE.txt, I hope this is what you need to review and merge.

@weiwangncar
Copy link
Collaborator

@SengersB Thanks, and this is what we expect to see! The regression test has passed too:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@weiwangncar
Copy link
Collaborator

@SengersB The remaining issue is the text for license which we will have to come out of way to deal with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants