Skip to content

Commit

Permalink
Update examples to test in weis environment, working
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind committed Mar 10, 2021
1 parent 15976f5 commit 9b123f1
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 61 deletions.
17 changes: 12 additions & 5 deletions Examples/example_06.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
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 @@ -34,21 +36,26 @@

# Load turbine data from OpenFAST and rotor performance text file
turbine.load_from_fast(path_params['FAST_InputFile'], \
os.path.join(this_dir,path_params['FAST_directory']), \
os.path.join(rt_dir,path_params['FAST_directory']), \
dev_branch=True,rot_source='txt',\
txt_filename=os.path.join(this_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']))
txt_filename=os.path.join(rt_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(this_dir,'DISCON.IN') # This must be named DISCON.IN to be seen by the compiled controller binary.
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.
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 = 'openfast'
run_openfast(path_params['FAST_directory'], fastcall=fastcall, fastfile=path_params['FAST_InputFile'], chdir=True)
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
)



Expand Down
7 changes: 6 additions & 1 deletion Examples/example_09.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@
wind_directory = os.path.join(this_dir,'../Test_Cases/Wind/')
turbsim_infile = '90m_12mps_twr.inp'

run_openfast(wind_directory, fastcall='turbsim', fastfile=turbsim_infile, chdir=False)
run_openfast(
wind_directory,
fastcall='/Users/dzalkind/Tools/WEIS-1/build/temp.macosx-10.9-x86_64-3.8_rosco_openfast/modules/turbsim/turbsim',
fastfile=turbsim_infile,
chdir=False
)

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

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 @@ -40,7 +43,10 @@
controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
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'])
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']))

# 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}
True TwrShadow - Calculate tower influence on wind based on downstream tower shadow? (flag)
0 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
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
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
====== 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}
False TwrShadow - Calculate tower influence on wind based on downstream tower shadow (switch) {0=none, 1=Powles model, 2=Eames model}
0 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
(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.
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
====== 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
Loading

0 comments on commit 9b123f1

Please sign in to comment.