Skip to content

Commit

Permalink
Merge pull request #90 from NREL/develop
Browse files Browse the repository at this point in the history
v2.4.1
  • Loading branch information
nikhar-abbas authored Nov 10, 2021
2 parents ecef7ae + de1a7f8 commit 9646dbd
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI_rosco-pytools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
# Install ROSCO toolbox
- name: Install ROSCO toolbox
run: |
python setup.py develop --compile-rosco
python setup.py install --compile-rosco
# Install OpenFAST
- name: Install OpenFAST
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ Please help us better understand the ROSCO user-base and how we can improve rosc
If the ROSCO Toolbox played a role in your research, please cite it. This software can be
cited as:

NREL: ROSCO. Version 2.4.0, https://github.com/NREL/ROSCO, 2021.
NREL: ROSCO. Version 2.4.1, https://github.com/NREL/ROSCO, 2021.

For LaTeX users:

```
@misc{ROSCO_toolbox_2021,
author = {NREL},
title = {{ROSCO. Version 2.4.0}},
title = {{ROSCO. Version 2.4.1}},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
Expand Down
13 changes: 9 additions & 4 deletions ROSCO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6)
project(ROSCO VERSION 2.4.0 LANGUAGES Fortran)
project(ROSCO VERSION 2.4.1 LANGUAGES Fortran)

set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/ftnmods")

Expand All @@ -16,9 +16,14 @@ if(APPLE OR UNIX)
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIMPLICIT_DLLEXPORT -ffree-line-length-0 -fdefault-real-8 -fdefault-double-8 -cpp")
endif()
elseif(WIN32 AND MINGW)
# Ensure static linking to avoid requiring Fortran runtime dependencies
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -static-libgcc -static-libgfortran -static -fdefault-real-8 -fdefault-double-8 -cpp")
elseif (WIN32)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
# Ensure static linking to avoid requiring Fortran runtime dependencies
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -static-libgcc -static-libgfortran -static -fdefault-real-8 -fdefault-double-8 -cpp")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -libs:static -free -static -fpp -real-size:64 -double-size:64")
# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /ffree-line-length-0 /static-libgcc /static-libgfortran /static /fdefault-real-8 /fdefault-double-8 /cpp")
endif()
endif()


Expand Down
2 changes: 1 addition & 1 deletion ROSCO/src/Constants.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
! specific language governing permissions and limitations under the License.

MODULE Constants
Character(*), PARAMETER :: rosco_version = 'v2.4.0' ! ROSCO version
Character(*), PARAMETER :: rosco_version = 'v2.4.1' ! ROSCO version
REAL(8), PARAMETER :: RPS2RPM = 9.5492966 ! Factor to convert radians per second to revolutions per minute.
REAL(8), PARAMETER :: R2D = 57.295780 ! Factor to convert radians to degrees.
REAL(8), PARAMETER :: D2R = 0.0175 ! Factor to convert degrees to radians.
Expand Down
2 changes: 1 addition & 1 deletion ROSCO_toolbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

__author__ = """Nikhar J. Abbas and Daniel S. Zalkind"""
__email__ = 'nikhar.abbas@nrel.gov'
__version__ = '2.4.0'
__version__ = '2.4.1'
4 changes: 2 additions & 2 deletions ROSCO_toolbox/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def tune_controller(self, turbine):
for i in range(len(TSR_op)):
# Find pitch angle as a function of expected operating CP for each TSR
Cp_TSR = np.ndarray.flatten(turbine.Cp.interp_surface(turbine.pitch_initial_rad, TSR_op[i])) # all Cp values for a given tsr
Cp_op[i] = np.clip(Cp_op[i], np.min(Cp_TSR), np.max(Cp_TSR)) # saturate Cp values to be on Cp surface
Cp_maxidx = Cp_TSR.argmax() # Find maximum Cp value for this TSR
Cp_maxidx = Cp_TSR.argmax()
Cp_op[i] = np.clip(Cp_op[i], np.min(Cp_TSR[Cp_maxidx:]), np.max(Cp_TSR[Cp_maxidx:])) # saturate Cp values to be on Cp surface # Find maximum Cp value for this TSR
f_cp_pitch = interpolate.interp1d(Cp_TSR[Cp_maxidx:],pitch_initial_rad[Cp_maxidx:]) # interpolate function for Cp(tsr) values
# expected operation blade pitch values
if v[i] <= turbine.v_rated and isinstance(self.min_pitch, float): # Below rated & defined min_pitch
Expand Down
4 changes: 2 additions & 2 deletions ROSCO_toolbox/turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def load_from_ccblade(self):
self.load_blade_info()

# Generate the look-up tables, mesh the grid and flatten the arrays for cc_rotor aerodynamic analysis
TSR_initial = np.arange(3, 15,0.5)
pitch_initial = np.arange(-1,25,0.5)
TSR_initial = np.arange(2, 15,0.5)
pitch_initial = np.arange(-5,25,0.5)
pitch_initial_rad = pitch_initial * deg2rad
ws_array = np.ones_like(TSR_initial) * self.v_rated # evaluate at rated wind speed
omega_array = (TSR_initial * ws_array / self.rotor_radius) * RadSec2rpm
Expand Down
4 changes: 2 additions & 2 deletions ROSCO_toolbox/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def write_DISCON(turbine, controller, param_file='DISCON.IN', txt_filename='Cp_C
file.write('{:<014.5f} ! VS_ArSatTq - Above rated generator torque PI control saturation, [Nm]\n'.format(turbine.rated_torque))
file.write('{:<014.5f} ! VS_MaxRat - Maximum torque rate (in absolute value) in torque controller, [Nm/s].\n'.format(turbine.max_torque_rate))
file.write('{:<014.5f} ! VS_MaxTq - Maximum generator torque in Region 3 (HSS side), [Nm].\n'.format(turbine.max_torque))
file.write('{:<014.5f} ! VS_MinTq - Minimum generator (HSS side), [Nm].\n'.format(0.0))
file.write('{:<014.5f} ! VS_MinOMSpd - Optimal mode minimum speed, cut-in speed towards optimal mode gain path, [rad/s]\n'.format(controller.vs_minspd))
file.write('{:<014.5f} ! VS_MinTq - Minimum generator torque (HSS side), [Nm].\n'.format(0.0))
file.write('{:<014.5f} ! VS_MinOMSpd - Minimum generator speed [rad/s]\n'.format(controller.vs_minspd * turbine.Ng))
file.write('{:<014.5f} ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side), [Nm/(rad/s)^2]\n'.format(controller.vs_rgn2K))
file.write('{:<014.5f} ! VS_RtPwr - Wind turbine rated power [W]\n'.format(turbine.rated_power))
file.write('{:<014.5f} ! VS_RtTq - Rated torque, [Nm].\n'.format(turbine.rated_torque))
Expand Down
18 changes: 1 addition & 17 deletions Tune_Cases/BAR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ turbine_params:
max_torque_rate: 4500000. # Maximum torque rate [Nm/s], {~1/4 VS_RtTq/s}
rated_power: 5000000. # Rated Power [W]
bld_edgewise_freq: 3.27082 # Blade edgewise first natural frequency [rad/s]
bld_flapwise_freq: 2.61601 # Blade flapwise first natural frequency [rad/s]
# Optional
# TSR_operational: # None # Desired below-rated operational tip speed ratio (Cp-maximizing TSR is used if not defined)
# - should be defined if Fl_Mode = 1
twr_freq: 0.0 # Tower natural frequency [rad/s]
ptfm_freq: 0.0 # Platform natural frequency [rad/s]
bld_flapwise_freq: 2.61601 # Blade flapwise first natural frequency [rad/s]
#------------------------------- CONTROLLER PARAMETERS ----------------------------------
controller_params:
# Controller flags
Expand All @@ -50,14 +45,3 @@ controller_params:
# Only needed if Flp_Mode > 0
zeta_flp: 0.7 # Flap controller desired damping ratio [-]
omega_flp: 2.63 # Flap controller desired natural frequency [rad/s]
# Optional - these can be defined, but do not need to be
# max_pitch: # None # Maximum pitch angle [rad], {default = 90 degrees}
# min_pitch: # None # Minimum pitch angle [rad], {default = 0 degrees}
# vs_minspd: # None # Minimum rotor speed [rad/s], {default = 0 rad/s}
# ss_cornerfreq: # None # First order low-pass filter cornering frequency for setpoint smoother [rad/s]
# ss_vsgain: # None # Torque controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 100%}
# ss_pcgain: # None # Pitch controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 0.1%}
# ps_percent: # None # Percent peak shaving [%, <= 1 ], {default = 80%}
# sd_maxpit: # None # Maximum blade pitch angle to initiate shutdown [rad], {default = bld pitch at v_max}
# sd_cornerfreq: # None # Cutoff Frequency for first order low-pass filter for blade pitch angle [rad/s], {default = 0.41888 ~ time constant of 15s}
# flp_maxpit: # None # Maximum (and minimum) flap pitch angle [rad]
14 changes: 0 additions & 14 deletions Tune_Cases/DTU10MW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ turbine_params:
bld_flapwise_freq: 0.0 # Blade flapwise first natural frequency [rad/s]
# Optional
# TSR_operational: # None # Desired below-rated operational tip speed ratio (Cp-maximizing TSR is used if not defined)
# - should be defined if Fl_Mode = 1
# twr_freq: # None # Tower natural frequency [rad/s]
# ptfm_freq: # None # Platform natural frequency [rad/s]
#------------------------------- CONTROLLER PARAMETERS ----------------------------------
controller_params:
# Controller flags
Expand All @@ -50,14 +47,3 @@ controller_params:
omega_pc: [0.3] # Pitch controller desired natural frequency [rad/s]
zeta_vs: 0.7 # Torque controller desired damping ratio [-]
omega_vs: 0.2 # Torque controller desired natural frequency [rad/s]
# Optional - these can be defined, but do not need to be
# max_pitch: # None # Maximum pitch angle [rad], {default = 90 degrees}
# min_pitch: # None # Minimum pitch angle [rad], {default = 0 degrees}
# vs_minspd: # None # Minimum rotor speed [rad/s], {default = 0 rad/s}
# ss_cornerfreq: # None # First order low-pass filter cornering frequency for setpoint smoother [rad/s]
# ss_vsgain: # None # Torque controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 100%}
# ss_pcgain: # None # Pitch controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 0.1%}
# ps_percent: # None # Percent peak shaving [%, <= 1 ], {default = 80%}
# sd_maxpit: # None # Maximum blade pitch angle to initiate shutdown [rad], {default = bld pitch at v_max}
# sd_cornerfreq: # None # Cutoff Frequency for first order low-pass filter for blade pitch angle [rad/s], {default = 0.41888 ~ time constant of 15s}
# flp_maxpit: # None # Maximum (and minimum) flap pitch angle [rad]
21 changes: 7 additions & 14 deletions Tune_Cases/IEA15MW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,13 @@ controller_params:
Flp_Mode: 0 # Flap control mode {0: no flap control, 1: steady state flap angle, 2: Proportional flap control}
# Controller parameters
# U_pc: [14]
zeta_pc: 2.0 # Pitch controller desired damping ratio [-]
omega_pc: 0.3 # Pitch controller desired natural frequency [rad/s]
zeta_vs: 0.85 # Torque controller desired damping ratio [-]
omega_vs: 0.12 # Torque controller desired natural frequency [rad/s]
zeta_pc: 2.0 # Pitch controller desired damping ratio [-]
omega_pc: 0.3 # Pitch controller desired natural frequency [rad/s]
zeta_vs: 0.85 # Torque controller desired damping ratio [-]
omega_vs: 0.12 # Torque controller desired natural frequency [rad/s]
twr_freq: 3.355 # for semi only!
ptfm_freq: 0.213 # for semi only!
# Optional - these can be defined, but do not need to be
# max_pitch: # None # Maximum pitch angle [rad], {default = 90 degrees}
min_pitch: 0.0 # Minimum pitch angle [rad], {default = 0 degrees}
vs_minspd: 0.523598775 # Minimum rotor speed [rad/s], {default = 0 rad/s}
# ss_cornerfreq: # None # First order low-pass filter cornering frequency for setpoint smoother [rad/s]
# ss_vsgain: # None # Torque controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 100%}
# ss_pcgain: # None # Pitch controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 0.1%}
ps_percent: 0.8 # None # Percent peak shaving [%, <= 1 ], {default = 80%}
# sd_maxpit: # None # Maximum blade pitch angle to initiate shutdown [rad], {default = bld pitch at v_max}
# sd_cornerfreq: # None # Cutoff Frequency for first order low-pass filter for blade pitch angle [rad/s], {default = 0.41888 ~ time constant of 15s}
# flp_maxpit: # None # Maximum (and minimum) flap pitch angle [rad]
twr_freq: 3.355 # for semi only!
ptfm_freq: 0.213 # for semi only!
ps_percent: 0.8 # Percent peak shaving [%, <= 1 ], {default = 80%}
19 changes: 6 additions & 13 deletions Tune_Cases/IEA15MW_MultiOmega.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,10 @@ controller_params:
zeta_pc: [2.0,1.0] # Pitch controller desired damping ratio [-]
omega_pc: [0.15,0.3] # Pitch controller desired natural frequency [rad/s]
zeta_vs: 0.85 # Torque controller desired damping ratio [-]
omega_vs: 0.12 # Torque controller desired natural frequency [rad/s]
omega_vs: 0.12 # Torque controller desired natural frequency [rad/s]
twr_freq: 3.355 # for semi only!
ptfm_freq: 0.213 # for semi only!
# Optional - these can be defined, but do not need to be
# max_pitch: # None # Maximum pitch angle [rad], {default = 90 degrees}
min_pitch: 0.0 # Minimum pitch angle [rad], {default = 0 degrees}
vs_minspd: 0.523598775 # Minimum rotor speed [rad/s], {default = 0 rad/s}
# ss_cornerfreq: # None # First order low-pass filter cornering frequency for setpoint smoother [rad/s]
# ss_vsgain: # None # Torque controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 100%}
# ss_pcgain: # None # Pitch controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 0.1%}
ps_percent: 0.8 # None # Percent peak shaving [%, <= 1 ], {default = 80%}
# sd_maxpit: # None # Maximum blade pitch angle to initiate shutdown [rad], {default = bld pitch at v_max}
# sd_cornerfreq: # None # Cutoff Frequency for first order low-pass filter for blade pitch angle [rad/s], {default = 0.41888 ~ time constant of 15s}
# flp_maxpit: # None # Maximum (and minimum) flap pitch angle [rad]
twr_freq: 3.355 # for semi only!
ptfm_freq: 0.213 # for semi only!
min_pitch: 0.0 # Minimum pitch angle [rad], {default = 0 degrees}
vs_minspd: 0.523598775 # Minimum rotor speed [rad/s], {default = 0 rad/s}
ps_percent: 0.8 # Percent peak shaving [%, <= 1 ], {default = 80%}
17 changes: 5 additions & 12 deletions Tune_Cases/IEA15MW_robust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,16 @@ controller_params:
# Controller parameters
U_pc: [12,14, 15, 18, 20]
zeta_pc: [1.2] # Pitch controller desired damping ratio [-]
omega_pc: [0.15] # Pitch controller desired natural frequency [rad/s]
omega_pc: [0.15] # Pitch controller desired natural frequency [rad/s]
zeta_vs: 0.85 # Torque controller desired damping ratio [-]
omega_vs: 0.12 # Torque controller desired natural frequency [rad/s]
omega_vs: 0.12 # Torque controller desired natural frequency [rad/s]
twr_freq: 3.355 # for semi only!
ptfm_freq: 0.213 # for semi only!
# Optional - these can be defined, but do not need to be
interp_type: sigma
# max_pitch: # None # Maximum pitch angle [rad], {default = 90 degrees}
min_pitch: 0.0 # Minimum pitch angle [rad], {default = 0 degrees}
vs_minspd: 0.523598775 # Minimum rotor speed [rad/s], {default = 0 rad/s}
# ss_cornerfreq: # None # First order low-pass filter cornering frequency for setpoint smoother [rad/s]
# ss_vsgain: # None # Torque controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 100%}
# ss_pcgain: # None # Pitch controller setpoint smoother gain bias percentage [%, <= 1 ], {default = 0.1%}
ps_percent: 0.8 # None # Percent peak shaving [%, <= 1 ], {default = 80%}
# sd_maxpit: # None # Maximum blade pitch angle to initiate shutdown [rad], {default = bld pitch at v_max}
# sd_cornerfreq: # None # Cutoff Frequency for first order low-pass filter for blade pitch angle [rad/s], {default = 0.41888 ~ time constant of 15s}
# flp_maxpit: # None # Maximum (and minimum) flap pitch angle [rad]
twr_freq: 3.355 # for semi only!
ptfm_freq: 0.213 # for semi only!
ps_percent: 0.8 # Percent peak shaving [%, <= 1 ], {default = 80%}

linmodel_tuning:
type: 'robust' # Type of level 2 based tuning - robust gain scheduling (robust) or simulation based optimization (simulation)
Expand Down
Loading

0 comments on commit 9646dbd

Please sign in to comment.