Skip to content

Commit

Permalink
Updated to latest OWENS
Browse files Browse the repository at this point in the history
  • Loading branch information
yqliaohk committed Dec 4, 2024
1 parent cb5f204 commit 3ca24b0
Show file tree
Hide file tree
Showing 9 changed files with 643 additions and 261 deletions.
65 changes: 27 additions & 38 deletions examples/18_owens/analysis_options_owens_DVs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,43 @@ general:
fname_output: refturb_output

design_variables:
tower:
outer_diameter:
blade:
aero_shape:
chord:
flag: True
# max: 20.0
rotor_radius_vawt:
flag: True
n_opt: 7
index_start: 1
index_end: 6
# max: 20.0


merit_figure: vawt_pseudolcoe

constraints:
owens:
SF:
flag: True
lower_bound: 3.87
upper_bound: 8.0
layer_thickness:
lower_bound: 2.0
fatigue:
flag: True
lower_bound: 4e-3
upper_bound: 2e-1

merit_figure: tower_mass
power:
flag: True # Enforce positive power

# constraints:
# tower:
# height_constraint:
# flag: False
# lower_bound: 1.e-2
# upper_bound: 1.e-2
# stress:
# flag: True
# global_buckling:
# flag: True
# shell_buckling:
# flag: True
# d_to_t:
# flag: True
# lower_bound: 120.0
# upper_bound: 500.0
# taper:
# flag: True
# lower_bound: 0.2
# slope:
# flag: True
# frequency_1:
# flag: True
# lower_bound: 0.13
# upper_bound: 0.40

driver:
optimization:
flag: False # Flag to enable optimization
flag: True # Flag to enable optimization
tol: 1.e-6 # Optimality tolerance
# max_major_iter: 10 # 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)
solver: SNOPT # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
step_size: 1.e-6 # Step size for finite differencing
max_iter: 200 # Maximum number of iterations (SLSQP)
solver: SLSQP # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
step_size: 1.e-4 # Step size for finite differencing
form: forward # Finite differencing mode, either forward or central
setp_calc: rel_avg
# design_of_experiments:
# flag: True # Flag to enable design of experiments
# run_parallel: False # Flag to run using parallel processing
Expand Down
2 changes: 1 addition & 1 deletion examples/18_owens/driver_weis_owens.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

analysis_override = {}
analysis_override['general'] = {}
analysis_override['general']['folder_output'] = os.path.join('outputs/18_OWENS_OptStudies/1_change_opt/',"slsqp")
analysis_override['general']['folder_output'] = os.path.join('outputs/18_OWENS_OptStudies/1_change_opt_chord_radius/',"slsqp")
analysis_override['driver'] = {}
analysis_override['driver']['optimization'] = {}
analysis_override['driver']['optimization']['solver'] = "SLSQP"
Expand Down
108 changes: 63 additions & 45 deletions examples/18_owens/modeling_options_OWENS_windioExample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,70 @@ WISDEM:
# flag: True

OWENS:
flag: True
OWENS_project_path: /Users/yliao/Documents/Projects/CT-OPT/OWENS
master_input: /Users/yliao/repos/OWENS.jl/docs/src/literate/sampleOWENS.yml
analysisType: unsteady # unsteady, steady, modal
turbineType: Darrieus #Darrieus, H-VAWT, ARCUS
controlStrategy: constantRPM # TODO: incorporate the others
RPM: 17.2 #RPM
numTS: 20 #
delta_t: 0.01 # s
Nslices: 30 # number of OWENSAero discritizations #TODO: AD parameters
ntheta: 30 # number of OWENSAero azimuthal discretizations
AModel: DMS # AD, DMS, AC
structuralModel: GX #GX, TNB, ROM
structuralNonlinear: false #TODO: propogate
ntelem: 10 #tower elements in each
nbelem: 60 #blade elements in each
ncelem: 10 #central cable elements in each if turbineType is ARCUS
nselem: 5 #strut elements in each if turbineType has struts
run_path: /Users/yliao/repos/OWENS.jl/docs/src/literate/
flag: True
general:
OWENS_project_path: /Users/yliao/Documents/Projects/CT-OPT/OWENS
master_input: /Users/yliao/repos/OWENS.jl/examples/literate/sampleOWENS.yml
run_path: /Users/yliao/repos/WEIS/examples/18_owens # points to the data folders
analysisType: unsteady # unsteady, steady, modal
AeroModel: "DMS" # OWENSAero model "DMS" for double multiple streamtube or "AC" for actuator cylinder, or "AD" for aerodyn
structuralModel: "TNB" #Structural models available: TNB full timoshenko beam elements with time newmark beta time stepping, ROM reduced order modal model of the timoshenko elements, GX with GXBeam's methods for geometrically exact beam theory and more efficient methods and time stepping
controlStrategy: "prescribedRPM" # should be in WindIO?- yes,
numTS: 20 # number of time steps TODO: change to sim time and make this derived
delta_t: 0.01 # time step in seconds
dataOutputFilename: "./InitialDataOutputs.out" # data output filename with path, set to nothing or don't specify to not output anything
TOL: 1e-4 # gauss-seidel iteration tolerance - i.e. the two-way iteration tolerance
MAXITER: 300 # gauss-seidel max iterations - i.e. the two-way iterations
verbosity: 2 # verbosity where 0 is nothing, 1 is warnings, 2 is summary outputs, 3 is detailed outputs, and 4 is everything
VTKsaveName: "./vtk/windio" # Path and name of the VTK outputs, recommended to put it in its own folder (which it will automatically create if needed)
aeroLoadsOn: 2 # Level of aero coupling 0 structures only, 1 no deformation passed to the aero, 2 two-way coupling, 1.5 last time step's deformations passed to this timesteps aero and no internal iteration.
Prescribed_RPM_time_controlpoints: [0.0,100000.1]
Prescribed_RPM_RPM_controlpoints: [17.2,17.2]
Prescribed_Vinf_time_controlpoints: [0.0,100000.1]
Prescribed_Vinf_Vinf_controlpoints: [17.2,17.2]

DLC_Options:
DLCs: ["1_1","2_1"] # name of DLC
Vinf_range: [17.2] # inflow Cutin to cutout and discretization
IEC_std: "\"1-ED3\"" # turbsim input file IEC standard
WindChar: "\"A\"" # turbsim wind charasteric
WindClass: 1 # turbsim wind class
turbsimsavepath: "./turbsimfiles" # path where the turbsim files are saved
pathtoturbsim: nothing # path to the turbsim executable
NumGrid_Z: 38 # turbsim vertical discretizations
NumGrid_Y: 26 # turbsim horizontal discretizations
Vref: 17.2 # reference/nominal wind speed m/s for turbsim or other inflow wind input file (depending on which DLC is selected)
Vdesign: 11.0 # Design or rated speed of turbine, used for certain DLC cases
grid_oversize: 1.1 # amount that the turbsim inflow is oversized compared to the turbine to allow for deflection
regenWindFiles: false #, force regeneration of turbsim files even if they already exist
delta_t_turbsim: 0.05 # turbsim timestep
simtime_turbsim: 600.0 # turbsim total time, which loops if simtime exceeds turbsim time

# designParameters:
eta: 0.5 # blade mount point ratio, 0.5 is the blade half chord is perpendicular with the axis of rotation, 0.25 is the quarter chord, etc
# move to geometry?
# Nbld: 3 # number of blades
# Blade_Radius: 54.01123056 # blade height m
# Blade_Height: 110.1829092 # blade radius m
# towerHeight: 3.0 # m tower extension height below blades
OWENSAero_Options:
Nslices: 30 # number of 3-D slices for the strip method to go from 2D to 3D considering curved deforming blades
ntheta: 30 # number of azimuthal discretizations
ifw: false # use the OpenFASTWrappers inflow wind coupling to get inflow velocities
DynamicStallModel: "BV" # dynamic stall model, should be under an OWENSAero options
RPI: true # rotating point iterative method (i.e. it just calculates at the blade positions and is much faster)
Aero_Buoyancy_Active: false # flag to turn buoyancy on for the blades. This is likely to be replaced by a different model

# operationParameters:
# rho: 1.225 # air density
# Vinf: 17.2 # m/s #optional, supersceeded if ifw=true
OWENSFEA_Options:
nlOn: true #nonlinear effects
RayleighAlpha: 0.05 #damping coefficient scalar on the stiffness matrix
RayleighBeta: 0.05 #damping coefficient scalar on the mass matrix
iterationType: "DI" #internal iteration type DI direct iteration, NR newton rhapson (which is less stable than DI)
numModes: 20 #if ROM model, number of modes used in the analysis type. Less is faster but less accurate
tolerance: 1.0e-06 #total mesh unsteady analysis convergence tolerance for a timestep within the structural model
maxIterations: 50 #total mesh unsteady analysis convergence max iterations for a timestep
AddedMass_Coeff_Ca: 0.0 #added mass coefficient, scaling factor (typically 0-1) on the cones of water mass applied to each structural element in the 22 and 33 diagonal terms. 0 turns this off

# turbulentInflow:
ifw: false
windType: 3
windINPfilename: /Users/yliao/repos/OWENS.jl/examples/Optimization/data/turbsim/115mx115m_30x30_20.0msETM.bts
ifw_libfiles: None
Mesh_Options:
ntelem: 10 # number of tower elements in each blade, plus nodes wherever there is a component overlap
nbelem: 60 # number of blade elements in each blade, plus nodes wherever there is a component overlap
nselem: 5 # number of elements in each strut
angularOffset: -1.5707963267948966
AD15hubR: 0.1 # parameter, used in aerodyn coupling for the hub radius so that the vortex sheets don't go within the hub
turbineType: Darrieus

# AeroParameters:
adi_lib: None
adi_rootname: "/ExampleB"

# structuralParameters:
# NuMad_geom_xlscsv_file_twr: /data/NuMAD_Geom_SNL_5MW_D_TaperedTower.csv
# NuMad_mat_xlscsv_file_twr: /data/NuMAD_Materials_SNL_5MW.csv
# NuMad_geom_xlscsv_file_bld: /data/NuMAD_Geom_SNL_5MW_D_Carbon_LCDT_ThickFoils_ThinSkin.csv
# NuMad_mat_xlscsv_file_bld: /data/NuMAD_Materials_SNL_5MW.csv
# NuMad_geom_xlscsv_file_strut: /data/NuMAD_Geom_SNL_5MW_Struts.csv
# NuMad_mat_xlscsv_file_strut: /data/NuMAD_Materials_SNL_5MW.csv
OWENSOpenFASTWrappers_Options:
windINPfilename: /data/turbsim/115mx115m_30x30_20.0msETM.bts #OWENSOpenFASTWrappers If ifw or AeroDyn is being used, gets overwritten if using the DLC analysis type, the moordyn file location, like in the unit test
10 changes: 6 additions & 4 deletions examples/18_owens/owens_land.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ components:
values: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
z:
grid: *id000
values: [0, 6.607421057, 13.21484211, 19.82226317, 26.42968423, 33.03710529, 39.64452634, 46.2519474, 52.85936846, 59.46678951, 66.07421057, 72.68163163, 79.28905268, 85.89647374, 92.5038948, 99.11131586, 105.7187369, 112.326158, 118.933579, 125.5410001, 132.1484211]
values: [0, 6.607421057, 13.21484211, 19.82226317, 26.42968423, 33.03710529, 39.64452634, 46.2519474, 52.85936846, 59.46678951, 66.07421057, 72.68163163, 79.28905268, 85.89647374, 92.5038948, 99.11131586, 105.7187369, 112.326158, 118.933579, 125.5410001, 132.1484211] # The reference axis z of tower cannot be zeros, otherwise the towerse in wisdem will give errors
outer_diameter:
grid: *id000
values: [5.888066637, 5.788249614, 5.684865834, 5.577578504, 5.465996871, 5.349663569, 5.22803793, 5.100473576, 4.966187737, 4.824218239, 4.673361587, 4.512081003, 4.338364592, 4.149496455, 3.941665819, 3.70924955, 3.443362258, 3.128502234, 2.732998436, 2.169182296, 2.0]
Expand Down Expand Up @@ -51,7 +51,7 @@ components:
material: Generic_Skin
thickness:
grid: *id000
values: [0.089213, 0.087701, 0.086134, 0.084509, 0.082818, 0.081056, 0.079213, 0.07728 , 0.075245, 0.073094, 0.070809, 0.068365, 0.065733, 0.062871, 0.059722, 0.056201, 0.052172, 0.047402, 0.041409, 0.032866, 0.030303]
values: [0.008921, 0.00877 , 0.008613, 0.008451, 0.008282, 0.008106,0.007921, 0.007728, 0.007525, 0.007309, 0.007081, 0.006836, 0.006573, 0.006287, 0.005972, 0.00562 , 0.005217, 0.00474 , 0.004141, 0.003287, 0.00303 ]
# n_plies:
# grid: *id000
# values: [8.921, 8.770, 8.613, 8.451, 8.282, 8.106, 7.921, 7.728, 7.525, 7.309, 7.081, 6.836, 6.573, 6.287, 5.972, 5.620, 5.217, 4.740, 4.141, 3.287, 3.030]
Expand All @@ -72,7 +72,7 @@ components:
pitch_axis:
grid: *id001
values: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]

blade_mountpoint: 0.5
# OWENS only uses the reference axis of internal structure 2d fem but in windIO this is usually defined equal to the refenrece axis in the outer shape bem, so move the values in internal sturcture 2d fem here
reference_axis:
x: &xid001
Expand Down Expand Up @@ -326,6 +326,8 @@ components:
joint: {position: 0.0, mass: 0.0, cost: 0.0, bolt: M30, nonmaterial_cost: 0.0, reinforcement_layer_ss: joint_reinf_ss, reinforcement_layer_ps: joint_reinf_ps}
struts:
# - name: strut1
mountfraction_blade: [0.11, 0.89]
mountfraction_tower: [0.11, 0.89]
outer_shape_bem:
airfoil_position:
grid: &id002 [0, 0.33331652, 0.66668348, 1.0] # Changed to nondimensionalized
Expand Down Expand Up @@ -750,7 +752,7 @@ materials:
# m: [0.0,1.0,2.0,4.0,6.0,20.0]
- {name: resin, description: epoxy, source: Described in https://doi.org/10.5194/wes-7-19-2022, E: 1000000.0, nu: 0.3, G: 312500.0, GIc: 0.0, GIIc: 0.0, alp0: 0.0, Xt: 0.0, Xc: 0.0, S: 0.0, rho: 1150.0, alpha: 0.0, orth: 0.0, unit_cost: 3.63} # No resin in the original OWENS yaml, but WEIS requires resin for composites
- {name: Adhesive, orth: 0.0, rho: 1100.0, E: 4560000.0, G: 1450000.0, nu: 0.3, alpha: 0.0, Xt: 61510000.0, Xc: 65360000.0, S: 36610000.0, GIc: 0.0, GIIc: 0.0, alp0: 0.0, ply_t: 0.001, waste: 0.25, unit_cost: 7.23} # No adhesive in the original OWENS yaml, but WEIS requires adhesive for cost models
control:
control: # This has to be here for connection to work. Copied from IEA22
supervisory: {Vin: 0.5, Vout: 4.0, maxTS: 60}
pitch: {PC_zeta: !!null '', PC_omega: !!null '', ps_percent: !!null '', max_pitch: !!null '', max_pitch_rate: 0.1745, min_pitch: 0.00088}
torque: {control_type: !!null '', tsr: 7.64, VS_zeta: !!null '', VS_omega: !!null '', max_torque_rate: 1500000.0, VS_minspd: 0.0, VS_maxspd: 1.26711}
Expand Down
37 changes: 37 additions & 0 deletions weis/glue_code/gc_PoseOptimization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from wisdem.glue_code.gc_PoseOptimization import PoseOptimization
import numpy as np
from scipy.interpolate import PchipInterpolator

class PoseOptimizationWEIS(PoseOptimization):

Expand Down Expand Up @@ -113,6 +114,9 @@ def set_objective(self, wt_opt):

elif self.opt['merit_figure'] == 'OL2CL_pitch':
wt_opt.model.add_objective('aeroelastic.OL2CL_pitch')

elif self.opt['merit_figure'] == 'vawt_pseudolcoe':
wt_opt.model.add_objective('owens.lcoe')

else:
super(PoseOptimizationWEIS, self).set_objective(wt_opt)
Expand Down Expand Up @@ -216,6 +220,30 @@ def set_design_variables(self, wt_opt, wt_init):
upper=tmd_group['damping_ratio']['upper_bound']
)

# OWENS radius
rotor_radius_vawt_opt = self.opt["design_variables"]["blade"]["aero_shape"]["rotor_radius_vawt"]
if rotor_radius_vawt_opt["flag"]:
if rotor_radius_vawt_opt["index_end"] > rotor_radius_vawt_opt["n_opt"]:
raise Exception(
"Check the analysis options yaml, index_end of the blade radius is higher than the number of DVs n_opt"
)
elif rotor_radius_vawt_opt["index_end"] == 0:
rotor_radius_vawt_opt["index_end"] = rotor_radius_vawt_opt["n_opt"]
indices_radius = range(rotor_radius_vawt_opt["index_start"], rotor_radius_vawt_opt["index_end"])
s_opt_radius = np.linspace(0.0, 1.0, rotor_radius_vawt_opt["n_opt"])
radius_interpolator = PchipInterpolator(
wt_init["components"]["blade"]["outer_shape_bem"]["reference_axis"]["x"]["grid"],
wt_init["components"]["blade"]["outer_shape_bem"]["reference_axis"]["x"]["values"],
)
init_radius_opt = radius_interpolator(s_opt_radius)
wt_opt.model.add_design_var(
"blade.opt_var.rotor_radius_vawt",
indices=indices_radius,
lower=init_radius_opt[indices_radius] * rotor_radius_vawt_opt["max_decrease"],
upper=init_radius_opt[indices_radius] * rotor_radius_vawt_opt["max_increase"],
)


return wt_opt


Expand Down Expand Up @@ -396,6 +424,15 @@ def set_constraints(self, wt_opt):

wt_opt.model.add_constraint('aeroelastic.damage_tower_base',upper = tower_base_damage_max)

# vawt owens constraints
owens_constr = self.opt["constraints"]["owens"]
if owens_constr["SF"]["flag"]:
wt_opt.model.add_constraint("owens.SF", lower=self.opt["constraints"]["owens"]["SF"]["lower_bound"])
if owens_constr["fatigue"]["flag"]:
wt_opt.model.add_constraint("owens.fatigue_damage", upper=1.0)
if owens_constr["power"]["flag"]:
wt_opt.model.add_constraint("owens.power", lower=0.0)

return wt_opt


Expand Down
2 changes: 1 addition & 1 deletion weis/glue_code/glue_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ def setup(self):
self.connect("blade.pa.chord_param", "owens.blade_chord_values")
self.connect("blade.pa.twist_param", "owens.blade_twist_values")
self.connect("blade.outer_shape_bem.pitch_axis", "owens.blade_pitch_axis_values")
self.connect("blade.outer_shape_bem.ref_axis", "owens.blade_ref_axis")
self.connect("blade.high_level_blade_props.blade_ref_axis", "owens.blade_ref_axis")

self.connect("blade.internal_structure_2d_fem.web_start_nd", "owens.blade_web_start_nd_arc")
self.connect("blade.internal_structure_2d_fem.web_end_nd", "owens.blade_web_end_nd_arc")
Expand Down
Loading

0 comments on commit 3ca24b0

Please sign in to comment.