Skip to content

Commit

Permalink
Merge branch 'IEAontology4all' into yaml_gui
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Aug 22, 2020
2 parents f15e72f + 34e5698 commit c7ba7cb
Show file tree
Hide file tree
Showing 12 changed files with 590 additions and 58 deletions.
4 changes: 2 additions & 2 deletions wisdem/commonse/turbine_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class TurbineClass(om.ExplicitComponent):
V_mean : float, [m/s]
IEC mean wind speed for Rayleigh distribution
V_extreme1 : float, [m/s]
IEC extreme wind speed at hub height for a 1-year retunr period
IEC extreme wind speed at hub height for a 1-year return period
V_extreme50 : float, [m/s]
IEC extreme wind speed at hub height for a 50-year retunr period
IEC extreme wind speed at hub height for a 50-year return period
"""
def setup(self):
Expand Down
6 changes: 3 additions & 3 deletions wisdem/glue_code/gc_LoadInputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def set_openmdao_vectors(self):
exit('A distributed aerodynamic control device is provided in the yaml input file, but not supported by wisdem.')

# Tower
if self.modeling_options['flags']['tower']:
if self.modeling_options['Analysis_Flags']['TowerSE']:
self.modeling_options['tower']['n_height'] = len(self.wt_init['components']['tower']['outer_shape_bem']['outer_diameter']['grid'])
self.modeling_options['tower']['n_layers'] = len(self.wt_init['components']['tower']['internal_structure_2d_fem']['layers'])

Expand Down Expand Up @@ -352,9 +352,9 @@ def write_ontology(self, wt_opt, fname_output):
self.wt_init['components']['nacelle']['elastic_properties_mb']['center_mass'] = wt_opt['drivese.nacelle_cm'].tolist()
self.wt_init['components']['nacelle']['elastic_properties_mb']['inertia'] = wt_opt['drivese.nacelle_I'].tolist()

#if self.modeling_options['flags']['tower']:
#if self.modeling_options['Analysis_Flags']['TowerSE']:
# Update tower
if self.modeling_options['flags']['tower']:
if self.modeling_options['Analysis_Flags']['TowerSE']:
self.wt_init['components']['tower']['outer_shape_bem']['outer_diameter']['grid'] = wt_opt['tower.s'].tolist()
self.wt_init['components']['tower']['outer_shape_bem']['outer_diameter']['values'] = wt_opt['tower.diameter'].tolist()
self.wt_init['components']['tower']['outer_shape_bem']['reference_axis']['x']['grid'] = wt_opt['tower.s'].tolist()
Expand Down
6 changes: 3 additions & 3 deletions wisdem/glue_code/gc_WT_DataStruc.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def setup(self):
self.add_subsystem('nacelle', nacelle)

# Tower inputs
if modeling_options['flags']['tower']:
if modeling_options['Analysis_Flags']['TowerSE']:
self.add_subsystem('tower', Tower(tower_init_options = modeling_options['tower']))

if modeling_options['flags']['monopile']:
Expand Down Expand Up @@ -152,7 +152,7 @@ def setup(self):
env_ivc.add_output('G_soil', val=140e6, units='N/m**2', desc='Shear stress of soil')
env_ivc.add_output('nu_soil', val=0.4, desc='Poisson ratio of soil')

if modeling_options['flags']['bos']:
if modeling_options['Analysis_Flags']['BOS']:
bos_ivc = self.add_subsystem('bos', om.IndepVarComp())
bos_ivc.add_output('plant_turbine_spacing', 7, desc='Distance between turbines in rotor diameters')
bos_ivc.add_output('plant_row_spacing', 7, desc='Distance between turbine rows in rotor diameters')
Expand Down Expand Up @@ -191,7 +191,7 @@ def setup(self):
self.connect('blade.outer_shape_bem.ref_axis', 'assembly.blade_ref_axis')
if modeling_options['flags']['hub']:
self.connect('hub.radius', 'assembly.hub_radius')
if modeling_options['flags']['tower']:
if modeling_options['Analysis_Flags']['TowerSE']:
self.connect('tower.height', 'assembly.tower_height')
if modeling_options['flags']['foundation']:
self.connect('foundation.height', 'assembly.foundation_height')
Expand Down
27 changes: 3 additions & 24 deletions wisdem/glue_code/gc_WT_InitModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from wisdem.commonse.utilities import arc_length
from wisdem.commonse.csystem import DirectionVector


def yaml2openmdao(wt_opt, modeling_options, wt_init):
# Function to assign values to the openmdao group Wind_Turbine and all its components

Expand All @@ -17,8 +18,6 @@ def yaml2openmdao(wt_opt, modeling_options, wt_init):
if modeling_options['flags']['environment']:
environment = wt_init['environment']
wt_opt = assign_environment_values(wt_opt, environment, modeling_options['offshore'])
else:
environment = {}

if modeling_options['flags']['blade']:
blade = wt_init['components']['blade']
Expand All @@ -29,67 +28,47 @@ def yaml2openmdao(wt_opt, modeling_options, wt_init):
if modeling_options['flags']['airfoils']:
airfoils = wt_init['airfoils']
wt_opt = assign_airfoil_values(wt_opt, modeling_options, airfoils)
else:
airfoils = {}

if modeling_options['flags']['control']:
control = wt_init['control']
wt_opt = assign_control_values(wt_opt, modeling_options, control)
else:
control = {}

if modeling_options['flags']['hub']:
hub = wt_init['components']['hub']
wt_opt = assign_hub_values(wt_opt, hub)
else:
hub = {}

if modeling_options['flags']['nacelle']:
nacelle = wt_init['components']['nacelle']
wt_opt = assign_nacelle_values(wt_opt, assembly, nacelle)
else:
nacelle = {}

if modeling_options['flags']['RNA']:
RNA = wt_init['components']['RNA']
else:
RNA = {}

if modeling_options['flags']['tower']:
if modeling_options['Analysis_Flags']['TowerSE']:
tower = wt_init['components']['tower']
wt_opt = assign_tower_values(wt_opt, modeling_options, tower)
else:
tower = {}

if modeling_options['flags']['monopile']:
monopile = wt_init['components']['monopile']
wt_opt = assign_monopile_values(wt_opt, modeling_options, monopile)
else:
monopile = {}

if modeling_options['flags']['floating']:
floating = wt_init['components']['floating']
wt_opt = assign_floating_values(wt_opt, modeling_options, floating)
else:
floating = {}

if modeling_options['flags']['foundation']:
foundation = wt_init['components']['foundation']
wt_opt = assign_foundation_values(wt_opt, foundation)
else:
foundation = {}

if modeling_options['flags']['bos']:
if modeling_options['Analysis_Flags']['BOS']:
bos = wt_init['bos']
wt_opt = assign_bos_values(wt_opt, bos, modeling_options['offshore'])
else:
costs = {}

if modeling_options['flags']['costs']:
costs = wt_init['costs']
wt_opt = assign_costs_values(wt_opt, costs)
else:
costs = {}

if 'elastic_properties_mb' in blade.keys() and modeling_options['Analysis_Flags']['DriveSE']:
wt_opt = assign_RNA_values(wt_opt, modeling_options, blade, RNA)
Expand Down

0 comments on commit c7ba7cb

Please sign in to comment.