Skip to content

Commit

Permalink
Merge pull request OpenFAST#2203 from luwang00/f/LargeYaw
Browse files Browse the repository at this point in the history
Support for large platform yaw offset in OpenFAST
  • Loading branch information
andrew-platt authored Aug 29, 2024
2 parents 8b58138 + 660777d commit e5d0a1e
Show file tree
Hide file tree
Showing 40 changed files with 2,719 additions and 824 deletions.
2 changes: 1 addition & 1 deletion modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7433,7 +7433,7 @@ SUBROUTINE Perturb_u( p, n, perturb_sign, u, du )
! Module/Mesh/Field: u%TowerMotion%TranslationVel = 11;
! Module/Mesh/Field: u%TowerMotion%TranslationAcc = 12;
case( 9); u%TowerMotion%TranslationDisp(fieldIndx,node) = u%TowerMotion%TranslationDisp( fieldIndx,node) + du * perturb_sign
case(10); CALL PerturbOrientationMatrix( u%TowerMotion%Orientation(:,:,node), du * perturb_sign, fieldIndx, UseSmlAngle=.true. )
case(10); CALL PerturbOrientationMatrix( u%TowerMotion%Orientation(:,:,node), du * perturb_sign, fieldIndx, UseSmlAngle=.false. )
case(11); u%TowerMotion%TranslationVel( fieldIndx,node) = u%TowerMotion%TranslationVel( fieldIndx,node) + du * perturb_sign
case(12); u%TowerMotion%TranslationAcc( fieldIndx,node) = u%TowerMotion%TranslationAcc(fieldIndx,node) + du * perturb_sign

Expand Down
233 changes: 166 additions & 67 deletions modules/elastodyn/src/ElastoDyn.f90

Large diffs are not rendered by default.

29 changes: 14 additions & 15 deletions modules/elastodyn/src/ElastoDyn_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4276,22 +4276,21 @@ SUBROUTINE ValidatePrimaryData( InputFileData, BD4Blades, Linearize, MHK, ErrSta
CALL SetErrStat(ErrID_Fatal,'ShftTilt must be between -pi/2 and pi/2 radians (i.e., in the range [-90, 90] degrees).',ErrStat,ErrMsg,RoutineName)
END IF


! Check for violations of the small-angle assumption (15-degree limit, using radians):
IF ( ABS( InputFileData%PtfmRoll ) > SmallAngleLimit_Rad ) THEN
CALL SetErrStat( ErrID_Fatal, 'PtfmRoll must be between -'//TRIM(Num2LStr(SmallAngleLimit_Rad))//' and ' &
//TRIM(Num2LStr(SmallAngleLimit_Rad))//' radians.',ErrStat,ErrMsg,RoutineName)
END IF

IF ( ABS( InputFileData%PtfmPitch ) > SmallAngleLimit_Rad ) THEN
CALL SetErrStat( ErrID_Fatal, 'PtfmPitch must be between -'//TRIM(Num2LStr(SmallAngleLimit_Rad))//' and ' &
//TRIM(Num2LStr(SmallAngleLimit_Rad))//' radians.',ErrStat,ErrMsg,RoutineName)
END IF

IF ( ABS( InputFileData%PtfmYaw ) > SmallAngleLimit_Rad ) THEN
CALL SetErrStat( ErrID_Fatal, 'PtfmYaw must be between -'//TRIM(Num2LStr(SmallAngleLimit_Rad))//' and ' &
//TRIM(Num2LStr(SmallAngleLimit_Rad))//' radians.',ErrStat,ErrMsg,RoutineName)
END IF
! IF ( ABS( InputFileData%PtfmRoll ) > SmallAngleLimit_Rad ) THEN
! CALL SetErrStat( ErrID_Fatal, 'PtfmRoll must be between -'//TRIM(Num2LStr(SmallAngleLimit_Rad))//' and ' &
! //TRIM(Num2LStr(SmallAngleLimit_Rad))//' radians.',ErrStat,ErrMsg,RoutineName)
! END IF

! IF ( ABS( InputFileData%PtfmPitch ) > SmallAngleLimit_Rad ) THEN
! CALL SetErrStat( ErrID_Fatal, 'PtfmPitch must be between -'//TRIM(Num2LStr(SmallAngleLimit_Rad))//' and ' &
! //TRIM(Num2LStr(SmallAngleLimit_Rad))//' radians.',ErrStat,ErrMsg,RoutineName)
! END IF

! IF ( ABS( InputFileData%PtfmYaw ) > SmallAngleLimit_Rad ) THEN
! CALL SetErrStat( ErrID_Fatal, 'PtfmYaw must be between -'//TRIM(Num2LStr(SmallAngleLimit_Rad))//' and ' &
! //TRIM(Num2LStr(SmallAngleLimit_Rad))//' radians.',ErrStat,ErrMsg,RoutineName)
! END IF

! Check the output parameters:
IF ( InputFileData%DecFact < 1_IntKi ) CALL SetErrStat( ErrID_Fatal, 'DecFact must be greater than 0.',ErrStat,ErrMsg,RoutineName )
Expand Down
6 changes: 6 additions & 0 deletions modules/elastodyn/src/ElastoDyn_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ typedef ^ ED_InputFile IntKi BldNd_BladesOut - - - "The blades to output (ED
# ..... Internal data types: Coordinate Systems ...................................................................................
# This type defines coordinate sytems used internally by FAST. The 3 components of each vector correspond to the z1, z2, and z3 components of the individual vectors.
# NOTE: the orientations of most of these coordinate systems will change every time step.
typedef ^ ED_CoordSys R8Ki alpha1 3 - - "Vector / direction alpha1 after ptfm yaw rotation" -
typedef ^ ED_CoordSys R8Ki alpha2 3 - - "Vector / direction alpha2 after ptfm yaw rotation" -
typedef ^ ED_CoordSys R8Ki alpha3 3 - - "Vector / direction alpha3 after ptfm yaw rotation" -
typedef ^ ED_CoordSys R8Ki beta1 3 - - "Vector / direction beta1 after ptfm yaw and pitch rotation" -
typedef ^ ED_CoordSys R8Ki beta2 3 - - "Vector / direction beta2 after ptfm yaw and pitch rotation" -
typedef ^ ED_CoordSys R8Ki beta3 3 - - "Vector / direction beta3 after ptfm yaw and pitch rotation" -
typedef ^ ED_CoordSys R8Ki a1 3 - - "Vector / direction a1 (= xt from the IEC coord. system)" -
typedef ^ ED_CoordSys R8Ki a2 3 - - "Vector / direction a2 (= zt from the IEC coord. system)" -
typedef ^ ED_CoordSys R8Ki a3 3 - - "Vector / direction a3 (= -yt from the IEC coord. system)" -
Expand Down
24 changes: 24 additions & 0 deletions modules/elastodyn/src/ElastoDyn_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ MODULE ElastoDyn_Types
! =======================
! ========= ED_CoordSys =======
TYPE, PUBLIC :: ED_CoordSys
REAL(R8Ki) , DIMENSION(1:3) :: alpha1 = 0.0_R8Ki !< Vector / direction alpha1 after ptfm yaw rotation [-]
REAL(R8Ki) , DIMENSION(1:3) :: alpha2 = 0.0_R8Ki !< Vector / direction alpha2 after ptfm yaw rotation [-]
REAL(R8Ki) , DIMENSION(1:3) :: alpha3 = 0.0_R8Ki !< Vector / direction alpha3 after ptfm yaw rotation [-]
REAL(R8Ki) , DIMENSION(1:3) :: beta1 = 0.0_R8Ki !< Vector / direction beta1 after ptfm yaw and pitch rotation [-]
REAL(R8Ki) , DIMENSION(1:3) :: beta2 = 0.0_R8Ki !< Vector / direction beta2 after ptfm yaw and pitch rotation [-]
REAL(R8Ki) , DIMENSION(1:3) :: beta3 = 0.0_R8Ki !< Vector / direction beta3 after ptfm yaw and pitch rotation [-]
REAL(R8Ki) , DIMENSION(1:3) :: a1 = 0.0_R8Ki !< Vector / direction a1 (= xt from the IEC coord. system) [-]
REAL(R8Ki) , DIMENSION(1:3) :: a2 = 0.0_R8Ki !< Vector / direction a2 (= zt from the IEC coord. system) [-]
REAL(R8Ki) , DIMENSION(1:3) :: a3 = 0.0_R8Ki !< Vector / direction a3 (= -yt from the IEC coord. system) [-]
Expand Down Expand Up @@ -2365,6 +2371,12 @@ subroutine ED_CopyCoordSys(SrcCoordSysData, DstCoordSysData, CtrlCode, ErrStat,
character(*), parameter :: RoutineName = 'ED_CopyCoordSys'
ErrStat = ErrID_None
ErrMsg = ''
DstCoordSysData%alpha1 = SrcCoordSysData%alpha1
DstCoordSysData%alpha2 = SrcCoordSysData%alpha2
DstCoordSysData%alpha3 = SrcCoordSysData%alpha3
DstCoordSysData%beta1 = SrcCoordSysData%beta1
DstCoordSysData%beta2 = SrcCoordSysData%beta2
DstCoordSysData%beta3 = SrcCoordSysData%beta3
DstCoordSysData%a1 = SrcCoordSysData%a1
DstCoordSysData%a2 = SrcCoordSysData%a2
DstCoordSysData%a3 = SrcCoordSysData%a3
Expand Down Expand Up @@ -2683,6 +2695,12 @@ subroutine ED_PackCoordSys(RF, Indata)
type(ED_CoordSys), intent(in) :: InData
character(*), parameter :: RoutineName = 'ED_PackCoordSys'
if (RF%ErrStat >= AbortErrLev) return
call RegPack(RF, InData%alpha1)
call RegPack(RF, InData%alpha2)
call RegPack(RF, InData%alpha3)
call RegPack(RF, InData%beta1)
call RegPack(RF, InData%beta2)
call RegPack(RF, InData%beta3)
call RegPack(RF, InData%a1)
call RegPack(RF, InData%a2)
call RegPack(RF, InData%a3)
Expand Down Expand Up @@ -2744,6 +2762,12 @@ subroutine ED_UnPackCoordSys(RF, OutData)
integer(IntKi) :: stat
logical :: IsAllocAssoc
if (RF%ErrStat /= ErrID_None) return
call RegUnpack(RF, OutData%alpha1); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%alpha2); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%alpha3); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%beta1); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%beta2); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%beta3); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%a1); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%a2); if (RegCheckErr(RF, RoutineName)) return
call RegUnpack(RF, OutData%a3); if (RegCheckErr(RF, RoutineName)) return
Expand Down
1 change: 1 addition & 0 deletions modules/hydrodyn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ add_library(hydrodynlib STATIC
src/SS_Excitation_Types.f90
src/WAMIT_Types.f90
src/WAMIT2_Types.f90
src/YawOffset.f90
)
target_link_libraries(hydrodynlib seastlib nwtclibs)

Expand Down
Loading

0 comments on commit e5d0a1e

Please sign in to comment.