-
Notifications
You must be signed in to change notification settings - Fork 471
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
[BugFix] FF mod_AmbWind=3 failed if a turbine not aligned exactly at center of high res grid #1951
[BugFix] FF mod_AmbWind=3 failed if a turbine not aligned exactly at center of high res grid #1951
Conversation
…Y0 of high res grid If a turbine was shifted ever so slightly in the +/-Y direction from a high resolution grid point, the box of grid points sent to InflowWind for calculation would be shifted so one edge was just outside the wind box. This would immediately fail. For example, the FF input file: ``` --- WIND TURBINES --- 1 NumTurbines - Number of wind turbines (-) [>=1] [last 6 columns below used only for Mod_AmbWind=2 or 3] WT_X WT_Y WT_Z WT_FASTInFile X0_High Y0_High Z0_High dX_High dY_High dZ_High (m) (m) (m) (string) (m) (m) (m) (m) (m) (m) 1.20200000e+02 -315.1 0 "FFTest_WT1.fst" -1.00300000e+02 -540 1 4 5 5 ``` shifts the turbine by 0.1 m in Y. The Y0_high location is set to -540 m. During calculations in AWAE, the call to InflowWind, the points were shifted by the turbine XY position. It should have been shifted by the XY center of the box so that they aligned with the grid in the InflowWind calculations. Updated the ModAmb_3 test case to verify this fixes the problem. Properly setting the offset to the center of the high resolution box also shifted the box 20 m in the X direction for the regression test, so the results changed very slightly.
@abhineet-gupta, please take a look at this and verify it works correctly. |
This works. I can successfully run my simulation now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this change. With Mod_AmbWind
= 3, a separate instance of InflowWind is used for the low-resolution domain and the high-resolution domain associated with each turbine. InflowWind always assumes that its wind domain is defined relative to its local (0,0,0) origin, which for the low-resolution domain is the FAST.Farm origin and for each high-resolution domain is the origin of the tower base of a turbine. This is why the original code subtracted p%WT_Position
from p%Grid_high
. The new code assumes this origin is the lateral center of high-res domain, not the wind turbine origin, which is not compatible with the assumptions in InflowWind.
My guess is the issue reported in the forum post is related to an issue in the FAST.Farm case creation python scripts rather than an issue with the FAST.Farm source code.
A few details:
However the behavior changed. In 3.4.1 it was possible to have the turbine misaligned slightly with the center of the box, but this is no longer possible. For example, shifting a turbine from One other potentially useful detail is about a bug that was fixed during restructuring InflowWind for v3.5.0. Before this, the interpolation allowed points just outside the grid in one direction. When we added the ability to extrapolate beyond the box boundary (only allowed with OLAF and Lidar), we discovered that the interpolation algorithm was not treating the grid boundaries correctly and would allow interpolation of points within one |
I have a vague recollection of adding this "feature" when I was at NREL. I believe there was a request to allow extrapolation of the wind field outside the box, but I wasn't comfortable with extrapolating too far, so we just added the one point. I think someone had created grids that were just a tiny bit too small for their project and this fixed their issue. |
Thanks for the info @bjonkman! I couldn't imagine this had been a true bug with the box boundaries. I think this is a feature we want to add back in -- maybe only a half grid delta at each edge in Y. v3.4.1 - v3.5.0 + |
We decided that the best solution for |
This is ready to merge.
Description
If a turbine was shifted ever so slightly in the +/-Y direction from a high resolution grid point, the box of grid points sent to InflowWind for calculation would be shifted so one edge was just outside the wind box. This would immediately fail.
For example, the FF input file:
puts the turbine at -315.1 m in Y, which is 0.1 m from the center of the high resolution grid located at -315 m (
Y0_high + 0.5*dY_high*(nY_high-1)
). During the call to InflowWind in AWAE, the high res grid points were shifted by the turbine XY position instead of the center of the high res grid. This resulted in all grid points passed to InflowWind being shifted by -0.1 m too far in Y, so one side of passed grid was outside the wind box.Note that the code fix also shifts the box differently in the X direction. This changed results for the one regression test.
Also discovered that the hub center was not correctly calculated. This actually doesn't matter since that is used in calculating the disk average values, which are ignored entirely in AWAE.
@abhineet-gupta figrued out where the problem likely was.
Related issue, if one exists
https://forums.nrel.gov/t/gf-wind-array-boundaries-violated-grid-too-small-in-y-direction/6149/5
Impacted areas of the software
FAST.Farm with
Mod_AmbWind=3
Additional supporting information
Test results, if applicable
Updated the ModAmb_3 test case to verify this fixes the problem. Properly setting the offset to the center of the high resolution box also shifted the box 20 m in the X direction for the regression test, so the results changed very slightly.