Skip to content

Commit 1b2ccf7

Browse files
committed
Merge remote-tracking branch 'origin/main' into develop
2 parents e42d54b + 84a2f8b commit 1b2ccf7

16 files changed

Lines changed: 97 additions & 66 deletions

File tree

.github/workflows/CI_rosco-compile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
strategy:
109109
fail-fast: false #true
110110
matrix:
111-
os: ["ubuntu-latest", "macOS-13", "macOS-14", "windows-latest"] #mac-13 intel, mac-14 arm
111+
os: ["ubuntu-latest", "macOS-14", "macOS-latest", "windows-latest"] #mac-13 intel, mac-14 arm
112112
python-version: ["3.11", "3.12"]
113113

114114
steps:

.github/workflows/Publish_ROSCO.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: [ubuntu-latest, windows-latest, macos-13, macos-14, macos-15]
15+
os: [ubuntu-latest, windows-latest, macos-14, macos-15]
1616

1717
steps:
1818
- name: Set up QEMU
@@ -64,14 +64,6 @@ jobs:
6464
CC: ${{ steps.install_cc.outputs.cc }}
6565
CXX: ${{ steps.install_cc.outputs.cxx }}
6666

67-
- name: Build wheels mac-13
68-
if: contains( matrix.os, 'macos-13')
69-
uses: pypa/cibuildwheel@v2.23.3
70-
env:
71-
CC: ${{ steps.install_cc.outputs.cc }}
72-
CXX: ${{ steps.install_cc.outputs.cxx }}
73-
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="13.0"
74-
7567
- name: Build wheels mac-14
7668
if: contains( matrix.os, 'macos-14')
7769
uses: pypa/cibuildwheel@v2.23.3

Examples/02_ccblade.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,53 @@
1616
from rosco.toolbox import turbine as ROSCO_turbine
1717
from rosco.toolbox.utilities import write_rotor_performance
1818
from rosco.toolbox.inputs.validation import load_rosco_yaml
19+
import matplotlib.pyplot as plt
20+
21+
22+
this_dir = os.path.dirname(os.path.abspath(__file__))
23+
tune_dir = os.path.join(this_dir,'Tune_Cases')
24+
25+
example_out_dir = os.path.join(this_dir,'examples_out')
26+
if not os.path.isdir(example_out_dir):
27+
os.makedirs(example_out_dir)
28+
1929

2030
def main():
31+
# Inputs: tuning yaml (will point to openfast model file for generating Cp surface)
32+
parameter_filename = os.path.join(tune_dir,'IEA15MW.yaml')
33+
34+
# Output: rotor performance text file
35+
txt_filename = os.path.join(example_out_dir,'02_Cp_Ct_Cq.Ex03.txt')
36+
2137
# Initialize parameter dictionaries
2238
turbine_params = {}
23-
control_params = {}
2439

25-
this_dir = os.path.dirname(os.path.abspath(__file__))
26-
example_out_dir = os.path.join(this_dir,'examples_out')
27-
if not os.path.isdir(example_out_dir):
28-
os.makedirs(example_out_dir)
2940

3041
# Load yaml file
31-
this_dir = os.path.dirname(os.path.abspath(__file__))
32-
tune_dir = os.path.join(this_dir,'Tune_Cases')
33-
parameter_filename = os.path.join(tune_dir,'NREL5MW.yaml')
3442
inps = load_rosco_yaml(parameter_filename)
3543
path_params = inps['path_params']
3644
turbine_params = inps['turbine_params']
37-
controller_params = inps['controller_params']
3845

3946
# Load turbine data from openfast model
4047
turbine = ROSCO_turbine.Turbine(turbine_params)
4148
turbine.load_from_fast(
4249
path_params['FAST_InputFile'],
43-
os.path.join(tune_dir,path_params['FAST_directory']),
50+
os.path.join(os.path.dirname(parameter_filename),path_params['FAST_directory']),
4451
rot_source='cc-blade',
4552
txt_filename=None)
4653

4754
# Write rotor performance text file
48-
txt_filename = os.path.join(example_out_dir,'02_Cp_Ct_Cq.Ex03.txt')
4955
write_rotor_performance(turbine,txt_filename=txt_filename)
5056

57+
# plot rotor performance
58+
print('Plotting Cp data')
59+
turbine.Cp.plot_performance()
60+
61+
if False:
62+
plt.show()
63+
else:
64+
plt.savefig(os.path.join(example_out_dir,'01_NREL5MW_Cp.png'))
65+
5166
if __name__ == "__main__":
5267
main()
5368

Examples/03_tune_controller.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,46 @@
2525
from rosco.toolbox.utilities import write_DISCON
2626
from rosco.toolbox.inputs.validation import load_rosco_yaml
2727

28+
this_dir = os.path.dirname(os.path.abspath(__file__))
29+
tune_dir = os.path.join(this_dir,'Tune_Cases')
30+
example_out_dir = os.path.join(this_dir,'examples_out')
31+
os.makedirs(example_out_dir, exist_ok=True)
32+
2833
def main():
34+
# Inputs: tuning yaml (will point to openfast model file)
35+
parameter_filename = os.path.join(tune_dir,'IEA15MW.yaml')
36+
37+
# Output: controller DISCON input file
38+
param_file = os.path.join(example_out_dir,'IEA15MW_DISCON.IN')
39+
2940
# Load yaml file
30-
this_dir = os.path.dirname(os.path.abspath(__file__))
31-
tune_dir = os.path.join(this_dir,'Tune_Cases')
32-
parameter_filename = os.path.join(tune_dir,'NREL5MW.yaml')
3341
inps = load_rosco_yaml(parameter_filename)
3442
path_params = inps['path_params']
3543
turbine_params = inps['turbine_params']
3644
controller_params = inps['controller_params']
45+
yaml_dir = os.path.dirname(parameter_filename)
3746

3847
# Instantiate turbine, controller, and file processing classes
3948
turbine = ROSCO_turbine.Turbine(turbine_params)
4049
controller = ROSCO_controller.Controller(controller_params)
4150

4251
# Load turbine data from OpenFAST and rotor performance text file
43-
cp_filename = os.path.join(tune_dir,path_params['rotor_performance_filename'])
52+
cp_filename = os.path.join(yaml_dir,path_params['rotor_performance_filename'])
4453
turbine.load_from_fast(
4554
path_params['FAST_InputFile'],
46-
os.path.join(tune_dir,path_params['FAST_directory']),
55+
os.path.join(yaml_dir,path_params['FAST_directory']),
4756
rot_source='txt',txt_filename= cp_filename
4857
)
4958

5059
# Tune controller
5160
controller.tune_controller(turbine)
5261

5362
# Write parameter input file
54-
example_out_dir = os.path.join(this_dir,'examples_out')
55-
param_file = os.path.join(example_out_dir,'03_DISCON.IN')
56-
write_DISCON(turbine,controller,
57-
param_file=param_file,
58-
txt_filename=cp_filename
59-
)
63+
write_DISCON(
64+
turbine,controller,
65+
param_file=param_file,
66+
txt_filename=cp_filename
67+
)
6068

6169
# Plot gain schedule
6270
fig, ax = plt.subplots(2,2,constrained_layout=True,sharex=True)
@@ -76,9 +84,7 @@ def main():
7684
ax[3].set_ylabel('Integral Gain')
7785

7886
plt.suptitle('Pitch Controller Gains')
79-
80-
if not os.path.isdir(example_out_dir):
81-
os.makedirs(example_out_dir)
87+
8288

8389
if False:
8490
plt.show()

Examples/06_peak_shaving.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# Python modules
3232
import matplotlib.pyplot as plt
3333
import os
34+
import numpy as np
3435
# ROSCO toolbox modules
3536
from rosco.toolbox import controller as ROSCO_controller
3637
from rosco.toolbox import turbine as ROSCO_turbine
@@ -45,6 +46,8 @@ def main():
4546

4647
# Load yaml file
4748
parameter_filename = os.path.join(tune_dir,'NREL5MW.yaml')
49+
yaml_dir = os.path.dirname(parameter_filename)
50+
4851
inps = load_rosco_yaml(parameter_filename)
4952
path_params = inps['path_params']
5053
turbine_params = inps['turbine_params']
@@ -61,19 +64,19 @@ def main():
6164
# Load turbine data from OpenFAST and rotor performance text file
6265
turbine.load_from_fast(
6366
path_params['FAST_InputFile'],
64-
os.path.join(tune_dir,path_params['FAST_directory']),
65-
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
67+
os.path.join(yaml_dir,path_params['FAST_directory']),
68+
rot_source='txt',txt_filename=os.path.join(yaml_dir,path_params['rotor_performance_filename'])
6669
)
6770
# Tune controller
6871
controller.tune_controller(turbine)
6972

7073
# Plot minimum pitch schedule
7174
fig, ax = plt.subplots(1,1)
72-
ax.plot(controller.v, controller.pitch_op,label='Steady State Operation')
73-
ax.plot(controller.v, controller.ps_min_bld_pitch, label='Minimum Pitch Schedule')
75+
ax.plot(controller.v, np.degrees(controller.pitch_op), label='Steady State Operation')
76+
ax.plot(controller.v, np.degrees(controller.ps_min_bld_pitch), label='Minimum Pitch Schedule')
7477
ax.legend()
7578
ax.set_xlabel('Wind speed (m/s)')
76-
ax.set_ylabel('Blade pitch (rad)')
79+
ax.set_ylabel('Blade pitch (deg)')
7780

7881
if False:
7982
plt.show()

Examples/Test_Cases/BAR_10/BAR_10_DISCON.IN

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Controller parameter input file for the BAR_10 wind turbine
2-
! - File written using ROSCO version 2.10.0 controller tuning logic on 09/08/25
2+
! - File written using ROSCO version 2.10.1 controller tuning logic on 11/26/25
33

44
!------- SIMULATION CONTROL ------------------------------------------------------------
55
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)
@@ -101,7 +101,7 @@
101101

102102
!------- SETPOINT SMOOTHER ---------------------------------------------
103103
1.00000 ! SS_VSGain - Variable speed torque controller setpoint smoother gain, [-].
104-
0.00100 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
104+
0.05000 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
105105

106106
!------- POWER REFERENCE TRACKING --------------------------------------
107107
0 ! PRC_Comm - Power reference communication mode when PRC_Mode = 2, 0- use constant DISCON inputs, 1- use open loop inputs, 2- use ZMQ inputs
@@ -163,7 +163,7 @@
163163
200.0000 100.0000 ! SU_LoadHoldDuration - Array containing duration to hold the partial loads during startup [s]
164164

165165
!------- SHUTDOWN -----------------------------------------------------------
166-
0 ! SD_TimeActivate - Time to acitvate shutdown modes, [s]
166+
0 ! SD_TimeActivate - Time to acitvate shutdown modes; no shutdown events will occur before this time. [s]
167167
0 ! SD_EnablePitch - Shutdown when collective blade pitch exceeds a threshold, [-]
168168
0 ! SD_EnableYawError - Shutdown when yaw error exceeds a threshold, [-]
169169
0 ! SD_EnableGenSpeed - Shutdown when generator speed exceeds a threshold, [-]

Examples/Test_Cases/IEA-15-240-RWT/IEA-15-240-RWT-Monopile/IEA-15-240-RWT-Monopile_DISCON.IN

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Controller parameter input file for the IEA-15-240-RWT-Monopile wind turbine
2-
! - File written using ROSCO version 2.10.0 controller tuning logic on 09/08/25
2+
! - File written using ROSCO version 2.10.1 controller tuning logic on 11/26/25
33

44
!------- SIMULATION CONTROL ------------------------------------------------------------
55
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)
@@ -101,7 +101,7 @@
101101

102102
!------- SETPOINT SMOOTHER ---------------------------------------------
103103
1.00000 ! SS_VSGain - Variable speed torque controller setpoint smoother gain, [-].
104-
0.00100 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
104+
0.05000 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
105105

106106
!------- POWER REFERENCE TRACKING --------------------------------------
107107
0 ! PRC_Comm - Power reference communication mode when PRC_Mode = 2, 0- use constant DISCON inputs, 1- use open loop inputs, 2- use ZMQ inputs
@@ -163,7 +163,7 @@
163163
200.0000 100.0000 ! SU_LoadHoldDuration - Array containing duration to hold the partial loads during startup [s]
164164

165165
!------- SHUTDOWN -----------------------------------------------------------
166-
0 ! SD_TimeActivate - Time to acitvate shutdown modes, [s]
166+
0 ! SD_TimeActivate - Time to acitvate shutdown modes; no shutdown events will occur before this time. [s]
167167
0 ! SD_EnablePitch - Shutdown when collective blade pitch exceeds a threshold, [-]
168168
0 ! SD_EnableYawError - Shutdown when yaw error exceeds a threshold, [-]
169169
0 ! SD_EnableGenSpeed - Shutdown when generator speed exceeds a threshold, [-]

Examples/Test_Cases/IEA-15-240-RWT/IEA-15-240-RWT-UMaineSemi/IEA-15-240-RWT-UMaineSemi_DISCON.IN

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Controller parameter input file for the IEA-15-240-RWT-UMaineSemi wind turbine
2-
! - File written using ROSCO version 2.10.0 controller tuning logic on 09/08/25
2+
! - File written using ROSCO version 2.10.1 controller tuning logic on 11/26/25
33

44
!------- SIMULATION CONTROL ------------------------------------------------------------
55
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)
@@ -101,7 +101,7 @@
101101

102102
!------- SETPOINT SMOOTHER ---------------------------------------------
103103
1.00000 ! SS_VSGain - Variable speed torque controller setpoint smoother gain, [-].
104-
0.00100 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
104+
0.05000 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
105105

106106
!------- POWER REFERENCE TRACKING --------------------------------------
107107
0 ! PRC_Comm - Power reference communication mode when PRC_Mode = 2, 0- use constant DISCON inputs, 1- use open loop inputs, 2- use ZMQ inputs
@@ -163,7 +163,7 @@
163163
200.0000 100.0000 ! SU_LoadHoldDuration - Array containing duration to hold the partial loads during startup [s]
164164

165165
!------- SHUTDOWN -----------------------------------------------------------
166-
0 ! SD_TimeActivate - Time to acitvate shutdown modes, [s]
166+
0 ! SD_TimeActivate - Time to acitvate shutdown modes; no shutdown events will occur before this time. [s]
167167
0 ! SD_EnablePitch - Shutdown when collective blade pitch exceeds a threshold, [-]
168168
0 ! SD_EnableYawError - Shutdown when yaw error exceeds a threshold, [-]
169169
0 ! SD_EnableGenSpeed - Shutdown when generator speed exceeds a threshold, [-]

Examples/Test_Cases/MHK_RM1/MHK_RM1_DISCON.IN

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Controller parameter input file for the MHK_RM1_Floating wind turbine
2-
! - File written using ROSCO version 2.10.0 controller tuning logic on 09/08/25
2+
! - File written using ROSCO version 2.10.1 controller tuning logic on 11/26/25
33

44
!------- SIMULATION CONTROL ------------------------------------------------------------
55
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)
@@ -101,7 +101,7 @@
101101

102102
!------- SETPOINT SMOOTHER ---------------------------------------------
103103
1.00000 ! SS_VSGain - Variable speed torque controller setpoint smoother gain, [-].
104-
0.00100 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
104+
0.05000 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
105105

106106
!------- POWER REFERENCE TRACKING --------------------------------------
107107
0 ! PRC_Comm - Power reference communication mode when PRC_Mode = 2, 0- use constant DISCON inputs, 1- use open loop inputs, 2- use ZMQ inputs
@@ -163,7 +163,7 @@
163163
200.0000 100.0000 ! SU_LoadHoldDuration - Array containing duration to hold the partial loads during startup [s]
164164

165165
!------- SHUTDOWN -----------------------------------------------------------
166-
0 ! SD_TimeActivate - Time to acitvate shutdown modes, [s]
166+
0 ! SD_TimeActivate - Time to acitvate shutdown modes; no shutdown events will occur before this time. [s]
167167
0 ! SD_EnablePitch - Shutdown when collective blade pitch exceeds a threshold, [-]
168168
0 ! SD_EnableYawError - Shutdown when yaw error exceeds a threshold, [-]
169169
0 ! SD_EnableGenSpeed - Shutdown when generator speed exceeds a threshold, [-]

Examples/Test_Cases/NREL-5MW/DISCON.IN

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Controller parameter input file for the NREL-5MW wind turbine
2-
! - File written using ROSCO version 2.10.0 controller tuning logic on 09/08/25
2+
! - File written using ROSCO version 2.10.1 controller tuning logic on 11/26/25
33

44
!------- SIMULATION CONTROL ------------------------------------------------------------
55
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)
@@ -101,7 +101,7 @@
101101

102102
!------- SETPOINT SMOOTHER ---------------------------------------------
103103
1.00000 ! SS_VSGain - Variable speed torque controller setpoint smoother gain, [-].
104-
0.00100 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
104+
0.05000 ! SS_PCGain - Collective pitch controller setpoint smoother gain, [-].
105105

106106
!------- POWER REFERENCE TRACKING --------------------------------------
107107
0 ! PRC_Comm - Power reference communication mode when PRC_Mode = 2, 0- use constant DISCON inputs, 1- use open loop inputs, 2- use ZMQ inputs
@@ -163,7 +163,7 @@
163163
200.0000 100.0000 ! SU_LoadHoldDuration - Array containing duration to hold the partial loads during startup [s]
164164

165165
!------- SHUTDOWN -----------------------------------------------------------
166-
0 ! SD_TimeActivate - Time to acitvate shutdown modes, [s]
166+
0 ! SD_TimeActivate - Time to acitvate shutdown modes; no shutdown events will occur before this time. [s]
167167
0 ! SD_EnablePitch - Shutdown when collective blade pitch exceeds a threshold, [-]
168168
0 ! SD_EnableYawError - Shutdown when yaw error exceeds a threshold, [-]
169169
0 ! SD_EnableGenSpeed - Shutdown when generator speed exceeds a threshold, [-]

0 commit comments

Comments
 (0)