Skip to content

Commit

Permalink
Update examples for newer models and test turbines
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Sep 28, 2020
1 parent 8e05d67 commit 57bd9fc
Show file tree
Hide file tree
Showing 7 changed files with 172 additions and 174 deletions.
296 changes: 148 additions & 148 deletions Examples/Cp_Ct_Cq.Ex03.txt

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Examples/DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the 5MW_Land_DLL_WTurb wind turbine
! - File written using ROSCO Controller tuning logic on 03/01/20
! Controller parameter input file for the NREL-5MW wind turbine
! - File written using ROSCO Controller tuning logic on 09/28/20

!------- DEBUG ------------------------------------------------------------
1 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: write standard output .dbg-file and complete avrSWAP-array .dbg2-file}
Expand All @@ -12,7 +12,7 @@
1 ! PC_ControlMode - Blade pitch control mode {0: No pitch, fix to fine pitch, 1: active PI blade pitch control}
0 ! Y_ControlMode - Yaw control mode {0: no yaw control, 1: yaw rate control, 2: yaw-by-IPC}
1 ! SS_Mode - Setpoint Smoother mode {0: no setpoint smoothing, 1: introduce setpoint smoothing}
2 ! WE_Mode - Wind speed estimator mode {0: One-second low pass filtered hub height wind speed, 1: Immersion and Invariance Estimator, 2: Extended Kalman Filter}
0 ! WE_Mode - Wind speed estimator mode {0: One-second low pass filtered hub height wind speed, 1: Immersion and Invariance Estimator, 2: Extended Kalman Filter}
0 ! PS_Mode - Pitch saturation mode {0: no pitch saturation, 1: implement pitch saturation}
0 ! SD_Mode - Shutdown mode {0: no shutdown procedure, 1: pitch to max pitch at shutdown}
0 ! Fl_Mode - Floating specific feedback mode {0: no nacelle velocity feedback, 1: nacelle velocity feedback}
Expand All @@ -35,11 +35,11 @@
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ! PC_GS_KD - Gain-schedule table: pitch controller kd gains
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ! PC_GS_TF - Gain-schedule table: pitch controller tf gains (derivative filter)
1.570800000000 ! PC_MaxPit - Maximum physical pitch limit, [rad].
0.000000000000 ! PC_MinPit - Minimum physical pitch limit, [rad].
-0.00873000000 ! PC_MinPit - Minimum physical pitch limit, [rad].
0.174500000000 ! PC_MaxRat - Maximum pitch rate (in absolute value) in pitch controller, [rad/s].
-0.17450000000 ! PC_MinRat - Minimum pitch rate (in absolute value) in pitch controller, [rad/s].
122.9096700000 ! PC_RefSpd - Desired (reference) HSS speed for pitch controller, [rad/s].
0.000000000000 ! PC_FinePit - Record 5: Below-rated pitch angle set-point, [rad]
-0.00873000000 ! PC_FinePit - Record 5: Below-rated pitch angle set-point, [rad]
0.017450000000 ! PC_Switch - Angle above lowest minimum pitch angle for switch, [rad]

!------- INDIVIDUAL PITCH CONTROL -----------------------------------------
Expand All @@ -55,13 +55,13 @@
47402.87063000 ! VS_MaxTq - Maximum generator torque in Region 3 (HSS side), [Nm].
0.000000000000 ! VS_MinTq - Minimum generator (HSS side), [Nm].
34.68909000000 ! VS_MinOMSpd - Optimal mode minimum speed, cut-in speed towards optimal mode gain path, [rad/s]
2.385060000000 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side), [N-m/(rad/s)^2]
2.526550000000 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side), [N-m/(rad/s)^2]
5000000.000000 ! VS_RtPwr - Wind turbine rated power [W]
43093.51876000 ! VS_RtTq - Rated torque, [Nm].
122.9096700000 ! VS_RefSpd - Rated generator speed [rad/s]
1 ! VS_n - Number of generator PI torque controller gains
-647.671470000 ! VS_KP - Proportional gain for generator PI torque controller [1/(rad/s) Nm]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
-46.4475900000 ! VS_KI - Integral gain for generator PI torque controller [1/rad Nm]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
-999.026780000 ! VS_KP - Proportional gain for generator PI torque controller [1/(rad/s) Nm]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
-185.790360000 ! VS_KI - Integral gain for generator PI torque controller [1/rad Nm]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
7.51 ! VS_TSRopt - Power-maximizing region 2 tip-speed-ratio [rad].

!------- SETPOINT SMOOTHER ---------------------------------------------
Expand Down Expand Up @@ -103,7 +103,7 @@
!------- MINIMUM PITCH SATURATION -------------------------------------------
44 ! PS_BldPitchMin_N - Number of values in minimum blade pitch lookup table (should equal number of values in PS_WindSpeeds and PS_BldPitchMin)
3.00 3.50 4.00 4.50 5.00 5.50 6.00 6.50 7.00 7.50 8.00 8.50 9.00 9.50 10.00 10.50 11.00 11.90 12.40 12.90 13.40 13.90 14.40 14.90 15.40 15.90 16.40 16.90 17.40 17.90 18.40 18.90 19.40 19.90 20.40 20.90 21.40 21.90 22.40 22.90 23.40 23.90 24.40 24.90 ! PS_WindSpeeds - Wind speeds corresponding to minimum blade pitch angles [m/s]
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 ! PS_BldPitchMin - Minimum blade pitch angles [rad]
-0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 -0.00872665 ! PS_BldPitchMin - Minimum blade pitch angles [rad]

!------- SHUTDOWN -----------------------------------------------------------
0.436300000000 ! SD_MaxPit - Maximum blade pitch angle to initiate shutdown, [rad]
Expand Down
2 changes: 1 addition & 1 deletion Examples/example_06.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

# Run OpenFAST
# --- May need to change fastcall if you use a non-standard command to call openfast
fast_io.run_openfast(path_params['FAST_directory'], fastcall='openfast_dev', fastfile=path_params['FAST_InputFile'],chdir=True)
fast_io.run_openfast(path_params['FAST_directory'], fastcall='openfast', fastfile=path_params['FAST_InputFile'],chdir=True)



Expand Down
15 changes: 6 additions & 9 deletions Examples/example_08.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,24 @@

# Instantiate fast_IO
fast_io = ROSCO_utilities.FAST_IO()
fast_pl = ROSCO_utilities.FAST_Plots()

# Define openfast output filenames
# filenames = ["../Test_Cases/5MW_Land/5MW_Land.outb"]
filenames = ["../Test_Cases/NREL-5MW/NREL-5MW.outb"]

# ---- Note: Could plot multiple cases, textfiles, and binaries...
filenames = ["../Test_Cases/5MW_Land_DLL_WTurb/5MW_Land_DLL_WTurb.out",
"../Test_Cases/5MW_Land_DLL_WTurb/5MW_Land_DLL_WTurb.outb"]
# filenames = ["../Test_Cases/NREL-5MW/NREL-5MW.outb",
# "../Test_Cases/NREL-5MW/NREL-5MW_ex8.outb"]

# Load output info and data
allinfo, alldata = fast_io.load_output(filenames)
fastout = fast_io.load_fast_out(filenames, tmin=10)

# Trim time series
for i,(info,data) in enumerate(zip(allinfo,alldata)):
alldata[i] = fast_io.trim_output(info, data, tmin=0, tmax=50)

# Define Plot cases
# --- Comment,uncomment, create, and change these as desired...
cases = {}
cases['Baseline'] = ['Wind1VelX', 'BldPitch1', 'GenTq', 'RotSpeed']
cases['Rotor'] = ['BldPitch1', 'GenTq', 'GenPwr']
cases['Rotor Performance'] = ['RtVAvgxh', 'RtTSR', 'RtAeroCp']

# Plot, woohoo!
fast_io.plot_fast_out(cases, allinfo, alldata)
fast_pl.plot_fast_out(cases, fastout, showplot=True)
5 changes: 3 additions & 2 deletions Examples/example_10.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
# Load turbine data from openfast model
turbine = ROSCO_turbine.Turbine(turbine_params)
turbine = ROSCO_turbine.Turbine(turbine_params)
turbine.load_from_fast(path_params['FAST_InputFile'],path_params['FAST_directory'],dev_branch=True,rot_source='txt',txt_filename=path_params['rotor_performance_filename'])
# turbine.load_from_fast(path_params['FAST_InputFile'],path_params['FAST_directory'],dev_branch=True,rot_source='txt',txt_filename=path_params['rotor_performance_filename'])
turbine.load_from_fast(path_params['FAST_InputFile'],path_params['FAST_directory'],dev_branch=True)
# Load blade info
turbine.load_blade_info(path_params['FAST_InputFile'],path_params['FAST_directory'],dev_branch=True)
turbine.load_blade_info()

# Tune controller
controller = ROSCO_controller.Controller(controller_params)
Expand Down
6 changes: 3 additions & 3 deletions Tune_Cases/BAR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Turbine: BAR_00 Reference Wind Turbine
# ------------------------------ OpenFAST PATH DEFINITIONS ------------------------------
path_params:
FAST_InputFile: 'WISDEM_BAR2011n.fst' # Name of *.fst file
FAST_directory: '/Users/nabbas/Documents/TurbineModels/BAR/WISDEM_BAR2011n' # Main OpenFAST model directory, where the *.fst lives
FAST_InputFile: 'BAR_10.fst' # Name of *.fst file
FAST_directory: '/Users/nabbas/Documents/TurbineModels/BAR/OpenFAST_Models/BAR_10/' # Main OpenFAST model directory, where the *.fst lives
# Optional (but suggested...)
rotor_performance_filename: 'WISDEM_BAR2011n_Cp_Ct_Cq_temp.txt' # Filename for rotor performance text file (if it has been generated by ccblade already)
rotor_performance_filename: 'BAR_10_Cp_Ct_Cq.txt' # Filename for rotor performance text file (if it has been generated by ccblade already)

# -------------------------------- TURBINE PARAMETERS -----------------------------------
turbine_params:
Expand Down
4 changes: 2 additions & 2 deletions Tune_Cases/NREL5MW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Turbine: NREL 5MW Reference Wind Turbine
# ------------------------------ OpenFAST PATH DEFINITIONS ------------------------------
path_params:
FAST_InputFile: '5MW_Land_DLL_WTurb.fst' # Name of *.fst file
FAST_directory: '../Test_Cases/5MW_Land_DLL_WTurb' # Main OpenFAST model directory, where the *.fst lives
FAST_InputFile: 'NREL-5MW.fst' # Name of *.fst file
FAST_directory: '../Test_Cases/NREL-5MW' # Main OpenFAST model directory, where the *.fst lives
# Optional
rotor_performance_filename: 'Cp_Ct_Cq.NREL5MW.txt' # Filename for rotor performance text file (if it has been generated by ccblade already)

Expand Down

0 comments on commit 57bd9fc

Please sign in to comment.