Move FAST.Farm K-d tree logic into AWAE_UpdateStates#3112
Merged
deslaughter merged 4 commits intoOpenFAST:dev-tcfrom Dec 23, 2025
Merged
Move FAST.Farm K-d tree logic into AWAE_UpdateStates#3112deslaughter merged 4 commits intoOpenFAST:dev-tcfrom
deslaughter merged 4 commits intoOpenFAST:dev-tcfrom
Conversation
…States to take current time and step number instead of next time
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors FAST.Farm's wake modeling workflow by moving K-d tree calculations from AWAE_CalcOutput to AWAE_UpdateStates, ensuring wake-grid interactions are computed only once per ambient wind update. A critical bug was also fixed where AWAE_Init passed an incorrect time value, causing duplicate wind velocities for the first two low-resolution time steps when using InflowWind.
Key Changes:
- Moved K-d tree logic from
AWAE_CalcOutputto a new subroutineCalcWakePointTurbineGridInteractionscalled inAWAE_UpdateStates - Relocated
AWAE_UpdateStatescall fromFARM_UpdateStatestoFARM_CalcOutput - Fixed timing bug in
AWAE_Initand corrected time offsets in wind data retrieval calls
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| reg_tests/r-test | Updated regression test baseline to reflect fixed wind velocity timing |
| modules/awae/src/AWAE.f90 | Added new subroutine for K-d tree calculations, removed duplicate code from CalcOutput functions, and corrected time parameter usage throughout |
| glue-codes/fast-farm/src/FAST_Farm_Subs.f90 | Moved AWAE_UpdateStates call from FARM_UpdateStates to FARM_CalcOutput and removed now-unused error handling variables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
andrew-platt
approved these changes
Dec 22, 2025
andrew-platt
approved these changes
Dec 23, 2025
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.
This PR is ready to merge
Feature or improvement description
This PR moves the new K-d tree logic from
AWAE_CalcOutputtoAWAE_UpdateStatesso that it is only calculated once, when updating the ambient wind. This will make it possible to selectively read the AMReX wind files for parts of the low-resolution grid without recalculating which grid partitions to read in multiple places.This required a change in where
AWAE_UpdateStateswas called, moving it fromFARM_UpdateStatestoFARM_CalcOuput. In this process an error was discovered in the initial call toAWAE_UpdateStates, duringAWAE_Init, where the wrong time was passed, resulting in the same wind velocities being used for the first two low-res time steps when the ambient wind was modeled inInflowWind. This PR fixes the issue and updates the FAST.FARM regression tests.Impacted areas of the software
FAST.FarmandAWAETest results, if applicable
FAST.Farm regression test benchmarks were updated after the bug in
AWAE_Initwas fixed.