Skip to content

Commit

Permalink
bugfix: IfW rotor points for disk average incorrect
Browse files Browse the repository at this point in the history
The calculations for the rotor disk average wind speed use a set of point projected on the disk perpindular to the hub at ~0.7 rotor radius in the hub YZ plane.  However, the indices for this calculation were incorrect and projected the points onto disk in the hub XY plane.  This was discovered after one of the cases used in the curled wake paper failed to run correctly with 3.5.4 for a turbine very close to the back edge of the high resolution domain.

Also added some additional information about the location of points causing outside box bound errors.
  • Loading branch information
andrew-platt committed Nov 23, 2024
1 parent d802f93 commit 239316f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions modules/inflowwind/src/IfW_FlowField.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,7 @@ subroutine Grid4DField_GetVel(G4D, Time, Position, Velocity, ErrStat, ErrMsg)
real(ReKi) :: P(3, 16) ! Point values
real(ReKi) :: tmp
integer(IntKi) :: i
character(60) :: PtLoc

ErrStat = ErrID_None
ErrMsg = ""
Expand Down Expand Up @@ -1627,11 +1628,12 @@ subroutine Grid4DField_GetVel(G4D, Time, Position, Velocity, ErrStat, ErrMsg)
do i = 1, 4
if (Indx_Lo(i) <= 0) then
Indx_Lo(i) = 1
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds.', ErrStat, ErrMsg, RoutineName)
write(PtLoc,'(A1,3(f8.2,A1))') '(',Position(1),',',Position(2),',',Position(3),')'
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds: '//trim(PtLoc), ErrStat, ErrMsg, RoutineName)
return
elseif (Indx_Lo(i) >= G4D%n(i)) then
Indx_Lo(i) = max(G4D%n(i) - 1, 1) ! make sure it's a valid index
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds.', ErrStat, ErrMsg, RoutineName)
write(PtLoc,'(A1,3(f8.2,A1))') '(',Position(1),',',Position(2),',',Position(3),')'
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds: '//trim(PtLoc), ErrStat, ErrMsg, RoutineName)
return
end if
Indx_Hi(i) = min(Indx_Lo(i) + 1, G4D%n(i)) ! make sure it's a valid index
Expand Down
6 changes: 3 additions & 3 deletions modules/inflowwind/src/InflowWind_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,9 @@ SUBROUTINE InflowWind_SetParameters( InitInp, InputFileData, p, m, ErrStat, ErrM

do i=1,IfW_NumPtsAvg
theta = pi +(i-1)*TwoPi/IfW_NumPtsAvg
p%PositionAvg(1,i) = R*cos(theta)
p%PositionAvg(2,i) = R*sin(theta)
p%PositionAvg(3,i) = 0.0_ReKi
p%PositionAvg(1,i) = 0.0_ReKi ! Hub X (perpindicular to rotor plane)
p%PositionAvg(2,i) = R*cos(theta) ! Hub Y
p%PositionAvg(3,i) = R*sin(theta) ! Hub Z (in vertical plane when azimuth=0)
end do

p%OutputAccel = InitInp%OutputAccel
Expand Down

0 comments on commit 239316f

Please sign in to comment.