Skip to content

Commit

Permalink
Merge pull request #982 from andrew-platt/b/AD15_NacelleRef
Browse files Browse the repository at this point in the history
[BugFix] AD15 nacelle reference position was set to hub position
  • Loading branch information
andrew-platt authored Jan 27, 2022
2 parents 5e25d5d + e3ae00e commit 596208b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ subroutine Init_u( u, p, p_AD, InputFileData, InitInp, errStat, errMsg )
if (errStat >= AbortErrLev) return

! set node initial position/orientation
position = InitInp%HubPosition
position = InitInp%NacellePosition
position(1:2) = 0
call MeshPositionNode(u%NacelleMotion, 1, position, errStat2, errMsg2, orient=InitInp%NacelleOrientation)
call SetErrStat( errStat2, errMsg2, errStat, errMsg, RoutineName )
Expand Down
1 change: 1 addition & 0 deletions modules/aerodyn/src/AeroDyn_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ typedef ^ RotInitInputType ReKi HubPosition {3} - - "X-Y-Z reference position of
typedef ^ RotInitInputType R8Ki HubOrientation {3}{3} - - "DCM reference orientation of hub" -
typedef ^ RotInitInputType ReKi BladeRootPosition {:}{:} - - "X-Y-Z reference position of each blade root (3 x NumBlades)" m
typedef ^ RotInitInputType R8Ki BladeRootOrientation {:}{:}{:} - - "DCM reference orientation of blade roots (3x3 x NumBlades)" -
typedef ^ RotInitInputType R8Ki NacellePosition {3} - - "X-Y-Z reference position of hub" m
typedef ^ RotInitInputType R8Ki NacelleOrientation {3}{3} - - "DCM reference orientation of nacelle" -
typedef ^ RotInitInputType IntKi AeroProjMod - 0 - "Flag to switch between different projection models" -

Expand Down
13 changes: 13 additions & 0 deletions modules/aerodyn/src/AeroDyn_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ MODULE AeroDyn_Types
REAL(R8Ki) , DIMENSION(1:3,1:3) :: HubOrientation !< DCM reference orientation of hub [-]
REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BladeRootPosition !< X-Y-Z reference position of each blade root (3 x NumBlades) [m]
REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: BladeRootOrientation !< DCM reference orientation of blade roots (3x3 x NumBlades) [-]
REAL(R8Ki) , DIMENSION(1:3) :: NacellePosition !< X-Y-Z reference position of hub [m]
REAL(R8Ki) , DIMENSION(1:3,1:3) :: NacelleOrientation !< DCM reference orientation of nacelle [-]
INTEGER(IntKi) :: AeroProjMod = 0 !< Flag to switch between different projection models [-]
END TYPE RotInitInputType
Expand Down Expand Up @@ -416,6 +417,7 @@ SUBROUTINE AD_CopyRotInitInputType( SrcRotInitInputTypeData, DstRotInitInputType
END IF
DstRotInitInputTypeData%BladeRootOrientation = SrcRotInitInputTypeData%BladeRootOrientation
ENDIF
DstRotInitInputTypeData%NacellePosition = SrcRotInitInputTypeData%NacellePosition
DstRotInitInputTypeData%NacelleOrientation = SrcRotInitInputTypeData%NacelleOrientation
DstRotInitInputTypeData%AeroProjMod = SrcRotInitInputTypeData%AeroProjMod
END SUBROUTINE AD_CopyRotInitInputType
Expand Down Expand Up @@ -485,6 +487,7 @@ SUBROUTINE AD_PackRotInitInputType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat,
Int_BufSz = Int_BufSz + 2*3 ! BladeRootOrientation upper/lower bounds for each dimension
Db_BufSz = Db_BufSz + SIZE(InData%BladeRootOrientation) ! BladeRootOrientation
END IF
Db_BufSz = Db_BufSz + SIZE(InData%NacellePosition) ! NacellePosition
Db_BufSz = Db_BufSz + SIZE(InData%NacelleOrientation) ! NacelleOrientation
Int_BufSz = Int_BufSz + 1 ! AeroProjMod
IF ( Re_BufSz .GT. 0 ) THEN
Expand Down Expand Up @@ -571,6 +574,10 @@ SUBROUTINE AD_PackRotInitInputType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat,
END DO
END DO
END IF
DO i1 = LBOUND(InData%NacellePosition,1), UBOUND(InData%NacellePosition,1)
DbKiBuf(Db_Xferred) = InData%NacellePosition(i1)
Db_Xferred = Db_Xferred + 1
END DO
DO i2 = LBOUND(InData%NacelleOrientation,2), UBOUND(InData%NacelleOrientation,2)
DO i1 = LBOUND(InData%NacelleOrientation,1), UBOUND(InData%NacelleOrientation,1)
DbKiBuf(Db_Xferred) = InData%NacelleOrientation(i1,i2)
Expand Down Expand Up @@ -680,6 +687,12 @@ SUBROUTINE AD_UnPackRotInitInputType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrSt
END DO
END DO
END IF
i1_l = LBOUND(OutData%NacellePosition,1)
i1_u = UBOUND(OutData%NacellePosition,1)
DO i1 = LBOUND(OutData%NacellePosition,1), UBOUND(OutData%NacellePosition,1)
OutData%NacellePosition(i1) = REAL(DbKiBuf(Db_Xferred), R8Ki)
Db_Xferred = Db_Xferred + 1
END DO
i1_l = LBOUND(OutData%NacelleOrientation,1)
i1_u = UBOUND(OutData%NacelleOrientation,1)
i2_l = LBOUND(OutData%NacelleOrientation,2)
Expand Down
1 change: 1 addition & 0 deletions modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD,

Init%InData_AD%rotors(1)%HubPosition = ED%y%HubPtMotion%Position(:,1)
Init%InData_AD%rotors(1)%HubOrientation = ED%y%HubPtMotion%RefOrientation(:,:,1)
Init%InData_AD%rotors(1)%NacellePosition = ED%y%NacelleMotion%Position(:,1)
Init%InData_AD%rotors(1)%NacelleOrientation = ED%y%NacelleMotion%RefOrientation(:,:,1)

do k=1,NumBl
Expand Down

0 comments on commit 596208b

Please sign in to comment.