Skip to content

Commit

Permalink
Update paths with new Cp location
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind committed Jul 19, 2023
1 parent 89ba586 commit 983f13d
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Examples/01_turbine_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)

# Print some basic turbine info
Expand Down
2 changes: 1 addition & 1 deletion Examples/03_tune_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
cp_filename = os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
cp_filename = os.path.join(tune_dir,path_params['rotor_performance_filename'])
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
Expand Down
2 changes: 1 addition & 1 deletion Examples/04_simple_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
cp_filename = os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
cp_filename = os.path.join(tune_dir,path_params['rotor_performance_filename'])
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
Expand Down
2 changes: 1 addition & 1 deletion Examples/05_openfast_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
path_params['FAST_InputFile'],
os.path.join(this_dir,path_params['FAST_directory']),
rot_source='txt',
txt_filename=os.path.join(this_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
txt_filename=os.path.join(this_dir,path_params['rotor_performance_filename'])
)

# Tune controller
Expand Down
2 changes: 1 addition & 1 deletion Examples/06_peak_shaving.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)
# Tune controller
controller.tune_controller(turbine)
Expand Down
2 changes: 1 addition & 1 deletion Examples/10_linear_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
path_params['FAST_InputFile'],
os.path.join(this_dir,path_params['FAST_directory']),
rot_source='txt',
txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)

# Tune controller
Expand Down
6 changes: 3 additions & 3 deletions Examples/11_robust_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def run_example():
controller = ROSCO_controller.Controller(controller_params)
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(this_dir, path_params['FAST_directory']),
rot_source='txt', txt_filename=os.path.join(this_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
os.path.join(tune_dir, path_params['FAST_directory']),
rot_source='txt', txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)

# Fix path params for robust setup
path_params['FAST_directory'] = os.path.join(this_dir, path_params['FAST_directory'])
path_params['FAST_directory'] = os.path.join(tune_dir, path_params['FAST_directory'])

controller.tune_controller(turbine)
k_float = controller.Kp_float
Expand Down
2 changes: 1 addition & 1 deletion Examples/14_open_loop_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
turbine.load_from_fast(path_params['FAST_InputFile'], \
os.path.join(this_dir,path_params['FAST_directory']), \
rot_source='txt',\
txt_filename=os.path.join(this_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']))
txt_filename=os.path.join(this_dir,path_params['rotor_performance_filename']))

# Tune controller
controller.tune_controller(turbine)
Expand Down
29 changes: 21 additions & 8 deletions Examples/ROSCO_walkthrough.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ROSCO_toolbox/tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def yaml_to_objs(tuning_yaml):
path_params['FAST_InputFile'],
os.path.join(yaml_dir,path_params['FAST_directory']),
rot_source='txt',
txt_filename=os.path.join(yaml_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
txt_filename=os.path.join(yaml_dir,path_params['rotor_performance_filename'])
)

# Tune controller
Expand Down
2 changes: 1 addition & 1 deletion Tune_Cases/IEA15MW_ExtInterface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ path_params:
FAST_InputFile: 'IEA-15-240-RWT-UMaineSemi.fst' # Name of *.fst file
FAST_directory: '../Test_Cases/IEA-15-240-RWT-UMaineSemi' # Main OpenFAST model directory, where the *.fst lives
# Optional (but suggested...)
rotor_performance_filename: '../Test_Cases/IEA-15-240-RWT-UMaineSemi/Cp_Ct_Cq.IEA15MW.txtCp_Ct_Cq.IEA15MW.txt' # Filename for rotor performance text file (if it has been generated by ccblade already)
rotor_performance_filename: '../Test_Cases/IEA-15-240-RWT-UMaineSemi/Cp_Ct_Cq.IEA15MW.txt'

# -------------------------------- TURBINE PARAMETERS -----------------------------------
turbine_params:
Expand Down

0 comments on commit 983f13d

Please sign in to comment.