Skip to content

Commit

Permalink
Revert examples and test cases to develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind committed Jun 2, 2021
1 parent 279cb32 commit 611d834
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 68 deletions.
17 changes: 5 additions & 12 deletions Examples/example_06.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox.utilities import write_DISCON, run_openfast
from ROSCO_toolbox import sim as ROSCO_sim
from ROSCO_toolbox.ofTools.fast_io import output_processing

this_dir = os.path.dirname(os.path.abspath(__file__))
rt_dir = os.path.dirname(this_dir)

# Load yaml file
parameter_filename = os.path.join(os.path.dirname(this_dir), 'Tune_Cases', 'IEA15MW.yaml')
Expand All @@ -36,26 +34,21 @@

# Load turbine data from OpenFAST and rotor performance text file
turbine.load_from_fast(path_params['FAST_InputFile'], \
os.path.join(rt_dir,path_params['FAST_directory']), \
os.path.join(this_dir,path_params['FAST_directory']), \
dev_branch=True,rot_source='txt',\
txt_filename=os.path.join(rt_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']))
txt_filename=os.path.join(this_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']))

# Tune controller
controller.tune_controller(turbine)

# Write parameter input file
param_file = os.path.join(rt_dir,'Test_Cases/IEA-15-240-RWT-UMaineSemi/ServoData/DISCON-UMaineSemi.IN') # This must be named DISCON.IN to be seen by the compiled controller binary.
param_file = os.path.join(this_dir,'DISCON.IN') # This must be named DISCON.IN to be seen by the compiled controller binary.
write_DISCON(turbine,controller,param_file=param_file, txt_filename=path_params['rotor_performance_filename'])

# Run OpenFAST
# --- May need to change fastcall if you use a non-standard command to call openfast
fastcall = '/Users/dzalkind/Tools/WEIS-1/build/temp.macosx-10.9-x86_64-3.8_rosco_openfast/glue-codes/openfast/openfast'
run_openfast(
os.path.join(rt_dir,path_params['FAST_directory']),
fastcall=fastcall,
fastfile=path_params['FAST_InputFile'],
chdir=True
)
fastcall = 'openfast'
run_openfast(path_params['FAST_directory'], fastcall=fastcall, fastfile=path_params['FAST_InputFile'], chdir=True)



Expand Down
8 changes: 1 addition & 7 deletions Examples/example_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

import numpy as np

this_dir = os.path.dirname(os.path.abspath(__file__))
rt_dir = os.path.dirname(this_dir)

# Load yaml file
parameter_filename = os.path.join( os.path.dirname( os.path.dirname( os.path.realpath(__file__) )),
'Tune_Cases', 'IEA15MW.yaml')
Expand All @@ -43,10 +40,7 @@
controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
turbine.load_from_fast(path_params['FAST_InputFile'], \
os.path.join(rt_dir,path_params['FAST_directory']), \
dev_branch=True,rot_source='txt',\
txt_filename=os.path.join(rt_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']))
turbine.load_from_fast(path_params['FAST_InputFile'],path_params['FAST_directory'],dev_branch=True,rot_source=None,txt_filename=path_params['rotor_performance_filename'])

# Tune controller
controller.tune_controller(turbine)
Expand Down
20 changes: 10 additions & 10 deletions Test_Cases/BAR_10/BAR_10_AeroDyn15.dat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ False Echo - Echo the input to "<rootname>.AD.ech"? (fl
1 WakeMod - Type of wake/induction model (switch) {0=none, 1=BEMT}
2 AFAeroMod - Type of blade airfoil aerodynamics model (switch) {1=steady model, 2=Beddoes-Leishman unsteady model} [must be 1 when linearizing]
1 TwrPotent - Type tower influence on wind based on potential flow around the tower (switch) {0=none, 1=baseline potential flow, 2=potential flow with Bak correction}
0 TwrShadow - Calculate tower influence on wind based on downstream tower shadow? (flag)
True TwrShadow - Calculate tower influence on wind based on downstream tower shadow? (flag)
True TwrAero - Calculate tower aerodynamic loads? (flag)
False FrozenWake - Assume frozen wake during linearization? (flag) [used only when WakeMod=1 and when linearizing]
False CavitCheck - Perform cavitation check? (flag) TRUE will turn off unsteady aerodynamics
Expand Down Expand Up @@ -84,15 +84,15 @@ True UseBlCm - Include aerodynamic pitching moment in calc
9 NumTwrNds - Number of tower nodes used in the analysis (-) [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True]
TwrElev TwrDiam TwrCd
(m) (m) (-)
2.740000000000000e+01 6.000000000000000e+00 1.000000000000000e+00 0
4.110000000000000e+01 6.000000000000000e+00 1.000000000000000e+00 0
5.480000000000000e+01 6.000000000000000e+00 1.000000000000000e+00 0
6.850000000000000e+01 6.000000000000000e+00 1.000000000000000e+00 0
8.220000000000000e+01 6.000000000000000e+00 1.000000000000000e+00 0
9.590000000000001e+01 6.000000000000000e+00 1.000000000000000e+00 0
1.096000000000000e+02 6.000000000000000e+00 1.000000000000000e+00 0
1.233000000000000e+02 5.890792130000000e+00 1.000000000000000e+00 0
1.370000000000000e+02 5.530325920000000e+00 1.000000000000000e+00 0
2.740000000000000e+01 6.000000000000000e+00 1.000000000000000e+00
4.110000000000000e+01 6.000000000000000e+00 1.000000000000000e+00
5.480000000000000e+01 6.000000000000000e+00 1.000000000000000e+00
6.850000000000000e+01 6.000000000000000e+00 1.000000000000000e+00
8.220000000000000e+01 6.000000000000000e+00 1.000000000000000e+00
9.590000000000001e+01 6.000000000000000e+00 1.000000000000000e+00
1.096000000000000e+02 6.000000000000000e+00 1.000000000000000e+00
1.233000000000000e+02 5.890792130000000e+00 1.000000000000000e+00
1.370000000000000e+02 5.530325920000000e+00 1.000000000000000e+00
====== Tower Influence and Aerodynamics ============================================================= [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True]
True SumPrint - Generate a summary file listing input options and interpolated properties to "<rootname>.AD.sum"? (flag)
9 NBlOuts - Number of blade node outputs [0 - 9] (-)
Expand Down
28 changes: 14 additions & 14 deletions Test_Cases/IEA-15-240-RWT-UMaineSemi/IEA-15-240-RWT_AeroDyn15.dat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ False Echo - Echo the input to "<rootname>.AD.ech"? (fl
1 WakeMod - Type of wake/induction model (switch) {0=none, 1=BEMT, 2=DBEMT, 3=OLAF} [WakeMod cannot be 2 or 3 when linearizing]
2 AFAeroMod - Type of blade airfoil aerodynamics model (switch) {1=steady model, 2=Beddoes-Leishman unsteady model} [AFAeroMod must be 1 when linearizing]
1 TwrPotent - Type tower influence on wind based on potential flow around the tower (switch) {0=none, 1=baseline potential flow, 2=potential flow with Bak correction}
0 TwrShadow - Calculate tower influence on wind based on downstream tower shadow (switch) {0=none, 1=Powles model, 2=Eames model}
False TwrShadow - Calculate tower influence on wind based on downstream tower shadow (switch) {0=none, 1=Powles model, 2=Eames model}
True TwrAero - Calculate tower aerodynamic loads? (flag)
False FrozenWake - Assume frozen wake during linearization? (flag) [used only when WakeMod=1 and when linearizing]
False CavitCheck - Perform cavitation check? (flag) [AFAeroMod must be 1 when CavitCheck=true]
Expand Down Expand Up @@ -102,19 +102,19 @@ True UseBlCm - Include aerodynamic pitching moment in calc
"IEA-15-240-RWT_AeroDyn15_blade.dat" ADBlFile(3) - Name of file containing distributed aerodynamic properties for Blade #3 (-) [unused if NumBl < 3]
====== Tower Influence and Aerodynamics ============================================================= [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True]
11 NumTwrNds - Number of tower nodes used in the analysis (-) [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True]
TwrElev TwrDiam TwrCd TwrTI
(m) (m) (-) (-)
15. 10. 1. 0.1
28. 10. 1. 0.1
41. 9.926 1. 0.1
54. 9.443 1. 0.1
67. 8.833 1. 0.1
80. 8.151 1. 0.1
93. 7.39 1. 0.1
106. 6.909 1. 0.1
119. 6.748 1. 0.1
132. 6.572 1. 0.1
144.495 6.5 1. 0.1
TwrElev TwrDiam TwrCd
(m) (m) (-)
15. 10. 1.
28. 10. 1.
41. 9.926 1.
54. 9.443 1.
67. 8.833 1.
80. 8.151 1.
93. 7.39 1.
106. 6.909 1.
119. 6.748 1.
132. 6.572 1.
144.495 6.5 1.
====== Tower Influence and Aerodynamics ============================================================= [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True]
True SumPrint - Generate a summary file listing input options and interpolated properties to "<rootname>.AD.sum"? (flag)
9 NBlOuts - Number of blade node outputs [0 - 9] (-)
Expand Down
20 changes: 10 additions & 10 deletions Test_Cases/IEA-15-240-RWT-UMaineSemi/ServoData/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.2.0 controller tuning logic on 05/21/21
! - File written using ROSCO version 2.2.0 controller tuning logic on 03/05/21

!------- 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 Down Expand Up @@ -60,7 +60,7 @@
19624046.66639 ! VS_RtTq - Rated torque, [Nm].
0.791680000000 ! VS_RefSpd - Rated generator speed [rad/s]
1 ! VS_n - Number of generator PI torque controller gains
-38676765.16943 ! VS_KP - Proportional gain for generator PI torque controller [-]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
-38005940.32297 ! VS_KP - Proportional gain for generator PI torque controller [-]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
-4588245.18720 ! VS_KI - Integral gain for generator PI torque controller [s]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
9.00 ! VS_TSRopt - Power-maximizing region 2 tip-speed-ratio [rad].

Expand All @@ -78,9 +78,9 @@
1.225 ! WE_RhoAir - Air density, [kg m^-3]
"Cp_Ct_Cq.IEA15MW.txt" ! PerfFileName - File containing rotor performance tables (Cp,Ct,Cq)
104 72 ! PerfTableSize - Size of rotor performance tables, first number refers to number of blade pitch angles, second number referse to number of tip-speed ratios
59 ! WE_FOPoles_N - Number of first-order system poles used in EKF
3.00 3.27 3.53 3.80 4.07 4.33 4.60 4.87 5.14 5.40 5.67 5.94 6.20 6.47 6.74 7.00 7.27 7.54 7.80 8.07 8.34 8.60 8.87 9.14 9.41 9.67 9.94 10.21 10.47 10.74 11.23 11.72 12.22 12.71 13.20 13.69 14.18 14.67 15.17 15.66 16.15 16.64 17.13 17.62 18.12 18.61 19.10 19.59 20.08 20.57 21.07 21.56 22.05 22.54 23.03 23.52 24.02 24.51 25.00 ! WE_FOPoles_v - Wind speeds corresponding to first-order system poles [m/s]
-0.02366483 -0.02577018 -0.02787553 -0.02998089 -0.03208624 -0.03419159 -0.03629695 -0.03840230 -0.04050765 -0.04261301 -0.04471836 -0.04682371 -0.04892907 -0.05103442 -0.05313977 -0.05524513 -0.05735048 -0.05945583 -0.06156119 -0.06366654 -0.06577189 -0.06787725 -0.06998260 -0.07208795 -0.07419331 -0.07629866 -0.07840401 -0.08050937 -0.08261472 -0.07921295 -0.05358619 -0.05636426 -0.06307564 -0.07173987 -0.08172495 -0.09271927 -0.10454428 -0.11705643 -0.13017613 -0.14379976 -0.15793978 -0.17258746 -0.18766434 -0.20315149 -0.21909644 -0.23538854 -0.25208919 -0.26915631 -0.28659300 -0.30437969 -0.32249538 -0.34096095 -0.35974552 -0.37881117 -0.39822177 -0.41789494 -0.43785131 -0.45808118 -0.47857910 ! WE_FOPoles - First order system poles [1/s]
60 ! WE_FOPoles_N - Number of first-order system poles used in EKF
3.00 3.27 3.53 3.80 4.07 4.33 4.60 4.87 5.14 5.40 5.67 5.94 6.20 6.47 6.74 7.00 7.27 7.54 7.80 8.07 8.34 8.60 8.87 9.14 9.41 9.67 9.94 10.21 10.47 10.74 10.74 11.23 11.72 12.22 12.71 13.20 13.69 14.18 14.67 15.17 15.66 16.15 16.64 17.13 17.62 18.12 18.61 19.10 19.59 20.08 20.57 21.07 21.56 22.05 22.54 23.03 23.52 24.02 24.51 25.00 ! WE_FOPoles_v - Wind speeds corresponding to first-order system poles [m/s]
-0.02366483 -0.02577018 -0.02787553 -0.02998089 -0.03208624 -0.03419159 -0.03629695 -0.03840230 -0.04050765 -0.04261301 -0.04471836 -0.04682371 -0.04892907 -0.05103442 -0.05313977 -0.05524513 -0.05735048 -0.05945583 -0.06156119 -0.06366654 -0.06577189 -0.06787725 -0.06998260 -0.07208795 -0.07419331 -0.07629866 -0.07840401 -0.08050937 -0.08261472 -0.08472008 -0.07921295 -0.05358619 -0.05636426 -0.06307564 -0.07173987 -0.08172495 -0.09271927 -0.10454428 -0.11705643 -0.13017613 -0.14379976 -0.15793978 -0.17258746 -0.18766434 -0.20315149 -0.21909644 -0.23538854 -0.25208919 -0.26915631 -0.28659300 -0.30437969 -0.32249538 -0.34096095 -0.35974552 -0.37881117 -0.39822177 -0.41789494 -0.43785131 -0.45808118 -0.47857910 ! WE_FOPoles - First order system poles [1/s]

!------- YAW CONTROL ------------------------------------------------------
0.0 ! Y_ErrThresh - Yaw error threshold. Turbine begins to yaw when it passes this. [rad^2 s]
Expand All @@ -101,12 +101,12 @@
0.0 ! FA_IntSat - Integrator saturation (maximum signal amplitude contribution to pitch from FA damper), [rad]

!------- MINIMUM PITCH SATURATION -------------------------------------------
59 ! PS_BldPitchMin_N - Number of values in minimum blade pitch lookup table (should equal number of values in PS_WindSpeeds and PS_BldPitchMin)
3.0000 3.2669 3.5338 3.8007 4.0676 4.3345 4.6014 4.8683 5.1352 5.4021 5.6690 5.9359 6.2028 6.4697 6.7366 7.0034 7.2703 7.5372 7.8041 8.0710 8.3379 8.6048 8.8717 9.1386 9.4055 9.6724 9.9393 10.2062 10.4731 10.7400 11.2317 11.7234 12.2152 12.7069 13.1986 13.6903 14.1821 14.6738 15.1655 15.6572 16.1490 16.6407 17.1324 17.6241 18.1159 18.6076 19.0993 19.5910 20.0828 20.5745 21.0662 21.5579 22.0497 22.5414 23.0331 23.5248 24.0166 24.5083 25.0000 ! PS_WindSpeeds - Wind speeds corresponding to minimum blade pitch angles [m/s]
0.06981317 0.06981317 0.06981317 0.06544985 0.06108652 0.06108652 0.05672320 0.05235988 0.04363323 0.03926991 0.03054326 0.02617994 0.01745329 0.01308997 0.00436332 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00846242 0.02297908 0.03562095 0.04679173 0.05441817 0.06567599 0.07636750 0.08665379 0.09661840 0.10632055 0.11580528 0.12510305 0.13423733 0.14322816 0.15209108 0.16083933 0.16948469 0.17803618 0.18650204 0.19488866 0.20320255 0.21144779 0.21962944 0.22775102 0.23581588 0.24382366 0.25177837 0.25968454 0.26754229 0.27535494 0.28311982 0.29083869 0.29851690 0.30615320 ! PS_BldPitchMin - Minimum blade pitch angles [rad]
60 ! PS_BldPitchMin_N - Number of values in minimum blade pitch lookup table (should equal number of values in PS_WindSpeeds and PS_BldPitchMin)
3.0000 3.2669 3.5338 3.8007 4.0676 4.3345 4.6014 4.8683 5.1352 5.4021 5.6690 5.9359 6.2028 6.4697 6.7366 7.0034 7.2703 7.5372 7.8041 8.0710 8.3379 8.6048 8.8717 9.1386 9.4055 9.6724 9.9393 10.2062 10.4731 10.7400 10.7400 11.2317 11.7234 12.2152 12.7069 13.1986 13.6903 14.1821 14.6738 15.1655 15.6572 16.1490 16.6407 17.1324 17.6241 18.1159 18.6076 19.0993 19.5910 20.0828 20.5745 21.0662 21.5579 22.0497 22.5414 23.0331 23.5248 24.0166 24.5083 25.0000 ! PS_WindSpeeds - Wind speeds corresponding to minimum blade pitch angles [m/s]
0.06981317 0.06981317 0.06981317 0.06544985 0.06108652 0.06108652 0.05672320 0.05235988 0.04363323 0.03926991 0.03054326 0.02617994 0.01745329 0.01308997 0.00436332 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 0.00000000 ! PS_BldPitchMin - Minimum blade pitch angles [rad]

!------- SHUTDOWN -----------------------------------------------------------
0.400940000000 ! SD_MaxPit - Maximum blade pitch angle to initiate shutdown, [rad]
0.400740000000 ! SD_MaxPit - Maximum blade pitch angle to initiate shutdown, [rad]
0.418880000000 ! SD_CornerFreq - Cutoff Frequency for first order low-pass filter for blade pitch angle, [rad/s]

!------- Floating -----------------------------------------------------------
Expand All @@ -116,4 +116,4 @@
0.000000000000 ! Flp_Angle - Initial or steady state flap angle [rad]
0.00000000e+00 ! Flp_Kp - Blade root bending moment proportional gain for flap control [s]
0.00000000e+00 ! Flp_Ki - Flap displacement integral gain for flap control [-]
0.000000000000 ! Flp_MaxPit - Maximum (and minimum) flap pitch angle [rad]
0.000000000000 ! Flp_MaxPit - Maximum (and minimum) flap pitch angle [rad]
Loading

0 comments on commit 611d834

Please sign in to comment.