Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZMQ runtime communication with FAST #2153

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions modules/openfast-library/src/FAST_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,22 @@ typedef ^ FAST_ParameterType ReKi WS_TSR {:} - - "List of WindSpeed or TSRs (dep
typedef ^ FAST_ParameterType ReKi Pitch {:} - - "List of pitch angles for aeromap generation" "(rad)"
typedef ^ FAST_ParameterType IntKi GearBox_index - - - "Index to gearbox rotation in state array (for steady-state calculations)" -

# ................................................... ZMQ PROTOCOL ...........................................................
typedef ^ FAST_ParameterType LOGICAL ZmqOn - .false. - "zmq activation flag" -
typedef ^ FAST_ParameterType CHARACTER(1024) ZmqInAddress - - - "address for ZMQ REQ-REP protocol" -
typedef ^ FAST_ParameterType IntKi ZmqInNbr - - - "number of ZMQ REQ-REP channels" -
typedef ^ FAST_ParameterType CHARACTER(ChanLen) ZmqInChannels {:} - - "address for ZMQ REQ-REP protocol" -

typedef ^ FAST_ParameterType CHARACTER(1024) ZmqOutAddress - - - "address for ZMQ PUB-SUB protocol" -
typedef ^ FAST_ParameterType IntKi ZmqOutNbr - - - "number of ZMQ PUB-SUB channels" -

typedef ^ FAST_ParameterType CHARACTER(ChanLen) ZmqOutChannels {:} - - "variables to pass ZMQ PUB-SUB protocol" -
typedef ^ FAST_ParameterType IntKi ZmqOutChnlsIdx {:} - - "indexes of channels to be broadcasted" -

typedef ^ FAST_ParameterType CHARACTER(ChanLen) ZmqOutChannelsNames {:} - - "names for ZMQ PUB-SUB protocol" -
typedef ^ FAST_ParameterType ReKi ZmqOutChannelsAry {:} - - "array to pass ZMQ PUB-SUB protocol" -
# ............................................................................................................................


# SAVED OPERATING POINT DATA FOR VTKLIN (visualization of mode shapes from linearization analysis)
# ..... IceDyn OP data .......................................................................................................
Expand Down
9 changes: 6 additions & 3 deletions modules/openfast-library/src/FAST_SS_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@ SUBROUTINE FAST_SteadyState_T( Turbine, ErrStat, ErrMsg )
CHARACTER(*), INTENT( OUT) :: ErrMsg !< Error message if ErrStat /= ErrID_None

CALL FAST_SteadyState( Turbine%p_FAST, Turbine%y_FAST, Turbine%m_FAST, &
Turbine%ED, Turbine%BD, Turbine%AD, Turbine%MeshMapData, ErrStat, ErrMsg )
Turbine%ED, Turbine%BD, Turbine%AD, Turbine%MeshMapData, &
Turbine%TurbID, ErrStat, ErrMsg )

END SUBROUTINE FAST_SteadyState_T
!----------------------------------------------------------------------------------------------------------------------------------
!> This routine takes data from n_t_global and gets values at n_t_global + 1
SUBROUTINE FAST_SteadyState(p_FAST, y_FAST, m_FAST, ED, BD, AD, MeshMapData, ErrStat, ErrMsg )
SUBROUTINE FAST_SteadyState(p_FAST, y_FAST, m_FAST, ED, BD, AD, MeshMapData, TurbID, ErrStat, ErrMsg )

TYPE(FAST_ParameterType), INTENT(IN ) :: p_FAST !< Parameters for the glue code
TYPE(FAST_OutputFileType),INTENT(INOUT) :: y_FAST !< Output variables for the glue code
Expand Down Expand Up @@ -149,6 +150,7 @@ SUBROUTINE FAST_SteadyState(p_FAST, y_FAST, m_FAST, ED, BD, AD, MeshMapData, Err
CHARACTER(MaxWrScrLen), PARAMETER :: BlankLine = " "

CHARACTER(*), PARAMETER :: RoutineName = 'FAST_SteadyState'
INTEGER(IntKi) :: TurbID !< Turbine ID for consistent zmq comms.

ErrStat = ErrID_None
ErrMsg = ""
Expand Down Expand Up @@ -219,7 +221,8 @@ SUBROUTINE FAST_SteadyState(p_FAST, y_FAST, m_FAST, ED, BD, AD, MeshMapData, Err

CALL WrOutputLine( n_global, p_FAST, y_FAST, UnusedAry, UnusedAry, ED%y%WriteOutput, &
AD%y, UnusedAry, UnusedAry, UnusedAry, UnusedAry, UnusedAry, UnusedAry, &
UnusedAry, UnusedAry, UnusedAry, UnusedAry, y_IceD, BD%y, ErrStat2, ErrMsg2 )
UnusedAry, UnusedAry, UnusedAry, UnusedAry, y_IceD, BD%y, &
p_FAST%ZmqOutChannelsAry, TurbID, ErrStat2, ErrMsg2 )

call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (ErrStat >= AbortErrLev) then
Expand Down
Loading
Loading