From 9f4621498522410b4ec66bd41c2f5bb10b277245 Mon Sep 17 00:00:00 2001 From: ptrbortolotti Date: Tue, 13 May 2025 15:20:27 -0600 Subject: [PATCH 1/3] compute Zbottom from GridHeight, not RotorDiameter --- modules/turbsim/src/TSsubs.f90 | 4 ++-- modules/turbsim/src/TurbSim_Types.f90 | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/turbsim/src/TSsubs.f90 b/modules/turbsim/src/TSsubs.f90 index 173fd53f62..429078c1ea 100644 --- a/modules/turbsim/src/TSsubs.f90 +++ b/modules/turbsim/src/TSsubs.f90 @@ -1347,8 +1347,8 @@ SUBROUTINE CreateGrid( p_grid, p_usr, UHub, AddTower, ErrStat, ErrMsg ) p_grid%GridRes_Y = p_grid%GridWidth / REAL( p_grid%NumGrid_Y - 1, ReKi ) p_grid%GridRes_Z = p_grid%GridHeight / REAL( p_grid%NumGrid_Z - 1, ReKi ) - p_grid%Zbottom = p_grid%HubHt + 0.5*p_grid%RotorDiameter ! height of the highest grid points - p_grid%Zbottom = p_grid%Zbottom - p_grid%GridRes_Z * REAL(p_grid%NumGrid_Z - 1, ReKi) ! height of the lowest grid points + p_grid%Ztop = p_grid%HubHt + 0.5*p_grid%GridHeight ! height of the highest grid points + p_grid%Zbottom = p_grid%Ztop - p_grid%GridRes_Z * REAL(p_grid%NumGrid_Z - 1, ReKi) ! height of the lowest grid points IF ( p_grid%Zbottom <= 0.0_ReKi ) THEN CALL SetErrStat(ErrID_Fatal,'The lowest grid point ('//TRIM(Num2LStr(p_grid%Zbottom))// ' m) must be above the ground. '//& diff --git a/modules/turbsim/src/TurbSim_Types.f90 b/modules/turbsim/src/TurbSim_Types.f90 index 07a7773018..0426c3f2d2 100644 --- a/modules/turbsim/src/TurbSim_Types.f90 +++ b/modules/turbsim/src/TurbSim_Types.f90 @@ -111,6 +111,7 @@ MODULE TurbSim_Types INTEGER(IntKi) :: NPoints ! Number of points being simulated. INTEGER(IntKi) :: NPacked ! Number of entries stored in the packed version of the symmetric matrix of size NPoints by NPoints + REAL(ReKi) :: Ztop ! The height of the highest point on the grid (before tower points are added) REAL(ReKi) :: Zbottom ! The height of the lowest point on the grid (before tower points are added), equal to Z(1) REAL(ReKi) :: RotorDiameter ! The assumed diameter of the rotor From 31918a56667de66c3fdb7886ba95b18f0fe8e6c6 Mon Sep 17 00:00:00 2001 From: ptrbortolotti Date: Tue, 13 May 2025 15:34:30 -0600 Subject: [PATCH 2/3] Zbottom is simply HubHt - half GridHeight. skip Ztop --- modules/turbsim/src/TSsubs.f90 | 3 +-- modules/turbsim/src/TurbSim_Types.f90 | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/turbsim/src/TSsubs.f90 b/modules/turbsim/src/TSsubs.f90 index 429078c1ea..db15ecc344 100644 --- a/modules/turbsim/src/TSsubs.f90 +++ b/modules/turbsim/src/TSsubs.f90 @@ -1347,8 +1347,7 @@ SUBROUTINE CreateGrid( p_grid, p_usr, UHub, AddTower, ErrStat, ErrMsg ) p_grid%GridRes_Y = p_grid%GridWidth / REAL( p_grid%NumGrid_Y - 1, ReKi ) p_grid%GridRes_Z = p_grid%GridHeight / REAL( p_grid%NumGrid_Z - 1, ReKi ) - p_grid%Ztop = p_grid%HubHt + 0.5*p_grid%GridHeight ! height of the highest grid points - p_grid%Zbottom = p_grid%Ztop - p_grid%GridRes_Z * REAL(p_grid%NumGrid_Z - 1, ReKi) ! height of the lowest grid points + p_grid%Zbottom = p_grid%HubHt - 0.5*p_grid%GridHeight ! height of the lowest grid points IF ( p_grid%Zbottom <= 0.0_ReKi ) THEN CALL SetErrStat(ErrID_Fatal,'The lowest grid point ('//TRIM(Num2LStr(p_grid%Zbottom))// ' m) must be above the ground. '//& diff --git a/modules/turbsim/src/TurbSim_Types.f90 b/modules/turbsim/src/TurbSim_Types.f90 index 0426c3f2d2..07a7773018 100644 --- a/modules/turbsim/src/TurbSim_Types.f90 +++ b/modules/turbsim/src/TurbSim_Types.f90 @@ -111,7 +111,6 @@ MODULE TurbSim_Types INTEGER(IntKi) :: NPoints ! Number of points being simulated. INTEGER(IntKi) :: NPacked ! Number of entries stored in the packed version of the symmetric matrix of size NPoints by NPoints - REAL(ReKi) :: Ztop ! The height of the highest point on the grid (before tower points are added) REAL(ReKi) :: Zbottom ! The height of the lowest point on the grid (before tower points are added), equal to Z(1) REAL(ReKi) :: RotorDiameter ! The assumed diameter of the rotor From e676fb5f7e9adb75d23555a433c30eb4ee8aa465 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Wed, 14 May 2025 10:28:12 -0600 Subject: [PATCH 3/3] TurbSim: if grid goes below ground, shift the bottom point --- modules/turbsim/src/TS_FileIO.f90 | 4 +++- modules/turbsim/src/TSsubs.f90 | 11 +++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/turbsim/src/TS_FileIO.f90 b/modules/turbsim/src/TS_FileIO.f90 index d4a5814137..c9afe84b09 100644 --- a/modules/turbsim/src/TS_FileIO.f90 +++ b/modules/turbsim/src/TS_FileIO.f90 @@ -4868,7 +4868,9 @@ SUBROUTINE GetDefaultRS( p, OtherSt_RandNum, TmpUstarHub, ErrStat, ErrMsg ) Z(2) = p%grid%HubHt + 0.5*p%grid%RotorDiameter ! top of the grid - Z(1) = Z(2) - p%grid%GridHeight ! bottom of the grid + Z(1) = MAX( Tolerance, Z(2) - p%grid%GridHeight ) ! bottom of the grid + Z(2) = Z(1) + p%grid%GridHeight ! re-calculate just in case Z1 is set to Tolerance + CALL getVelocityProfile(p, p%UHub, p%grid%HubHt, Z, V, ErrStat2, ErrMsg2) CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, 'GetDefaultRS') diff --git a/modules/turbsim/src/TSsubs.f90 b/modules/turbsim/src/TSsubs.f90 index db15ecc344..f869387b6e 100644 --- a/modules/turbsim/src/TSsubs.f90 +++ b/modules/turbsim/src/TSsubs.f90 @@ -1347,14 +1347,9 @@ SUBROUTINE CreateGrid( p_grid, p_usr, UHub, AddTower, ErrStat, ErrMsg ) p_grid%GridRes_Y = p_grid%GridWidth / REAL( p_grid%NumGrid_Y - 1, ReKi ) p_grid%GridRes_Z = p_grid%GridHeight / REAL( p_grid%NumGrid_Z - 1, ReKi ) - p_grid%Zbottom = p_grid%HubHt - 0.5*p_grid%GridHeight ! height of the lowest grid points - - IF ( p_grid%Zbottom <= 0.0_ReKi ) THEN - CALL SetErrStat(ErrID_Fatal,'The lowest grid point ('//TRIM(Num2LStr(p_grid%Zbottom))// ' m) must be above the ground. '//& - 'Adjust the appropriate values in the input file.',ErrStat,ErrMsg,RoutineName) - RETURN - ENDIF - + p_grid%Zbottom = p_grid%HubHt + 0.5*p_grid%RotorDiameter ! height of the highest grid points + p_grid%Zbottom = p_grid%Zbottom - p_grid%GridRes_Z * REAL(p_grid%NumGrid_Z - 1, ReKi) ! height of the lowest grid points + p_grid%Zbottom = MAX( Tolerance, p_grid%Zbottom) ! make sure it's above the ground ! (2) the tower points: IF ( AddTower ) THEN