Skip to content

Commit

Permalink
Merge branch 'develop' into ci_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Jan 10, 2025
2 parents 4dfd5b0 + 3ae7464 commit ac000f2
Show file tree
Hide file tree
Showing 51 changed files with 24,121 additions and 130 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from rosco.toolbox.ofTools.fast_io.update_discons import update_discons


weis_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
iea15_dir = os.path.join(weis_dir,'examples/01_aeroelasticse/OpenFAST_models/IEA-15-240-RWT/')

Expand Down
57 changes: 3 additions & 54 deletions examples/02_run_openfast_cases/modeling_options_sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,8 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain
regulation_trajectory: IEA-15-240-RWT-outputs.yaml
openfast_file: IEA-15-240-RWT-UMaineSemi.fst
openfast_dir: ../01_aeroelasticse/OpenFAST_models/IEA-15-240-RWT/IEA-15-240-RWT-UMaineSemi
simulation:
DT: 0.0125
CompElast: 1
CompInflow: 1
CompAero: 2
CompServo: 1
CompHydro: 1
CompSub: 0
CompMooring: 3
CompIce: 0
OutFileFmt: 3
linearization:
Linearize: False
ElastoDyn:
FlapDOF1: True
FlapDOF2: True
EdgeDOF: True
TeetDOF: False
DrTrDOF: False
GenDOF: True
YawDOF: False
TwFADOF1 : True
TwFADOF2 : True
TwSSDOF1 : True
TwSSDOF2 : True
PtfmSgDOF: True
PtfmSwDOF: True
PtfmHvDOF: True
PtfmRDOF : True
PtfmPDOF : True
PtfmYDOF : False
TwrNodes: 50
HydroDyn:
WaveSeed1: 123456789
WaveSeed2: 1011121314
AddBLin3: [0.0, 0.0, 4389794.6, 0.0, 0.0, 0.0]
WaveMod: 2
WaveTMax: 850
WvLowCOff: 0.111527
WvHiCOff: 0.783827
WvSumQTF: True
RdtnMod: 1
PotMod: 1
DiffQTF: 0
PotFile: ../01_aeroelasticse/OpenFAST_models/IEA-15-240-RWT/IEA-15-240-RWT-UMaineSemi/HydroData/IEA-15-240-RWT-UMaineSemi

InflowWind:
RefHt: 150.0
AeroDyn:
WakeMod: 2

ROSCO:
flag: True
Expand All @@ -91,7 +45,7 @@ ROSCO:
Kp_float: -10
linmodel_tuning:
type: robust #'robust or simulation'
linfile_path: ../../ROSCO/Test_Cases/IEA-15-240-RWT-UMaineSemi/linearizations
linfile_path: ../01_aeroelasticse/OpenFAST_models/IEA-15-240-RWT/IEA-15-240-RWT-UMaineSemi/linearizations
lintune_outpath: rs_outfiles
load_parallel: True
stability_margin: 0.1
Expand All @@ -108,8 +62,3 @@ DLC_driver:
n_seeds: 1
analysis_time: 1.0
transient_time: 1.0
turbulent_wind:
HubHt: 140
GridHeight: 220
GridWidth: 220
# AnalysisTime: 5.
11 changes: 8 additions & 3 deletions examples/02_run_openfast_cases/weis_driver_sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
fname_modeling_options = os.path.join(run_dir, "modeling_options_sm.yaml")
fname_analysis_options = os.path.join(run_dir, "analysis_options_sm.yaml")

wt_opt, modeling_options, opt_options = weis_main(fname_wt_input,
fname_modeling_options,
fname_analysis_options)
def run():

wt_opt, modeling_options, opt_options = weis_main(fname_wt_input,
fname_modeling_options,
fname_analysis_options)

if __name__=="__main__":
run()
2 changes: 1 addition & 1 deletion examples/09_design_of_experiments/DOE_openfast.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
run_dir = os.path.dirname( os.path.realpath(__file__) ) + os.sep
fname_wt_input = os.path.join(run_dir, "..", "00_setup", "ref_turbines", "IEA-15-240-RWT_VolturnUS-S.yaml")
fname_modeling_options = os.path.join(run_dir, "..", "06_IEA-15-240-RWT", "modeling_options_umaine_semi.yaml")
fname_analysis_options = os.path.join(run_dir, "analysis_options.yaml")
fname_analysis_options = os.path.join(run_dir, "analysis_options_openfast.yaml")

wt_opt, modeling_options, opt_options = weis_main(fname_wt_input,
fname_modeling_options,
Expand Down
24 changes: 24 additions & 0 deletions examples/09_design_of_experiments/DOE_raft.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
This example shows how to use the Design of Experiments (DOE) driver within
WEIS including OpenFAST.
Specifically, the DOE driver helps sample the design space of a problem, allowing
you to perform parameter sweeps or random samples of design variables. This is
useful for better understanding a design space, especially prior to running optimization.
The DOE driver is not an optimizer, but simply runs the cases prescribed.
Check out the `driver` section within the `analysis_options.yaml` for the
DOE driver settings.
"""

import os
from weis import weis_main

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) ) + os.sep
fname_wt_input = os.path.join(run_dir, "..", "00_setup", "ref_turbines", "IEA-15-240-RWT_VolturnUS-S.yaml")
fname_modeling_options = os.path.join(run_dir, "..", "15_RAFT_Studies", "modeling_options_umaine_semi.yaml")
fname_analysis_options = os.path.join(run_dir, "analysis_options_raft.yaml")

wt_opt, modeling_options, opt_options = weis_main(fname_wt_input,
fname_modeling_options,
fname_analysis_options)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
general:
folder_output: outputs
fname_output: doe_output
folder_output: outputs/OpenFAST_DOE
fname_output: OpenFAST_DOE
design_variables:
blade:
aero_shape:
Expand Down
81 changes: 81 additions & 0 deletions examples/09_design_of_experiments/analysis_options_raft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
general:
folder_output: outputs/RAFT_DOE
fname_output: refturb_output


design_variables:
# control:
# servo:
# pitch_control:
# omega:
# flag: True
# min: 0.1
# max: 0.5

floating:
joints:
flag: True
z_coordinate:
- names: [main_keel, col1_keel, col2_keel, col3_keel]
lower_bound: -40.0
upper_bound: -15.0
r_coordinate:
- names: [col1_keel, col1_freeboard, col2_keel, col2_freeboard, col3_keel, col3_freeboard]
lower_bound: 38.8125
upper_bound: 64.6875
members:
flag: True
groups:
- names: [column1,column2,column3]
diameter:
lower_bound: 9.375
upper_bound: 15.625
constant: True
thickness:
lower_bound: 0.05
upper_bound: 0.25
constant: True
# - names: [Y_pontoon_lower1, Y_pontoon_lower2, Y_pontoon_lower3]
# diameter:
# lower_bound: 7.5
# upper_bound: 12.5



constraints:
control:
rotor_overspeed:
flag: True
min: 0.0
max: 0.25
Max_PtfmPitch:
flag: True
max: 5.5
Std_PtfmPitch:
flag: False
max: 2.
Max_Offset:
flag: True
max: 30.
floating:
stress:
flag: True
global_buckling:
flag: True
shell_buckling:
flag: True

merit_figure: platform_mass # Merit figure of the optimization problem. The options are 'AEP' - 'LCOE' - 'Cp' - 'blade_mass' - 'blade_tip_deflection'


driver:
design_of_experiments:
flag: True # Flag to enable design of experiments
run_parallel: True # Flag to run using parallel processing
generator: Uniform # Type of input generator. (Uniform)
num_samples: 20 # number of samples for (Uniform only)

recorder:
flag: True # Flag to activate OpenMDAO recorder
file_name: log_opt.sql # Name of OpenMDAO recorder
includes: ['*raft*','*floating*','*platform*']
2 changes: 1 addition & 1 deletion examples/09_design_of_experiments/postprocess_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def load_OMsql(log):

# sql outfile directory
run_dir = os.path.dirname(os.path.realpath(__file__))
output_dir = os.path.join(run_dir, "outputs")
output_dir = os.path.join(run_dir, "outputs/OpenFAST_DOE")
doe_logs = glob.glob(os.path.join(output_dir,"log_opt.sql*"))
if len(doe_logs) < 1:
raise FileExistsError("No output logs to post process!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ driver:
tol: 1.e-3 # Optimality tolerance
max_major_iter: 2 # Maximum number of major design iterations (SNOPT)
max_minor_iter: 100 # Maximum number of minor design iterations (SNOPT)
max_iter: 100 # Maximum number of iterations (SLSQP)
maxiter: 100 # Maximum number of iterations (SLSQP)
max_iter: 2 # Maximum number of iterations (SLSQP)
maxiter: 2 # Maximum number of iterations (SLSQP)
solver: LN_COBYLA # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
step_size: 1.e-3 # Step size for finite differencing
form: forward # Finite differencing mode, either forward or central
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ driver:
optimization:
flag: True # Flag to enable optimization
tol: 1.e-3 # Optimality tolerance
maxiter: 100 # Maximum number of iterations (NLopt)
max_iter: 1000 # Maximum number of iterations (SLSQP)
maxiter: 2 # Maximum number of iterations (NLopt)
max_iter: 2 # Maximum number of iterations (SLSQP)
solver: LN_COBYLA # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
penalty_exponent: 2.0 # constraint penalty exponent
# penalty_parameter: 2.0 # constraint penalty exponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ driver:
optimization:
flag: True # Flag to enable optimization
tol: 1.e-6 # Optimality tolerance
max_iter: 100 # Maximum number of iterations (SLSQP)
maxiter: 100 # Maximum number of iterations (NLopt)
maxgen: 100 # Maximum number of generations (DE)
max_iter: 2 # Maximum number of iterations (SLSQP)
maxiter: 2 # Maximum number of iterations (NLopt)
maxgen: 2 # Maximum number of generations (DE)
# maxtime: 3420
solver: LN_COBYLA # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
solver: SLSQP # Optimization solver. Other options are 'SLSQP' - 'CONMIN'

recorder:
flag: True # Flag to activate OpenMDAO recorder
Expand Down
23 changes: 3 additions & 20 deletions examples/17_IEA22_Optimization/driver_weis_openfast_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,8 @@
fname_modeling_options = os.path.join(run_dir, "modeling_options_openfast.yaml")
fname_analysis_options = os.path.join(run_dir, "analysis_options_of_ptfm_opt.yaml")

# Change optimizer and output folder
optimizer = sys.argv[1]
# optimizer = "SLSQP"
print(f"Optimizer: {optimizer}")
wt_opt, modeling_options, opt_options = weis_main(fname_wt_input,
fname_modeling_options,
fname_analysis_options)

analysis_override = {}
analysis_override["general"] = {}
analysis_override["general"]["folder_output"] = f"17_IEA22_OptStudies/of_{optimizer}"
analysis_override["driver"] = {}
analysis_override["driver"]["optimization"] = {}
analysis_override["driver"]["optimization"]["solver"] = optimizer

wt_opt, modeling_options, analysis_options = weis_main(
fname_wt_input,
fname_modeling_options,
fname_analysis_options,
analysis_override=analysis_override
)

print("Tower mass (kg) =", wt_opt["towerse.tower_mass"])
print("Floating platform mass (kg) =", wt_opt["floatingse.platform_mass"])

7 changes: 4 additions & 3 deletions examples/17_IEA22_Optimization/driver_weis_raft_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
fname_modeling_options = os.path.join(run_dir, "modeling_options_raft.yaml")
fname_analysis_options = os.path.join(run_dir, "analysis_options_raft_ptfm_opt.yaml")

wt_opt, modeling_options, analysis_options = weis_main(fname_wt_input, fname_modeling_options, fname_analysis_options)
wt_opt, modeling_options, opt_options = weis_main(fname_wt_input,
fname_modeling_options,
fname_analysis_options)


print("Tower mass (kg) =", wt_opt["towerse.tower_mass"])
print("Floating platform mass (kg) =", wt_opt["floatingse.platform_mass"])
42 changes: 7 additions & 35 deletions examples/17_IEA22_Optimization/modeling_options_openfast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ General:
use_exe: True
allow_fails: True
fail_value: 9999
FAST_exe: /projects/weis/cfrontin/software/openfast/build/glue-codes/openfast/openfast # faster on kestrel
# turbsim_exe: /home/dzalkind/Tools/openfast/build/modules/turbsim/turbsim # faster on kestrel

WISDEM:
RotorSE:
flag: True
Expand Down Expand Up @@ -81,19 +80,7 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain
PtfmRDOF : True
PtfmPDOF : True
PtfmYDOF : True
# HydroDyn:
# WvLowCOff: 0.15708
# WvHiCOff: 3.2
# WaveSeed1: 123456789
# AddBQuad1: [9.23e5, 0.0, 0.0, 0.0, -8.92e6, 0.0]
# AddBQuad2: [0.0, 9.23e5, 0.0, 8.92e6, 0.0, 0.0]
# AddBQuad3: [0.0, 0.0, 2.3e6, 0.0, 0.0, 0.0]
# AddBQuad4: [0.0, 8.92e6, 0.0, 1.68e10, 0.0, 0.0]
# AddBQuad5: [-8.92e6, 0.0, 0.0, 0.0, 1.68e10, 0.0]
# AddBQuad6: [0.0, 0.0, 0.0, 0.0, 0.0, 4.8e10]
# PotMod: 1
# WaveMod: 0
# PotFile: examples/01_aeroelasticse/OpenFAST_models/IEA-15-240-RWT/IEA-15-240-RWT-UMaineSemi/HydroData/IEA-15-240-RWT-UMaineSemi

Level1:
flag: True
potential_model_override: 0
Expand All @@ -102,21 +89,8 @@ Level1:
save_designs: True
ROSCO:
flag: True
# SD_Mode: 0
# PS_Mode: 3
# ps_percent: 0.9
# F_LPFType: 2
# F_NotchType: 2
# Fl_Mode: 2
tuning_yaml: IEA-22-280-RWT-Semi_retune.yaml
# zeta_pc: [1.0,1.0,1.0]
# omega_pc: [0.2,0.15,0.15]
# U_pc: [12.0,18.0,24.0]
# zeta_vs: 0.85 # Torque controller desired damping ratio [-]
# omega_vs: 0.12
# twr_freq: 3.2
# ptfm_freq: 0.2
# Kp_float: -10
tuning_yaml: rosco_inputs_iea22.yaml

DLC_driver:
metocean_conditions:
wind_speed: [4., 6., 8., 10., 12., 14., 16., 18., 20., 22., 24.]
Expand All @@ -129,13 +103,11 @@ DLC_driver:
wave_height_50: 10.68
wave_period_50: 14.2
DLCs:
# - DLC: "1.1"
# n_seeds: 6
- DLC: "1.1" # local, lite
n_seeds: 6
n_seeds: 1
# wind_speed: [12.0, 18.0, 24.0]
transient_time: 120.0 # 0.
analysis_time: 600.0 # 10.
transient_time: 0.0 # 0.
analysis_time: 1.0 # 10.
# - DLC: "1.6" # kestrel
# n_seeds: 6
# - DLC: "1.6" # local, lite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain

ROSCO:
flag: True
tuning_yaml: IEA-22-280-RWT-Semi_ROSCO.yaml
tuning_yaml: rosco_inputs_iea22

DLC_driver:
DLCs:
Expand Down
Loading

0 comments on commit ac000f2

Please sign in to comment.