Skip to content

Commit

Permalink
Merge pull request OpenFAST#1946 from andrew-platt/b/ExtLoads_mergeFix
Browse files Browse the repository at this point in the history
Fix issues from PR OpenFAST#1932
  • Loading branch information
andrew-platt authored Dec 29, 2023
2 parents bfbf791 + a05657e commit 5d8cc6a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
7 changes: 5 additions & 2 deletions modules/openfast-library/src/FAST_Library.f90
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,11 @@ subroutine FAST_ExtInfw_Init(iTurb, TMax, InputFileName_c, TurbID, OutFileRoot_c
IF (NumBl_c > 0) THEN
NumBlElem_c = Turbine(iTurb)%AD%Input(1)%rotors(1)%BladeMotion(1)%Nnodes
END IF
!FIXME: need some checks on this. If the Tower mesh is not initialized, this will be garbage
NumTwrElem_c = Turbine(iTurb)%AD%y%rotors(1)%TowerLoad%Nnodes
if (Turbine(iTurb)%AD%y%rotors(1)%TowerLoad%Committed) then
NumTwrElem_c = Turbine(iTurb)%AD%y%rotors(1)%TowerLoad%Nnodes
else
NumTwrElem_c = 0
endif
ELSE
NumBl_c = 0
NumBlElem_c = 0
Expand Down
2 changes: 1 addition & 1 deletion modules/openfast-library/src/FAST_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ param ^ - INTEGER Module_ED - 4 - "ElastoDyn" -
param ^ - INTEGER Module_BD - 5 - "BeamDyn" -
param ^ - INTEGER Module_AD14 - 6 - "AeroDyn14" -
param ^ - INTEGER Module_AD - 7 - "AeroDyn" -
param ^ - INTEGER Module_ExtLd - 8 - "AeroDyn" -
param ^ - INTEGER Module_ExtLd - 8 - "ExternalLoads" -
param ^ - INTEGER Module_SrvD - 9 - "ServoDyn" -
param ^ - INTEGER Module_SeaSt - 10 - "SeaState" -
param ^ - INTEGER Module_HD - 11 - "HydroDyn" -
Expand Down
11 changes: 6 additions & 5 deletions modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7492,7 +7492,7 @@ SUBROUTINE FAST_Solution(t_initial, n_t_global, p_FAST, y_FAST, m_FAST, ED, BD,
!----------------------------------------------------------------------------------------
!! Write outputs
!----------------------------------------------------------------------------------------
call FAST_WriteOutput(m_FAST%t_global, n_t_global_next, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, AD14, AD, ExtLd, IfW, ExtInfw, SC_DX, &
call FAST_WriteOutput(t_initial, n_t_global_next, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, AD14, AD, ExtLd, IfW, ExtInfw, SC_DX, &
SeaSt, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat2, ErrMsg2 )
CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

Expand Down Expand Up @@ -8037,10 +8037,10 @@ SUBROUTINE FAST_WriteOutput_T(t_initial, n_t_global, Turbine, ErrStat, ErrMsg )
END SUBROUTINE FAST_WriteOutput_T
!----------------------------------------------------------------------------------------------------------------------------------
!> This routine writes the outputs at this timestep
SUBROUTINE FAST_WriteOutput(t_global, n_t_global, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, AD14, AD, ExtLd, IfW, ExtInfw, SC_DX, &
SUBROUTINE FAST_WriteOutput(t_initial, n_t_global, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, AD14, AD, ExtLd, IfW, ExtInfw, SC_DX, &
SeaSt, HD, SD, ExtPtfm, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat, ErrMsg )

REAL(DbKi), INTENT(IN ) :: t_global !< initial time
REAL(DbKi), INTENT(IN ) :: t_initial !< initial time
INTEGER(IntKi), INTENT(IN ) :: n_t_global !< loop counter

TYPE(FAST_ParameterType), INTENT(IN ) :: p_FAST !< Parameters for the glue code
Expand Down Expand Up @@ -8074,7 +8074,7 @@ SUBROUTINE FAST_WriteOutput(t_global, n_t_global, p_FAST, y_FAST, m_FAST, ED, BD

! local variables
INTEGER(IntKi) :: I, k ! generic loop counters

REAL(DbKi) :: t_global ! this simulation time (m_FAST%t_global + p_FAST%dt)
INTEGER(IntKi) :: ErrStat2
CHARACTER(ErrMsgLen) :: ErrMsg2
CHARACTER(*), PARAMETER :: RoutineName = 'FAST_WriteOutput'
Expand All @@ -8083,11 +8083,12 @@ SUBROUTINE FAST_WriteOutput(t_global, n_t_global, p_FAST, y_FAST, m_FAST, ED, BD
ErrStat = ErrID_None
ErrMsg = ""

t_global = t_initial + n_t_global*p_FAST%DT

!----------------------------------------------------------------------------------------
!! Check to see if we should output data this time step:
!----------------------------------------------------------------------------------------
CALL WriteOutputToFile(n_t_global, m_FAST%t_global, p_FAST, y_FAST, ED, BD, AD14, AD, IfW, ExtInfw, SeaSt, HD, SD, ExtPtfm, &
CALL WriteOutputToFile(n_t_global, t_global, p_FAST, y_FAST, ED, BD, AD14, AD, IfW, ExtInfw, SeaSt, HD, SD, ExtPtfm, &
SrvD, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat2, ErrMsg2)
CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )

Expand Down
2 changes: 1 addition & 1 deletion modules/openfast-library/src/FAST_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ MODULE FAST_Types
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_BD = 5 ! BeamDyn [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_AD14 = 6 ! AeroDyn14 [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_AD = 7 ! AeroDyn [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_ExtLd = 8 ! AeroDyn [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_ExtLd = 8 ! ExternalLoads [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_SrvD = 9 ! ServoDyn [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_SeaSt = 10 ! SeaState [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: Module_HD = 11 ! HydroDyn [-]
Expand Down

0 comments on commit 5d8cc6a

Please sign in to comment.