Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/helics' into helics
Browse files Browse the repository at this point in the history
  • Loading branch information
abhineet-gupta committed Jan 3, 2024
2 parents 3bc00d0 + d549dc8 commit 066d6ce
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 16 deletions.
7 changes: 4 additions & 3 deletions ROSCO/rosco_registry/rosco_types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ ControlParameters:
<<: *integer
description: output every this many steps

n_DT_ZMQ:
<<: *integer
description: Send measurements to ZMQ after this many time steps

# Filters
F_LPFType:
<<: *integer
Expand Down Expand Up @@ -1000,9 +1004,6 @@ LocalVariables:
RotSpeedF:
<<: *real
description: Filtered LSS (generator) speed [rad/s].
VS_RefSpd:
<<: *real
description: Generator speed set point of torque controller [rad/s]
PC_RefSpd:
<<: *real
description: Generator speed set point of pitch controller [rad/s]
Expand Down
2 changes: 1 addition & 1 deletion ROSCO/rosco_registry/write_wfc_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def write_zmq_f90(wfc_int_yaml):
f.write("#endif\n")
f.write("\n")
f.write(" ! Communicate if threshold has been reached\n")
f.write(" IF (ABS(MODULO(LocalVar%Time, CntrPar%ZMQ_UpdatePeriod)) < LocalVar%DT * CntrPar%ZMQ_UpdatePeriod .OR. LocalVar%iStatus == -1) THEN\n")
f.write(" IF ( MOD(LocalVar%n_DT, CntrPar%n_DT_ZMQ) == 0 .OR. LocalVar%iStatus == -1 ) THEN\n")
f.write(" ! Collect measurements to be sent to ZeroMQ server\n")

## Write measurements
Expand Down
1 change: 1 addition & 0 deletions ROSCO/src/ROSCO_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MODULE ROSCO_Types
INTEGER(IntKi) :: Echo ! 0 - no Echo, 1 - Echo input data to <RootName>.echo
REAL(DbKi) :: DT_Out ! Output time step
INTEGER(IntKi) :: n_DT_Out ! output every this many steps
INTEGER(IntKi) :: n_DT_ZMQ ! Send measurements to ZMQ after this many time steps
INTEGER(IntKi) :: F_LPFType ! Low pass filter on the rotor and generator speed {1 - first-order low-pass filter, 2 - second-order low-pass filter}, [rad/s]
REAL(DbKi) :: F_LPFCornerFreq ! Corner frequency (-3dB point) in the first-order low-pass filter, [rad/s]
REAL(DbKi) :: F_LPFDamping ! Damping coefficient [used only when F_FilterType = 2]
Expand Down
6 changes: 6 additions & 0 deletions ROSCO/src/ReadSetParameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ SUBROUTINE ReadControlParameterFileSub(CntrPar, LocalVar, accINFILE, accINFILE_s

! DT_Out
CntrPar%n_DT_Out = NINT(CntrPar%DT_Out / LocalVar%DT)
CntrPar%n_DT_ZMQ = NINT(CntrPar%ZMQ_UpdatePeriod / LocalVar%DT)


! Fix Paths (add relative paths if called from another dir, UnEc)
Expand Down Expand Up @@ -836,6 +837,11 @@ SUBROUTINE CheckInputs(LocalVar, CntrPar, avrSWAP, ErrVar, size_avcMSG)
ErrVar%aviFAIL = -1
ErrVar%ErrMsg = 'DT_Out must be a factor of DT in OpenFAST'
ENDIF

IF (ABS(CntrPar%ZMQ_UpdatePeriod - Localvar%DT * CntrPar%n_DT_ZMQ) > 0.001_DbKi) THEN
ErrVar%aviFAIL = -1
ErrVar%ErrMsg = 'ZMQ_UpdatePeriod must be a factor of DT in OpenFAST'
ENDIF
!------- CONTROLLER FLAGS -------------------------------------------------

! F_LPFType
Expand Down
2 changes: 1 addition & 1 deletion ROSCO/src/ZeroMQInterface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end subroutine zmq_client
#endif

! Communicate if threshold has been reached
IF (ABS(MODULO(LocalVar%Time, CntrPar%ZMQ_UpdatePeriod)) < LocalVar%DT * CntrPar%ZMQ_UpdatePeriod .OR. LocalVar%iStatus == -1) THEN
IF ( MOD(LocalVar%n_DT, CntrPar%n_DT_ZMQ) == 0 .OR. LocalVar%iStatus == -1 ) THEN
! Collect measurements to be sent to ZeroMQ server
turbine_measurements(1) = LocalVar%ZMQ_ID
turbine_measurements(2) = LocalVar%iStatus
Expand Down
2 changes: 1 addition & 1 deletion ROSCO_toolbox/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def write_DISCON(turbine, controller, param_file='DISCON.IN', txt_filename='Cp_C
file.write('!------- ZeroMQ Interface ---------------------------------------------------------\n')
file.write('"{}" ! ZMQ_CommAddress - {} \n'.format(rosco_vt['ZMQ_CommAddress'],input_descriptions['ZMQ_CommAddress']))
file.write('{:<11f} ! ZMQ_UpdatePeriod - {}\n'.format(rosco_vt['ZMQ_UpdatePeriod'],input_descriptions['ZMQ_UpdatePeriod']))
file.write('{:<11d} ! ZMQ_ID - {}\n'.format(rosco_vt['ZMQ_ID'],input_descriptions['ZMQ_ID']))
file.write('{:<11d} ! ZMQ_ID - {}\n'.format(int(rosco_vt['ZMQ_ID']),input_descriptions['ZMQ_ID']))
file.write('\n')
file.write('!------- Cable Control ---------------------------------------------------------\n')
file.write('{:<11d} ! CC_Group_N - {}\n'.format(len(rosco_vt['CC_GroupIndex']), input_descriptions['CC_Group_N']))
Expand Down
5 changes: 3 additions & 2 deletions Test_Cases/BAR_10/BAR_10_DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the BAR_10 wind turbine
! - File written using ROSCO version 2.8.0 controller tuning logic on 10/18/23
! - File written using ROSCO version 2.8.0 controller tuning logic on 11/17/23

!------- SIMULATION CONTROL ------------------------------------------------------------
1 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: LoggingLevel 1 + ROSCO LocalVars (.dbg2) 3: LoggingLevel 2 + complete avrSWAP-array (.dbg3)}
Expand Down Expand Up @@ -180,7 +180,8 @@

!------- ZeroMQ Interface ---------------------------------------------------------
"tcp://localhost:5555" ! ZMQ_CommAddress - Communication address for ZMQ server, (e.g. "tcp://localhost:5555")
2.000000 ! ZMQ_UpdatePeriod - Call ZeroMQ every [x] seconds, [s]
1.000000 ! ZMQ_UpdatePeriod - Update period at zmq interface to send measurements and wait for setpoint [sec.]
0 ! ZMQ_ID - Integer identifier of turbine

!------- Cable Control ---------------------------------------------------------
1 ! CC_Group_N - Number of cable control groups
Expand Down
5 changes: 3 additions & 2 deletions Test_Cases/IEA-15-240-RWT-UMaineSemi/DISCON-UMaineSemi.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the IEA-15-240-RWT-UMaineSemi wind turbine
! - File written using ROSCO version 2.8.0 controller tuning logic on 10/18/23
! - File written using ROSCO version 2.8.0 controller tuning logic on 11/17/23

!------- SIMULATION CONTROL ------------------------------------------------------------
2 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: LoggingLevel 1 + ROSCO LocalVars (.dbg2) 3: LoggingLevel 2 + complete avrSWAP-array (.dbg3)}
Expand Down Expand Up @@ -180,7 +180,8 @@

!------- ZeroMQ Interface ---------------------------------------------------------
"tcp://localhost:5555" ! ZMQ_CommAddress - Communication address for ZMQ server, (e.g. "tcp://localhost:5555")
2.000000 ! ZMQ_UpdatePeriod - Call ZeroMQ every [x] seconds, [s]
1.000000 ! ZMQ_UpdatePeriod - Update period at zmq interface to send measurements and wait for setpoint [sec.]
0 ! ZMQ_ID - Integer identifier of turbine

!------- Cable Control ---------------------------------------------------------
1 ! CC_Group_N - Number of cable control groups
Expand Down
5 changes: 3 additions & 2 deletions Test_Cases/MHK_RM1/MHK_RM1_DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the MHK_RM1_Floating wind turbine
! - File written using ROSCO version 2.8.0 controller tuning logic on 10/18/23
! - File written using ROSCO version 2.8.0 controller tuning logic on 11/17/23

!------- SIMULATION CONTROL ------------------------------------------------------------
2 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: LoggingLevel 1 + ROSCO LocalVars (.dbg2) 3: LoggingLevel 2 + complete avrSWAP-array (.dbg3)}
Expand Down Expand Up @@ -180,7 +180,8 @@

!------- ZeroMQ Interface ---------------------------------------------------------
"tcp://localhost:5555" ! ZMQ_CommAddress - Communication address for ZMQ server, (e.g. "tcp://localhost:5555")
2.000000 ! ZMQ_UpdatePeriod - Call ZeroMQ every [x] seconds, [s]
1.000000 ! ZMQ_UpdatePeriod - Update period at zmq interface to send measurements and wait for setpoint [sec.]
0 ! ZMQ_ID - Integer identifier of turbine

!------- Cable Control ---------------------------------------------------------
1 ! CC_Group_N - Number of cable control groups
Expand Down
5 changes: 3 additions & 2 deletions Test_Cases/NREL-5MW/DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the NREL-5MW wind turbine
! - File written using ROSCO version 2.8.0 controller tuning logic on 10/18/23
! - File written using ROSCO version 2.8.0 controller tuning logic on 11/17/23

!------- SIMULATION CONTROL ------------------------------------------------------------
1 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: LoggingLevel 1 + ROSCO LocalVars (.dbg2) 3: LoggingLevel 2 + complete avrSWAP-array (.dbg3)}
Expand Down Expand Up @@ -180,7 +180,8 @@

!------- ZeroMQ Interface ---------------------------------------------------------
"tcp://localhost:5555" ! ZMQ_CommAddress - Communication address for ZMQ server, (e.g. "tcp://localhost:5555")
2.000000 ! ZMQ_UpdatePeriod - Call ZeroMQ every [x] seconds, [s]
1.000000 ! ZMQ_UpdatePeriod - Update period at zmq interface to send measurements and wait for setpoint [sec.]
0 ! ZMQ_ID - Integer identifier of turbine

!------- Cable Control ---------------------------------------------------------
1 ! CC_Group_N - Number of cable control groups
Expand Down
5 changes: 3 additions & 2 deletions Test_Cases/NREL_2p8_127/NREL-2p8-127_DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the NREL-2p8-127 wind turbine
! - File written using ROSCO version 2.8.0 controller tuning logic on 10/18/23
! - File written using ROSCO version 2.8.0 controller tuning logic on 11/17/23

!------- SIMULATION CONTROL ------------------------------------------------------------
2 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: LoggingLevel 1 + ROSCO LocalVars (.dbg2) 3: LoggingLevel 2 + complete avrSWAP-array (.dbg3)}
Expand Down Expand Up @@ -180,7 +180,8 @@

!------- ZeroMQ Interface ---------------------------------------------------------
"tcp://localhost:5555" ! ZMQ_CommAddress - Communication address for ZMQ server, (e.g. "tcp://localhost:5555")
2.000000 ! ZMQ_UpdatePeriod - Call ZeroMQ every [x] seconds, [s]
1.000000 ! ZMQ_UpdatePeriod - Update period at zmq interface to send measurements and wait for setpoint [sec.]
0 ! ZMQ_ID - Integer identifier of turbine

!------- Cable Control ---------------------------------------------------------
1 ! CC_Group_N - Number of cable control groups
Expand Down

0 comments on commit 066d6ce

Please sign in to comment.