Skip to content

Commit

Permalink
SD gearbox: rigid AD15 tower attached at ED platform
Browse files Browse the repository at this point in the history
This branch is not intended for general use.  This branch contains a quick hack for the special use case where the drivetrain is modeled with SubDyn, but the AD15 tower is needed for tower shadow.

Modifications include:
 - change AD15 tower motion mapping from the ED tower to mapping from the ED PlatformPtMesh instead (point to line mapping -- AD15 tower is now rigid)
 - removal of all mapping from the AD15 loads to the ED tower
 - removed ED_L_2_AD_L_T and AD_L_2_ED_P_T mesh mappings
  • Loading branch information
andrew-platt committed Oct 25, 2023
1 parent 6a6511a commit 13e17c1
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 175 deletions.
8 changes: 8 additions & 0 deletions README_ThisBranch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
2023.10.25 -- ADP

This branch is not intended for general use. This branch contains a quick hack for the special use case where the drivetrain is modeled with SubDyn, but the AD15 tower is needed for tower shadow.

Modifications include:
- change AD15 tower motion mapping from the ED tower to mapping from the ED PlatformPtMesh instead (point to line mapping -- AD15 tower is now rigid)
- removal of all mapping from the AD15 loads to the ED tower
- removed ED_L_2_AD_L_T and AD_L_2_ED_P_T mesh mappings
112 changes: 56 additions & 56 deletions modules/openfast-library/src/FAST_Lin.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2118,18 +2118,18 @@ SUBROUTINE Linear_ED_InputSolve_du( p_FAST, y_FAST, SrvD, u_ED, y_ED, y_AD, u_AD

! ED inputs on tower from AD:

IF ( y_AD%rotors(1)%TowerLoad%Committed ) THEN
ED_Start_mt = Indx_u_ED_Tower_Start(u_ED, y_FAST) &
+ u_ED%TowerPtLoads%NNodes * 3 ! 3 forces at each node (we're going to start at the moments)

CALL Linearize_Line2_to_Point( y_AD%rotors(1)%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2, u_AD%rotors(1)%TowerMotion, y_ED%TowerLn2Mesh )
CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)

! AD is source in the mapping, so we want M_{uSm}
if (allocated(MeshMapData%AD_L_2_ED_P_T%dM%m_us )) then
call SetBlockMatrix( dUdu, MeshMapData%AD_L_2_ED_P_T%dM%m_us, ED_Start_mt, y_FAST%Lin%Modules(MODULE_AD)%Instance(1)%LinStartIndx(LIN_INPUT_COL) )
end if
END IF
! IF ( y_AD%rotors(1)%TowerLoad%Committed ) THEN
! ED_Start_mt = Indx_u_ED_Tower_Start(u_ED, y_FAST) &
! + u_ED%TowerPtLoads%NNodes * 3 ! 3 forces at each node (we're going to start at the moments)
!
! CALL Linearize_Line2_to_Point( y_AD%rotors(1)%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2, u_AD%rotors(1)%TowerMotion, y_ED%TowerLn2Mesh )
! CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
!
! ! AD is source in the mapping, so we want M_{uSm}
! if (allocated(MeshMapData%AD_L_2_ED_P_T%dM%m_us )) then
! call SetBlockMatrix( dUdu, MeshMapData%AD_L_2_ED_P_T%dM%m_us, ED_Start_mt, y_FAST%Lin%Modules(MODULE_AD)%Instance(1)%LinStartIndx(LIN_INPUT_COL) )
! end if
! END IF

END IF

Expand Down Expand Up @@ -2772,22 +2772,22 @@ SUBROUTINE Linear_AD_InputSolve_du( p_FAST, y_FAST, u_AD, y_ED, BD, MeshMapData,
!-------------------------------------------------------------------------------------------------

! tower
IF (u_AD%rotors(1)%TowerMotion%Committed) THEN

CALL Linearize_Line2_to_Line2( y_ED%TowerLn2Mesh, u_AD%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName//':u_AD%TowerMotion' )


!AD is the destination here, so we need tv_ud
if (allocated( MeshMapData%ED_L_2_AD_L_T%dM%tv_ud)) then
AD_Start_td = y_FAST%Lin%Modules(MODULE_AD)%Instance(1)%LinStartIndx(LIN_INPUT_COL)
AD_Start_tv = AD_Start_td + u_AD%rotors(1)%TowerMotion%NNodes * 6 ! 2 fields (TranslationDisp and Orientation) with 3 components before translational velocity field

call SetBlockMatrix( dUdu, MeshMapData%ED_L_2_AD_L_T%dM%tv_ud, AD_Start_tv, AD_Start_td )
end if


END IF
! IF (u_AD%rotors(1)%TowerMotion%Committed) THEN
!
! CALL Linearize_Line2_to_Line2( y_ED%TowerLn2Mesh, u_AD%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
! CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName//':u_AD%TowerMotion' )
!
!
! !AD is the destination here, so we need tv_ud
! if (allocated( MeshMapData%ED_L_2_AD_L_T%dM%tv_ud)) then
! AD_Start_td = y_FAST%Lin%Modules(MODULE_AD)%Instance(1)%LinStartIndx(LIN_INPUT_COL)
! AD_Start_tv = AD_Start_td + u_AD%rotors(1)%TowerMotion%NNodes * 6 ! 2 fields (TranslationDisp and Orientation) with 3 components before translational velocity field
!
! call SetBlockMatrix( dUdu, MeshMapData%ED_L_2_AD_L_T%dM%tv_ud, AD_Start_tv, AD_Start_td )
! end if
!
!
! END IF


! blades
Expand Down Expand Up @@ -3294,22 +3294,22 @@ SUBROUTINE Linear_ED_InputSolve_dy( p_FAST, y_FAST, SrvD, u_ED, y_ED, y_AD, u_AD
END IF ! ED


IF ( y_AD%rotors(1)%TowerLoad%Committed ) THEN
!!! ! This linearization was done in forming dUdu (see Linear_ED_InputSolve_du()), so we don't need to re-calculate these matrices
!!! ! while forming dUdy, too.
!CALL Linearize_Line2_to_Point( y_AD%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2, u_AD%TowerMotion, y_ED%TowerLn2Mesh )

! AD loads-to-ED loads transfer (dU^{ED}/dy^{AD}):
ED_Start = Indx_u_ED_Tower_Start(u_ED, y_FAST) ! u_ED%TowerPtLoads%Force field
AD_Out_Start = y_FAST%Lin%Modules(MODULE_AD)%Instance(1)%LinStartIndx(LIN_OUTPUT_COL) ! start of y_AD%Tower%Force
call Assemble_dUdy_Loads(y_AD%rotors(1)%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ED_Start, AD_Out_Start, dUdy)

! ED translation displacement-to-ED moment transfer (dU^{ED}/dy^{ED}):
ED_Start = ED_Start + u_ED%TowerPtLoads%NNodes*3 ! start of u_ED%TowerPtLoads%Moment field [skip the ED forces to get to the moments]
ED_Out_Start = Indx_y_ED_Tower_Start(y_ED, y_FAST) ! start of y_ED%TowerLn2Mesh%TranslationDisp field
call SumBlockMatrix( dUdy, MeshMapData%AD_L_2_ED_P_T%dM%m_uD, ED_Start, ED_Out_Start )

END IF ! tower
! IF ( y_AD%rotors(1)%TowerLoad%Committed ) THEN
! !!! ! This linearization was done in forming dUdu (see Linear_ED_InputSolve_du()), so we don't need to re-calculate these matrices
! !!! ! while forming dUdy, too.
! !CALL Linearize_Line2_to_Point( y_AD%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2, u_AD%TowerMotion, y_ED%TowerLn2Mesh )
!
! ! AD loads-to-ED loads transfer (dU^{ED}/dy^{AD}):
! ED_Start = Indx_u_ED_Tower_Start(u_ED, y_FAST) ! u_ED%TowerPtLoads%Force field
! AD_Out_Start = y_FAST%Lin%Modules(MODULE_AD)%Instance(1)%LinStartIndx(LIN_OUTPUT_COL) ! start of y_AD%Tower%Force
! call Assemble_dUdy_Loads(y_AD%rotors(1)%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ED_Start, AD_Out_Start, dUdy)
!
! ! ED translation displacement-to-ED moment transfer (dU^{ED}/dy^{ED}):
! ED_Start = ED_Start + u_ED%TowerPtLoads%NNodes*3 ! start of u_ED%TowerPtLoads%Moment field [skip the ED forces to get to the moments]
! ED_Out_Start = Indx_y_ED_Tower_Start(y_ED, y_FAST) ! start of y_ED%TowerLn2Mesh%TranslationDisp field
! call SumBlockMatrix( dUdy, MeshMapData%AD_L_2_ED_P_T%dM%m_uD, ED_Start, ED_Out_Start )
!
! END IF ! tower

END IF ! aero loads

Expand Down Expand Up @@ -3652,18 +3652,18 @@ SUBROUTINE Linear_AD_InputSolve_NoIfW_dy( p_FAST, y_FAST, u_AD, y_ED, BD, MeshMa
!...................................
! tower
!...................................
IF (u_AD%rotors(1)%TowerMotion%Committed) THEN

!!! ! This linearization was done in forming dUdu (see Linear_AD_InputSolve_du()), so we don't need to re-calculate these matrices
!!! ! while forming dUdy, too.
!!!CALL Linearize_Line2_to_Line2( y_ED%TowerLn2Mesh, u_AD%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )

AD_Start = Indx_u_AD_Tower_Start(u_AD, y_FAST) ! start of u_AD%TowerMotion%TranslationDisp field

ED_Out_Start = Indx_y_ED_Tower_Start(y_ED, y_FAST) ! start of y_ED%TowerLn2Mesh%TranslationDisp field
call Assemble_dUdy_Motions(y_ED%TowerLn2Mesh, u_AD%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, AD_Start, ED_Out_Start, dUdy, skipRotVel=.true.)

END IF
! IF (u_AD%rotors(1)%TowerMotion%Committed) THEN
!
! !!! ! This linearization was done in forming dUdu (see Linear_AD_InputSolve_du()), so we don't need to re-calculate these matrices
! !!! ! while forming dUdy, too.
! !!!CALL Linearize_Line2_to_Line2( y_ED%TowerLn2Mesh, u_AD%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
!
! AD_Start = Indx_u_AD_Tower_Start(u_AD, y_FAST) ! start of u_AD%TowerMotion%TranslationDisp field
!
! ED_Out_Start = Indx_y_ED_Tower_Start(y_ED, y_FAST) ! start of y_ED%TowerLn2Mesh%TranslationDisp field
! call Assemble_dUdy_Motions(y_ED%TowerLn2Mesh, u_AD%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, AD_Start, ED_Out_Start, dUdy, skipRotVel=.true.)
!
! END IF

!...................................
! hub
Expand Down
5 changes: 3 additions & 2 deletions modules/openfast-library/src/FAST_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,9 @@ typedef ^ FAST_ModuleMapType MeshMapType ED_P_2_AD_P_N - - - "Map ElastoDyn Nace
typedef ^ FAST_ModuleMapType MeshMapType AD_P_2_ED_P_N - - - "Map AeroDyn Nacelle point load mesh to ElastoDyn nacelle point load mesh"
typedef ^ FAST_ModuleMapType MeshMapType ED_P_2_AD_P_TF - - - "Map ElastoDyn TailFin CM point motion mesh to AeroDyn TailFin ref point motion mesh"
typedef ^ FAST_ModuleMapType MeshMapType AD_P_2_ED_P_TF - - - "Map AeroDyn TailFin ref point load mesh to ElastoDyn TailFin CM point load mesh"
typedef ^ FAST_ModuleMapType MeshMapType ED_L_2_AD_L_T - - - "Map ElastoDyn TowerLn2Mesh line2 mesh to AeroDyn14 Twr_InputMarkers or AeroDyn TowerMotion line2 mesh"
typedef ^ FAST_ModuleMapType MeshMapType AD_L_2_ED_P_T - - - "Map AeroDyn14 Twr_InputMarkers or AeroDyn TowerLoad line2 mesh to ElastoDyn TowerPtLoads point mesh"
#typedef ^ FAST_ModuleMapType MeshMapType ED_L_2_AD_L_T - - - "Map ElastoDyn TowerLn2Mesh line2 mesh to AeroDyn14 Twr_InputMarkers or AeroDyn TowerMotion line2 mesh"
typedef ^ FAST_ModuleMapType MeshMapType ED_P_2_AD_L_T - - - "Map ElastoDyn Tower Base to AeroDyn TowerMotion line2 mesh (rigid tower in AD15, for tower shadow model when modeling drivetrain with SD)"
#typedef ^ FAST_ModuleMapType MeshMapType AD_L_2_ED_P_T - - - "Map AeroDyn14 Twr_InputMarkers or AeroDyn TowerLoad line2 mesh to ElastoDyn TowerPtLoads point mesh"
typedef ^ FAST_ModuleMapType MeshMapType ED_P_2_AD_P_R {:} - - "Map ElastoDyn BladeRootMotion point meshes to AeroDyn BladeRootMotion point meshes"
typedef ^ FAST_ModuleMapType MeshMapType ED_P_2_AD_P_H - - - "Map ElastoDyn HubPtMotion point mesh to AeroDyn HubMotion point mesh"
typedef ^ FAST_ModuleMapType MeshMapType AD_P_2_ED_P_H - - - "Map AeroDyn HubLoad point mesh to ElastoDyn HubPtLoad point mesh"
Expand Down
36 changes: 20 additions & 16 deletions modules/openfast-library/src/FAST_Solver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ SUBROUTINE ED_InputSolve( p_FAST, u_ED, y_ED, p_AD14, y_AD14, y_AD, y_SrvD, u_AD

END IF

ELSEIF ( p_FAST%CompAero == Module_AD ) THEN

IF ( y_AD%rotors(1)%TowerLoad%Committed ) THEN
CALL Transfer_Line2_to_Point( y_AD%rotors(1)%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2, u_AD%rotors(1)%TowerMotion, y_ED%TowerLn2Mesh )
CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
END IF
! ELSEIF ( p_FAST%CompAero == Module_AD ) THEN
!
! IF ( y_AD%rotors(1)%TowerLoad%Committed ) THEN
! CALL Transfer_Line2_to_Point( y_AD%rotors(1)%TowerLoad, u_ED%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2, u_AD%rotors(1)%TowerMotion, y_ED%TowerLn2Mesh )
! CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
! END IF

ELSE
u_ED%TowerPtLoads%Force = 0.0_ReKi
Expand Down Expand Up @@ -616,7 +616,9 @@ SUBROUTINE AD_InputSolve_NoIfW( p_FAST, u_AD, y_SrvD, y_ED, BD, MeshMapData, Err
! tower
IF (u_AD%rotors(1)%TowerMotion%Committed) THEN

CALL Transfer_Line2_to_Line2( y_ED%TowerLn2Mesh, u_AD%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
! CALL Transfer_Line2_to_Line2( y_ED%TowerLn2Mesh, u_AD%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
! CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName//':u_AD%TowerMotion' )
CALL Transfer_Point_to_Line2( y_ED%PlatformPtMesh, u_AD%rotors(1)%TowerMotion, MeshMapData%ED_P_2_AD_L_T, ErrStat2, ErrMsg2 )
CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName//':u_AD%TowerMotion' )

END IF
Expand Down Expand Up @@ -4510,10 +4512,10 @@ SUBROUTINE InitModuleMappings(p_FAST, ED, BD, AD14, AD, HD, SD, ExtPtfm, SrvD, M

! Tower mesh:
IF ( AD14%Input(1)%Twr_InputMarkers%Committed ) THEN
CALL MeshMapCreate( ED%y%TowerLn2Mesh, AD14%Input(1)%Twr_InputMarkers, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':ED_2_AD_TowerMotion' )
CALL MeshMapCreate( AD14%y%Twr_OutputLoads, ED%Input(1)%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':AD_2_ED_TowerLoad' )
! CALL MeshMapCreate( ED%y%TowerLn2Mesh, AD14%Input(1)%Twr_InputMarkers, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
! CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':ED_2_AD_TowerMotion' )
! CALL MeshMapCreate( AD14%y%Twr_OutputLoads, ED%Input(1)%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2 )
! CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':AD_2_ED_TowerLoad' )
END IF

IF (ErrStat >= AbortErrLev ) RETURN
Expand Down Expand Up @@ -4564,13 +4566,15 @@ SUBROUTINE InitModuleMappings(p_FAST, ED, BD, AD14, AD, HD, SD, ExtPtfm, SrvD, M

! Tower mesh:
IF ( AD%Input(1)%rotors(1)%TowerMotion%Committed ) THEN
CALL MeshMapCreate( ED%y%TowerLn2Mesh, AD%Input(1)%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
! CALL MeshMapCreate( ED%y%TowerLn2Mesh, AD%Input(1)%rotors(1)%TowerMotion, MeshMapData%ED_L_2_AD_L_T, ErrStat2, ErrMsg2 )
! CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':ED_2_AD_TowerMotion' )
CALL MeshMapCreate( ED%y%PlatformPtMesh, AD%Input(1)%rotors(1)%TowerMotion, MeshMapData%ED_P_2_AD_L_T, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':ED_2_AD_TowerMotion' )

IF ( AD%y%rotors(1)%TowerLoad%Committed ) THEN
CALL MeshMapCreate( AD%y%rotors(1)%TowerLoad, ED%Input(1)%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2 )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':AD_2_ED_TowerLoad' )
END IF
! IF ( AD%y%rotors(1)%TowerLoad%Committed ) THEN
! CALL MeshMapCreate( AD%y%rotors(1)%TowerLoad, ED%Input(1)%TowerPtLoads, MeshMapData%AD_L_2_ED_P_T, ErrStat2, ErrMsg2 )
! CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName//':AD_2_ED_TowerLoad' )
! END IF
END IF

! Nacelle mesh:
Expand Down
Loading

0 comments on commit 13e17c1

Please sign in to comment.