Skip to content

Commit

Permalink
Merge pull request #2 from andrew-platt/feature/Buoyancy
Browse files Browse the repository at this point in the history
AD buoyancy: minor modification of SolveOption1 algorithm
  • Loading branch information
hkross authored Jan 18, 2022
2 parents 670926d + ff5b24c commit 327a7af
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Binary file modified docs/OtherSupporting/OpenFAST_Algorithms/OpenFAST_Algorithms.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ \section{Input-Output Relationships}
& \mathit{y\_SD}, \mathit{u\_SD\_tmp}, \\
& \mathit{y\_MAP}, \mathit{u\_MAP\_tmp}, \\
& \mathit{y\_FEAM},\mathit{u\_FEAM\_tmp},\\
& \mathit{y\_AD}, \mathit{u\_AD\_tmp}\footnote{Only if AD buoyancy at of hub enabled.}, \\
& \mathit{y\_SrvD},\mathit{u\_SrvD\_tmp}\footnote{Only if using ServoDyn Structural control with platform TMD.} ) % SrvD%PtfmStC only
\end{aligned}$

Expand Down
28 changes: 21 additions & 7 deletions modules/openfast-library/src/FAST_Solver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ SUBROUTINE ED_InputSolve( p_FAST, u_ED, y_ED, p_AD14, y_AD14, y_AD, y_SrvD, u_AD
u_ED%NacelleLoads%Force = 0.0_ReKi
u_ED%NacelleLoads%Moment = 0.0_ReKi

u_ED%HubPtLoad%Force = 0.0_ReKi
u_ED%HubPtLoad%Moment = 0.0_ReKi

! ED inputs from ServoDyn
IF ( p_FAST%CompServo == Module_SrvD ) THEN

Expand Down Expand Up @@ -379,7 +376,9 @@ SUBROUTINE ED_InputSolve( p_FAST, u_ED, y_ED, p_AD14, y_AD14, y_AD, y_SrvD, u_AD
END IF
END IF

IF ( p_FAST%CompAero == Module_AD ) THEN
IF ( p_FAST%CompAero == Module_AD .and. p_FAST%MHK > 0 .and. .not. (p_FAST%CompElast == Module_BD .and. BD_Solve_Option1)) THEN
u_ED%HubPtLoad%Force = 0.0_ReKi
u_ED%HubPtLoad%Moment = 0.0_ReKi
IF ( u_AD%rotors(1)%HubMotion%Committed ) THEN
CALL Transfer_Point_to_Point( y_AD%rotors(1)%HubLoad, MeshMapData%u_ED_HubPtLoad, MeshMapData%AD_P_2_ED_P_H, ErrStat2, ErrMsg2, u_AD%rotors(1)%HubMotion, y_ED%HubPtMotion )
CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
Expand Down Expand Up @@ -2134,6 +2133,7 @@ SUBROUTINE FullOpt1_InputOutputSolve( this_time, p_FAST, calcJacobian &
, u_IceF, y_IceF &
, u_IceD, y_IceD &
, u_SrvD, y_SrvD &
, u_AD, y_AD & ! for buoyancy loads
, MeshMapData , ErrStat, ErrMsg, WriteThisStep )
!..................................................................................................................................

Expand Down Expand Up @@ -2223,6 +2223,10 @@ SUBROUTINE FullOpt1_InputOutputSolve( this_time, p_FAST, calcJacobian &
TYPE(IceD_InputType), INTENT(INOUT) :: u_IceD(:) !< IceDyn inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)
TYPE(SrvD_OutputType), INTENT(IN ) :: y_SrvD !< SrvD outputs
TYPE(SrvD_InputType), INTENT(INOUT) :: u_SrvD !< SrvD inputs (INOUT just because I don't want to use another tempoarary mesh and we'll overwrite this later)

! AeroDyn -- for buoyancy loads on hub
TYPE(AD_OutputType), INTENT(IN ) :: y_AD !< The outputs to AeroDyn14
TYPE(AD_InputType), INTENT(INOUT) :: u_AD !< The inputs to AeroDyn15

TYPE(FAST_ModuleMapType) , INTENT(INOUT) :: MeshMapData !< data for mapping meshes between modules
INTEGER(IntKi) , INTENT( OUT) :: ErrStat !< Error status of the operation
Expand Down Expand Up @@ -3004,7 +3008,7 @@ SUBROUTINE U_FullOpt1_Residual( y_ED2, y_SD2, y_HD2, y_BD2, y_Orca2, y_ExtPtfm2,


IF ( p_FAST%CompElast == Module_BD .and. BD_Solve_Option1) THEN

! Transfer ED motions to BD inputs:
call Transfer_ED_to_BD_tmp( y_ED2, MeshMapData, ErrStat2, ErrMsg2 ) ! sets MeshMapData%u_BD_RootMotion(:)
CALL SetErrStat(ErrStat2,ErrMsg2, ErrStat, ErrMsg, RoutineName)
Expand All @@ -3020,6 +3024,14 @@ SUBROUTINE U_FullOpt1_Residual( y_ED2, y_SD2, y_HD2, y_BD2, y_Orca2, y_ExtPtfm2,
MeshMapData%u_ED_HubPtLoad%Force = MeshMapData%u_ED_HubPtLoad%Force + MeshMapData%u_ED_HubPtLoad_2%Force
MeshMapData%u_ED_HubPtLoad%Moment = MeshMapData%u_ED_HubPtLoad%Moment + MeshMapData%u_ED_HubPtLoad_2%Moment
end do
IF ( p_FAST%CompAero == Module_AD .and. p_FAST%MHK > 0) THEN
IF ( u_AD%rotors(1)%HubMotion%Committed ) THEN
CALL Transfer_Point_to_Point( y_AD%rotors(1)%HubLoad, MeshMapData%u_ED_HubPtLoad_2, MeshMapData%AD_P_2_ED_P_H, ErrStat2, ErrMsg2, u_AD%rotors(1)%HubMotion, y_ED2%HubPtMotion )
CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
MeshMapData%u_ED_HubPtLoad%Force = MeshMapData%u_ED_HubPtLoad%Force + MeshMapData%u_ED_HubPtLoad_2%Force
MeshMapData%u_ED_HubPtLoad%Moment = MeshMapData%u_ED_HubPtLoad%Moment + MeshMapData%u_ED_HubPtLoad_2%Moment
END IF
END IF
END IF


Expand Down Expand Up @@ -5102,7 +5114,7 @@ SUBROUTINE CalcOutputs_And_SolveForInputs( n_t_global, this_time, this_state, ca
END IF

!> Solve option 1 (rigorous solve on loads/accelerations)
CALL SolveOption1(this_time, this_state, calcJacobian, p_FAST, ED, BD, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, SrvD, MeshMapData, ErrStat2, ErrMsg2, WriteThisStep)
CALL SolveOption1(this_time, this_state, calcJacobian, p_FAST, ED, BD, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, SrvD, AD, MeshMapData, ErrStat2, ErrMsg2, WriteThisStep)
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )


Expand Down Expand Up @@ -5165,7 +5177,7 @@ END SUBROUTINE CalcOutputs_And_SolveForInputs
!----------------------------------------------------------------------------------------------------------------------------------
!> This routine implements the "option 1" solve for all inputs with direct links to HD, SD, ExtPtfm, MAP, OrcaFlex interface, and the ED
!! platform reference point. Also in solve option 1 are the BD-ED blade root coupling.
SUBROUTINE SolveOption1(this_time, this_state, calcJacobian, p_FAST, ED, BD, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, SrvD, MeshMapData, ErrStat, ErrMsg, WriteThisStep )
SUBROUTINE SolveOption1(this_time, this_state, calcJacobian, p_FAST, ED, BD, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, SrvD, AD, MeshMapData, ErrStat, ErrMsg, WriteThisStep )
!...............................................................................................................................
REAL(DbKi) , intent(in ) :: this_time !< The current simulation time (actual or time of prediction)
INTEGER(IntKi) , intent(in ) :: this_state !< Index into the state array (current or predicted states)
Expand All @@ -5186,6 +5198,7 @@ SUBROUTINE SolveOption1(this_time, this_state, calcJacobian, p_FAST, ED, BD, HD,
TYPE(OrcaFlex_Data), INTENT(INOUT) :: Orca !< OrcaFlex interface data
TYPE(IceFloe_Data), INTENT(INOUT) :: IceF !< IceFloe data
TYPE(IceDyn_Data), INTENT(INOUT) :: IceD !< All the IceDyn data used in time-step loop
TYPE(AeroDyn_Data), INTENT(INOUT) :: AD !< AeroDyn data

TYPE(FAST_ModuleMapType), INTENT(INOUT) :: MeshMapData !< Data for mapping between modules

Expand Down Expand Up @@ -5275,6 +5288,7 @@ SUBROUTINE SolveOption1(this_time, this_state, calcJacobian, p_FAST, ED, BD, HD,
, IceF%Input(1), IceF%y &
, IceD%Input(1,:), IceD%y & ! bjj: I don't really want to make temp copies of input types. perhaps we should pass the whole Input() structure? (likewise for BD)...
, SrvD%Input(1), SrvD%y &
, AD%Input(1), AD%y &
, MeshMapData , ErrStat2, ErrMsg2, WriteThisStep )
CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

Expand Down

0 comments on commit 327a7af

Please sign in to comment.