Skip to content

Commit

Permalink
Merge pull request #332 from WISDEM/hackathon
Browse files Browse the repository at this point in the history
Cleanup of ref turbine files
  • Loading branch information
gbarter authored Jan 6, 2025
2 parents 29fcb49 + 90fce03 commit 61bd059
Show file tree
Hide file tree
Showing 62 changed files with 7,295 additions and 7,680 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI_WEIS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install conda/mamba
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
# https://github.com/marketplace/actions/setup-miniconda
with:
# To use mamba, uncomment here, comment out the miniforge line
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_exhaustive_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install conda/mamba
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
# https://github.com/marketplace/actions/setup-miniconda
with:
# To use mamba, uncomment here, comment out the miniforge line
Expand Down
36 changes: 19 additions & 17 deletions examples/00_setup/get_wisdem_yamls.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
import os
import requests
'''
"""
Run this script to update geometry yamls based on WISDEM yamls
'''
"""

def main():

wisdem_weis_map = {
# relative to examples/
# WISDEM example input WEIS example
"09_floating/nrel5mw-spar_oc3.yaml": "03_NREL5MW_OC3_spar/nrel5mw-spar_oc3.yaml",
"09_floating/nrel5mw-semi_oc4.yaml": "04_NREL5MW_OC4_semi/nrel5mw-semi_oc4.yaml",
"09_floating/IEA-15-240-RWT_VolturnUS-S.yaml": "06_IEA-15-240-RWT/IEA-15-240-RWT_VolturnUS-S.yaml",
"02_reference_turbines/IEA-15-240-RWT.yaml": "06_IEA-15-240-RWT/IEA-15-240-RWT_Monopile.yaml",
"02_reference_turbines/IEA-3p4-130-RWT.yaml": "05_IEA-3.4-130-RWT/IEA-3p4-130-RWT.yaml",
"03_blade/BAR_USC.yaml": "08_OLAF/BAR_USC.yaml",
}
wisdem_ref_turbs = [
"09_floating/nrel5mw-spar_oc3.yaml",
"09_floating/nrel5mw-semi_oc4.yaml",
"09_floating/IEA-15-240-RWT_VolturnUS-S.yaml",
"09_floating/IEA-22-280-RWT_Floater.yaml",
"02_reference_turbines/IEA-10-198-RWT.yaml",
"02_reference_turbines/IEA-15-240-RWT.yaml",
"02_reference_turbines/IEA-22-280-RWT.yaml",
"02_reference_turbines/IEA-3p4-130-RWT.yaml",
"03_blade/BAR_USC.yaml",
]

example_dir = os.path.join(os.path.dirname(__file__),"..")
setup_dir = os.path.dirname(__file__)

for wisdem_ex, weis_ex in wisdem_weis_map.items():
for wisdem_ex in wisdem_ref_turbs:

raw_url = f"https://raw.githubusercontent.com/WISDEM/WISDEM/master/examples/{wisdem_ex}"

local_path = os.path.join(example_dir,weis_ex)
fname = wisdem_ex.split('/')[-1]
local_path = os.path.join(setup_dir, "ref_turbines", fname)

# Download the file
response = requests.get(raw_url)
if response.status_code == 200:
with open(local_path, 'wb') as f:
with open(local_path, "wb") as f:
f.write(response.content)
print(f"Downloaded {raw_url} to {local_path}")
else:
print(f"Failed to download {raw_url}. Status code: {response.status_code}")


if __name__=="__main__":
main()
main()
File renamed without changes.
File renamed without changes.
921 changes: 921 additions & 0 deletions examples/00_setup/ref_turbines/IEA-10-198-RWT.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,278 changes: 1,278 additions & 0 deletions examples/00_setup/ref_turbines/IEA-15-240-RWT_VolturnUS-S_sparsetower.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,481 changes: 1,481 additions & 0 deletions examples/00_setup/ref_turbines/IEA-22-280-RWT.yaml

Large diffs are not rendered by default.

1,711 changes: 1,711 additions & 0 deletions examples/00_setup/ref_turbines/IEA-22-280-RWT_Floater.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -993,21 +993,10 @@ bos:
plant_row_spacing: 7
commissioning_cost_kW: 44.0
decommissioning_cost_kW: 58.0
distance_to_substation: 1.0
distance_to_interconnection: 8.5
interconnect_voltage: 130.
distance_to_site: 115.
distance_to_landfall: 50.
port_cost_per_month: 2e6
boem_review_cost: 0.0
construction_insurance: 44.0
construction_financing: 183.0
contingency: 316.0
site_auction_price: 100e6
site_assessment_cost: 50e6
construction_plan_cost: 2.5e5
installation_plan_cost: 1e6

distance_to_substation: 50.0
distance_to_interconnection: 8.
interconnect_voltage: 130

costs:
wake_loss_factor: 0.15
fixed_charge_rate: 0.075
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,20 +820,9 @@ bos:
plant_row_spacing: 7
commissioning_cost_kW: 44.0
decommissioning_cost_kW: 58.0
distance_to_substation: 1.0
distance_to_interconnection: 8.5
interconnect_voltage: 130.
distance_to_site: 115.
distance_to_landfall: 50.
port_cost_per_month: 2e6
boem_review_cost: 0.0
construction_insurance: 44.0
construction_financing: 183.0
contingency: 316.0
site_auction_price: 100e6
site_assessment_cost: 50e6
construction_plan_cost: 2.5e5
installation_plan_cost: 1e6
distance_to_substation: 50.0
distance_to_interconnection: 8.
interconnect_voltage: 130

costs:
wake_loss_factor: 0.15
Expand Down
54 changes: 27 additions & 27 deletions examples/01_aeroelasticse/run_OLAF.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
fastBatch = runFAST_pywrapper_batch()
run_dir1 = os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ) + os.sep
run_dir2 = os.path.dirname( os.path.realpath(__file__) ) + os.sep
fastBatch.FAST_directory = os.path.join(run_dir2, 'OpenFAST_models','IEA-15-240-RWT','IEA-15-240-RWT-OLAF') # Path to fst directory files
fastBatch.FAST_InputFile = 'IEA-15-240-RWT_OLAF.fst' # FAST input file (ext=.fst)
fastBatch.FAST_runDirectory = 'olaf' + os.sep + 'iea15mw'
fastBatch.FAST_directory = os.path.join(run_dir2, "OpenFAST_models","IEA-15-240-RWT","IEA-15-240-RWT-OLAF") # Path to fst directory files
fastBatch.FAST_InputFile = "IEA-15-240-RWT_OLAF.fst" # FAST input file (ext=.fst)
fastBatch.FAST_runDirectory = "olaf" + os.sep + "iea15mw"
fastBatch.debug_level = 2

# User settings
Expand All @@ -41,23 +41,23 @@

# Settings passed to OpenFAST
case_inputs = {}
case_inputs[("Fst","TMax")] = {'vals':[TMax], 'group':0}
case_inputs[("Fst","DT")] = {'vals':[0.01], 'group':0}
case_inputs[("Fst","DT_Out")] = {'vals':[0.1], 'group':0}
case_inputs[("ServoDyn","DLL_DT")] = {'vals':[0.01], 'group':0}
case_inputs[("Fst","CompInflow")] = {'vals':[1], 'group':0}
case_inputs[("Fst","CompServo")] = {'vals':[1], 'group':0}
case_inputs[("Fst","OutFileFmt")] = {'vals':[1], 'group':0}
case_inputs[("ElastoDyn","GenDOF")] = {'vals':['True'], 'group':0}
case_inputs[("ServoDyn","PCMode")] = {'vals':[5], 'group':0}
case_inputs[("ServoDyn","VSContrl")] = {'vals':[5], 'group':0}
case_inputs[("AeroDyn15","WakeMod")] = {'vals':[3], 'group':0}
case_inputs[("AeroDyn15","AFAeroMod")] = {'vals':[1], 'group':0}
case_inputs[("InflowWind","WindType")] = {'vals':[1], 'group':0}
case_inputs[("InflowWind","HWindSpeed")]= {'vals': wind_speeds, 'group': 1}
case_inputs[("Fst","OutFileFmt")] = {'vals':[0], 'group':0}
case_inputs[("ElastoDyn","RotSpeed")] = {'vals': omega_init, 'group': 1}
case_inputs[("ElastoDyn","BlPitch1")] = {'vals': pitch_init, 'group': 1}
case_inputs[("Fst","TMax")] = {"vals":[TMax], "group":0}
case_inputs[("Fst","DT")] = {"vals":[0.01], "group":0}
case_inputs[("Fst","DT_Out")] = {"vals":[0.1], "group":0}
case_inputs[("ServoDyn","DLL_DT")] = {"vals":[0.01], "group":0}
case_inputs[("Fst","CompInflow")] = {"vals":[1], "group":0}
case_inputs[("Fst","CompServo")] = {"vals":[1], "group":0}
case_inputs[("Fst","OutFileFmt")] = {"vals":[1], "group":0}
case_inputs[("ElastoDyn","GenDOF")] = {"vals":["True"], "group":0}
case_inputs[("ServoDyn","PCMode")] = {"vals":[5], "group":0}
case_inputs[("ServoDyn","VSContrl")] = {"vals":[5], "group":0}
case_inputs[("AeroDyn15","WakeMod")] = {"vals":[3], "group":0}
case_inputs[("AeroDyn15","AFAeroMod")] = {"vals":[1], "group":0}
case_inputs[("InflowWind","WindType")] = {"vals":[1], "group":0}
case_inputs[("InflowWind","HWindSpeed")]= {"vals": wind_speeds, "group": 1}
case_inputs[("Fst","OutFileFmt")] = {"vals":[0], "group":0}
case_inputs[("ElastoDyn","RotSpeed")] = {"vals": omega_init, "group": 1}
case_inputs[("ElastoDyn","BlPitch1")] = {"vals": pitch_init, "group": 1}
case_inputs[("ElastoDyn","BlPitch2")] = case_inputs[("ElastoDyn","BlPitch1")]
case_inputs[("ElastoDyn","BlPitch3")] = case_inputs[("ElastoDyn","BlPitch1")]

Expand All @@ -73,17 +73,17 @@
dt = case_inputs[("Fst","DT")]["vals"]
n_dt = dt_fvw / dt
dt_olaf = dt * np.around(n_dt)
case_inputs[("AeroDyn15","OLAF","DTfvw")] = {'vals':dt_olaf, 'group':1}
case_inputs[("AeroDyn15","OLAF","nNWPanels")] = {'vals':nNWPanels, 'group':1}
case_inputs[("AeroDyn15","OLAF","nNWPanelsFree")] = {'vals':nNWPanelsFree, 'group':1}
case_inputs[("AeroDyn15","OLAF","nFWPanels")] = {'vals':nFWPanels, 'group':1}
case_inputs[("AeroDyn15","OLAF","nFWPanelsFree")] = {'vals':nFWPanelsFree, 'group':1}
case_inputs[("AeroDyn15","OLAF","DTfvw")] = {"vals":dt_olaf, "group":1}
case_inputs[("AeroDyn15","OLAF","nNWPanels")] = {"vals":nNWPanels, "group":1}
case_inputs[("AeroDyn15","OLAF","nNWPanelsFree")] = {"vals":nNWPanelsFree, "group":1}
case_inputs[("AeroDyn15","OLAF","nFWPanels")] = {"vals":nFWPanels, "group":1}
case_inputs[("AeroDyn15","OLAF","nFWPanelsFree")] = {"vals":nFWPanelsFree, "group":1}

# Find the controller
case_inputs[("ServoDyn","DLL_FileName")] = {'vals':[path2dll], 'group':0}
case_inputs[("ServoDyn","DLL_FileName")] = {"vals":[path2dll], "group":0}

# Generate the matrix of cases
case_list, case_name_list = CaseGen_General(case_inputs, dir_matrix=fastBatch.FAST_runDirectory, namebase='iea15mw')
case_list, case_name_list = CaseGen_General(case_inputs, dir_matrix=fastBatch.FAST_runDirectory, namebase="iea15mw")

fastBatch.case_list = case_list
fastBatch.case_name_list = case_name_list
Expand Down
54 changes: 27 additions & 27 deletions examples/01_aeroelasticse/run_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
import platform
import shutil

if __name__ == '__main__':
if __name__ == "__main__":

# Paths calling the standard modules of WEIS
fastBatch = runFAST_pywrapper_batch()
run_dir1 = os.path.dirname( os.path.dirname( os.path.realpath(weis.__file__) ) )
fastBatch.FAST_exe = shutil.which( 'openfast' ) # Path to executable
fastBatch.FAST_exe = shutil.which( "openfast" ) # Path to executable
run_dir2 = os.path.dirname( os.path.realpath(__file__) ) + os.sep
fastBatch.FAST_directory = os.path.join(run_dir2, 'OpenFAST_models','IEA-15-240-RWT','IEA-15-240-RWT-Monopile') # Path to fst directory files
fastBatch.FAST_InputFile = 'IEA-15-240-RWT-Monopile.fst' # FAST input file (ext=.fst)
fastBatch.FAST_runDirectory = 'steady_state/iea15mw'
fastBatch.FAST_directory = os.path.join(run_dir2, "OpenFAST_models","IEA-15-240-RWT","IEA-15-240-RWT-Monopile") # Path to fst directory files
fastBatch.FAST_InputFile = "IEA-15-240-RWT-Monopile.fst" # FAST input file (ext=.fst)
fastBatch.FAST_runDirectory = "steady_state/iea15mw"
fastBatch.debug_level = 2

# User settings
Expand All @@ -41,36 +41,36 @@

# Settings passed to OpenFAST
case_inputs = {}
case_inputs[("Fst","TMax")] = {'vals':[TMax], 'group':0}
case_inputs[("Fst","DT")] = {'vals':[0.01], 'group':0}
case_inputs[("Fst","CompInflow")] = {'vals':[1], 'group':0}
case_inputs[("Fst","CompServo")] = {'vals':[1], 'group':0}
case_inputs[("Fst","OutFileFmt")] = {'vals':[1], 'group':0}
case_inputs[("Fst","DT_Out")] = {'vals':[0.02], 'group':0}
case_inputs[("ElastoDyn","GenDOF")] = {'vals':['True'], 'group':0}
case_inputs[("ServoDyn","PCMode")] = {'vals':[5], 'group':0}
case_inputs[("ServoDyn","VSContrl")] = {'vals':[5], 'group':0}
case_inputs[("InflowWind","WindType")] = {'vals':[1], 'group':0}
case_inputs[("InflowWind","HWindSpeed")]= {'vals': wind_speeds, 'group': 1}
case_inputs[("Fst","OutFileFmt")] = {'vals':[0], 'group':0}
case_inputs[("ElastoDyn","RotSpeed")] = {'vals': omega_init, 'group': 1}
case_inputs[("ElastoDyn","BlPitch1")] = {'vals': pitch_init, 'group': 1}
case_inputs[("Fst","TMax")] = {"vals":[TMax], "group":0}
case_inputs[("Fst","DT")] = {"vals":[0.01], "group":0}
case_inputs[("Fst","CompInflow")] = {"vals":[1], "group":0}
case_inputs[("Fst","CompServo")] = {"vals":[1], "group":0}
case_inputs[("Fst","OutFileFmt")] = {"vals":[1], "group":0}
case_inputs[("Fst","DT_Out")] = {"vals":[0.02], "group":0}
case_inputs[("ElastoDyn","GenDOF")] = {"vals":["True"], "group":0}
case_inputs[("ServoDyn","PCMode")] = {"vals":[5], "group":0}
case_inputs[("ServoDyn","VSContrl")] = {"vals":[5], "group":0}
case_inputs[("InflowWind","WindType")] = {"vals":[1], "group":0}
case_inputs[("InflowWind","HWindSpeed")]= {"vals": wind_speeds, "group": 1}
case_inputs[("Fst","OutFileFmt")] = {"vals":[0], "group":0}
case_inputs[("ElastoDyn","RotSpeed")] = {"vals": omega_init, "group": 1}
case_inputs[("ElastoDyn","BlPitch1")] = {"vals": pitch_init, "group": 1}
case_inputs[("ElastoDyn","BlPitch2")] = case_inputs[("ElastoDyn","BlPitch1")]
case_inputs[("ElastoDyn","BlPitch3")] = case_inputs[("ElastoDyn","BlPitch1")]

# Find the controller
if platform.system() == 'Windows':
sfx = 'dll'
elif platform.system() == 'Darwin':
sfx = 'dylib'
if platform.system() == "Windows":
sfx = "dll"
elif platform.system() == "Darwin":
sfx = "dylib"
else:
sfx = 'so'
path2dll = os.path.join(run_dir1, 'local','lib','libdiscon.'+sfx)
sfx = "so"
path2dll = os.path.join(run_dir1, "local","lib","libdiscon."+sfx)

case_inputs[("ServoDyn","DLL_FileName")] = {'vals':[path2dll], 'group':0}
case_inputs[("ServoDyn","DLL_FileName")] = {"vals":[path2dll], "group":0}

# Generate the matrix of cases
case_list, case_name_list = CaseGen_General(case_inputs, dir_matrix=fastBatch.FAST_runDirectory, namebase='iea15mw')
case_list, case_name_list = CaseGen_General(case_inputs, dir_matrix=fastBatch.FAST_runDirectory, namebase="iea15mw")

fastBatch.case_list = case_list
fastBatch.case_name_list = case_name_list
Expand Down
56 changes: 28 additions & 28 deletions examples/01_aeroelasticse/run_nodalOutputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
import shutil


if __name__ == '__main__':
if __name__ == "__main__":

# Paths calling the standard modules of WEIS
fastBatch = runFAST_pywrapper_batch()
run_dir1 = os.path.dirname( os.path.dirname( os.path.realpath(weis.__file__) ) )
fastBatch.FAST_exe = shutil.which( 'openfast' ) # Path to executable
fastBatch.FAST_exe = shutil.which( "openfast" ) # Path to executable
run_dir2 = os.path.dirname( os.path.realpath(__file__) ) + os.sep
fastBatch.FAST_directory = os.path.join(run_dir2, 'OpenFAST_models','IEA-15-240-RWT','IEA-15-240-RWT-NodalOutputs') # Path to fst directory files
fastBatch.FAST_InputFile = 'IEA-15-240-RWT-NodalOutputs.fst' # FAST input file (ext=.fst)
fastBatch.FAST_runDirectory = 'steady_state-nodal/iea15mw'
fastBatch.FAST_directory = os.path.join(run_dir2, "OpenFAST_models","IEA-15-240-RWT","IEA-15-240-RWT-NodalOutputs") # Path to fst directory files
fastBatch.FAST_InputFile = "IEA-15-240-RWT-NodalOutputs.fst" # FAST input file (ext=.fst)
fastBatch.FAST_runDirectory = "steady_state-nodal/iea15mw"
fastBatch.debug_level = 2

# User settings
Expand All @@ -42,39 +42,39 @@

# Settings passed to OpenFAST
case_inputs = {}
case_inputs[("Fst","TMax")] = {'vals':[TMax], 'group':0}
case_inputs[("Fst","DT")] = {'vals':[0.0002], 'group':0}
case_inputs[("Fst","CompInflow")] = {'vals':[1], 'group':0}
case_inputs[("Fst","CompServo")] = {'vals':[1], 'group':0}
case_inputs[("Fst","OutFileFmt")] = {'vals':[1], 'group':0}
case_inputs[("Fst","DT_Out")] = {'vals':[0.01], 'group':0}
case_inputs[("ElastoDyn","GenDOF")] = {'vals':['True'], 'group':0}
case_inputs[("ServoDyn","PCMode")] = {'vals':[5], 'group':0}
case_inputs[("ServoDyn","VSContrl")] = {'vals':[5], 'group':0}
case_inputs[("InflowWind","WindType")] = {'vals':[1], 'group':0}
case_inputs[("InflowWind","HWindSpeed")]= {'vals': wind_speeds, 'group': 0}
case_inputs[("Fst","OutFileFmt")] = {'vals':[0], 'group':0}
case_inputs[("ElastoDyn","RotSpeed")] = {'vals': omega_init, 'group': 0}
case_inputs[("ElastoDyn","BlPitch1")] = {'vals': pitch_init, 'group': 0}
case_inputs[("Fst","TMax")] = {"vals":[TMax], "group":0}
case_inputs[("Fst","DT")] = {"vals":[0.0002], "group":0}
case_inputs[("Fst","CompInflow")] = {"vals":[1], "group":0}
case_inputs[("Fst","CompServo")] = {"vals":[1], "group":0}
case_inputs[("Fst","OutFileFmt")] = {"vals":[1], "group":0}
case_inputs[("Fst","DT_Out")] = {"vals":[0.01], "group":0}
case_inputs[("ElastoDyn","GenDOF")] = {"vals":["True"], "group":0}
case_inputs[("ServoDyn","PCMode")] = {"vals":[5], "group":0}
case_inputs[("ServoDyn","VSContrl")] = {"vals":[5], "group":0}
case_inputs[("InflowWind","WindType")] = {"vals":[1], "group":0}
case_inputs[("InflowWind","HWindSpeed")]= {"vals": wind_speeds, "group": 0}
case_inputs[("Fst","OutFileFmt")] = {"vals":[0], "group":0}
case_inputs[("ElastoDyn","RotSpeed")] = {"vals": omega_init, "group": 0}
case_inputs[("ElastoDyn","BlPitch1")] = {"vals": pitch_init, "group": 0}
case_inputs[("ElastoDyn","BlPitch2")] = case_inputs[("ElastoDyn","BlPitch1")]
case_inputs[("ElastoDyn","BlPitch3")] = case_inputs[("ElastoDyn","BlPitch1")]

case_inputs[("Fst","CompElast")] = {'vals':[1,2], 'group':1}
case_inputs[("Fst","CompElast")] = {"vals":[1,2], "group":1}


# Find the controller
if platform.system() == 'Windows':
sfx = 'dll'
elif platform.system() == 'Darwin':
sfx = 'dylib'
if platform.system() == "Windows":
sfx = "dll"
elif platform.system() == "Darwin":
sfx = "dylib"
else:
sfx = 'so'
path2dll = os.path.join(run_dir1, 'local','lib','libdiscon.'+sfx)
sfx = "so"
path2dll = os.path.join(run_dir1, "local","lib","libdiscon."+sfx)

# case_inputs[("ServoDyn","DLL_FileName")] = {'vals':[path2dll], 'group':0}
# case_inputs[("ServoDyn","DLL_FileName")] = {"vals":[path2dll], "group":0}

# Generate the matrix of cases
case_list, case_name_list = CaseGen_General(case_inputs, dir_matrix=fastBatch.FAST_runDirectory, namebase='iea15mw-nodal')
case_list, case_name_list = CaseGen_General(case_inputs, dir_matrix=fastBatch.FAST_runDirectory, namebase="iea15mw-nodal")

fastBatch.case_list = case_list
fastBatch.case_name_list = case_name_list
Expand Down
Loading

0 comments on commit 61bd059

Please sign in to comment.