Skip to content

Commit

Permalink
Merge pull request #182 from IEAWindTask37/develop
Browse files Browse the repository at this point in the history
ROSCO v2.9, fix mooring diameter to be "volume equivalent"
  • Loading branch information
gbarter authored Feb 7, 2024
2 parents 94efa50 + 2b9701d commit f09558d
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 132 deletions.
131 changes: 78 additions & 53 deletions OpenFAST/IEA-15-240-RWT-Monopile/IEA-15-240-RWT-Monopile_DISCON.IN

Large diffs are not rendered by default.

131 changes: 78 additions & 53 deletions OpenFAST/IEA-15-240-RWT-UMaineSemi/IEA-15-240-RWT-UMaineSemi_DISCON.IN

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions OpenFAST/IEA-15-240-RWT/ServoData/update_libdiscon_extension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import glob
import os
from rosco import discon_lib_path

if __name__ == "__main__":
this_dir = os.path.dirname(os.path.abspath(__file__))
servo_list = glob.glob(os.path.join(this_dir, '../../*/*Servo*.dat'))

for ifile in servo_list:
# Read in current ServoDyn file
with open(ifile, "r") as f:
lines = f.readlines()

# Write correction
with open(ifile, "w") as f:
for line in lines:
if line.find("DLL_FileName") >= 0:
f.write(f"\"{discon_lib_path}\" DLL_FileName - Name/location of the dynamic library (.dll [Windows] or .so [Linux]) in the Bladed-DLL format (-) [used only with Bladed Interface]\n")
else:
f.write(line)

2 changes: 1 addition & 1 deletion OpenFAST/IEA-15-240-RWT/ServoData/update_rosco_discons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''
import os
from ROSCO_toolbox.ofTools.fast_io.update_discons import update_discons
from rosco.toolbox.ofTools.fast_io.update_discons import update_discons


if __name__=="__main__":
Expand Down
30 changes: 11 additions & 19 deletions WISDEM/generateTables.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import os
try:
import ruamel.yaml as yaml
except:
try:
import ruamel_yaml as yaml
except:
raise ImportError('No YAML package found')
import pandas as pd
import csv
import numpy as np
Expand All @@ -15,6 +8,7 @@
import matplotlib.cm as cm
from matplotlib.patches import Rectangle
from scipy.interpolate import interp1d
from wisdem.inputs.validation import load_yaml

def find_nearest(array, value):
return (np.abs(array - value)).argmin()
Expand Down Expand Up @@ -86,9 +80,7 @@ class RWT_Tabular(object):
def __init__(self, finput, towDF=None, rotDF=None, layerDF=None, nacDF=None, overview=None):

# Read ontology file into dictionary-like data structure
f = open(finput, 'r')
self.yaml = yaml.safe_load( f )
f.close()
self.yaml = load_yaml( finput )

# Store output file name
folder_output = os.getcwd() + os.sep + 'outputs'
Expand Down Expand Up @@ -335,16 +327,18 @@ def write_blade_inner(self):
weblist.append( self.yaml['components']['blade']['internal_structure_2d_fem']['webs'][k][ikey] )
elif ikey == 'material':
matlist.append( self.yaml['components']['blade']['internal_structure_2d_fem']['webs'][k][ikey] )
else:
elif ikey == 'offset_plane':
mygrid = np.r_[mygrid, self.yaml['components']['blade']['internal_structure_2d_fem']['webs'][k][ikey]['offset']['grid']]
elif 'grid' in self.yaml['components']['blade']['internal_structure_2d_fem']['webs'][k][ikey]:
mygrid = np.r_[mygrid, self.yaml['components']['blade']['internal_structure_2d_fem']['webs'][k][ikey]['grid']]

for k in range(nlay):
for ikey in self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k].keys():
if ikey in ['name', 'midpoint_nd_arc','start_nd_arc','end_nd_arc','side','web']:
continue
elif ikey == 'material':
if ikey == 'material':
matlist.append( self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k][ikey] )
else:
elif ikey == 'offset_plane':
mygrid = np.r_[mygrid, self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k][ikey]['offset']['grid']]
elif 'grid' in self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k][ikey]:
mygrid = np.r_[mygrid, self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k][ikey]['grid']]
mygrid = np.unique( mygrid )

Expand Down Expand Up @@ -522,7 +516,7 @@ def myinterp(xgrid, val):
sparcap_ps_wid = self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['width']['values']
sparcap_ps_beg = self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['start_nd_arc']['values']
sparcap_ps_end = self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['end_nd_arc']['values']
elif self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['name'] == 'LE_reinforcement':
elif self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['name'].lower() == 'le_reinforcement':
reinf_le_thgrid = self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['thickness']['grid']
reinf_le_th = self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['thickness']['values']
reinf_le_wgrid = self.yaml['components']['blade']['internal_structure_2d_fem']['layers'][k]['width']['grid']
Expand Down Expand Up @@ -832,9 +826,7 @@ def write_rotor_performance(self):
# Use OpenFAST output if it is available
foutput = '..'+os.sep+'OpenFAST'+os.sep+'outputs'+os.sep+'IEA-15-240-RWT_steady.yaml'
if os.path.exists(foutput):
f = open(foutput, 'r')
fastout = yaml.safe_load( f )
f.close()
fastout = load_yaml(foutput)

rotmat = np.c_[fastout['Wind1VelX']['mean'],
fastout['BldPitch1']['mean'],
Expand Down
8 changes: 4 additions & 4 deletions WISDEM/run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def run_15mw(fname_wt_input):
# 'MoI_cm_xx', 'MoI_cm_yy', 'MoI_cm_zz', 'MoI_cm_xy', 'MoI_cm_xz', 'MoI_cm_yz',
# 'MoI_TT_xx', 'MoI_TT_yy', 'MoI_TT_zz', 'MoI_TT_xy', 'MoI_TT_xz', 'MoI_TT_yz']
nacDF = prob.model.wt.drivese.nac._mass_table
hub_cm = float(prob["drivese.hub_system_cm"])
L_drive = float(prob["drivese.L_drive"])
tilt = float(prob.get_val('nacelle.uptilt', 'rad'))
hub_cm = prob["drivese.hub_system_cm"][0]
L_drive = prob["drivese.L_drive"][0]
tilt = prob.get_val('nacelle.uptilt', 'rad')[0]
shaft0 = prob["drivese.shaft_start"]
Cup = -1.0
hub_cm = R = shaft0 + (L_drive + hub_cm) * np.array([Cup * np.cos(tilt), 0.0, np.sin(tilt)])
Expand Down Expand Up @@ -286,7 +286,7 @@ def run_15mw(fname_wt_input):
overview['Tower top to hub flange height [m]'] = prob['nacelle.distance_tt_hub']
overview['Generator rated efficiency [%]'] = prob['rotorse.rp.powercurve.rated_efficiency']
overview['Blade pre-bend [m]'] = prob['blade.outer_shape_bem.ref_axis'][-1,0]
overview['Blade mass [t]'] = 1e-3*prob['rotorse.re.precomp.blade_mass']
overview['Blade mass [t]'] = 1e-3*prob['rotorse.blade_mass']
overview['Hub mass [t]'] = 1e-3*prob['drivese.hub_mass']
overview['Generator mass [t]'] = 1e-3*prob['drivese.generator_mass']
overview['Nacelle mass [t]'] = 1e-3*prob['drivese.nacelle_mass']
Expand Down
2 changes: 1 addition & 1 deletion WT_Ontology/IEA-15-240-RWT_VolturnUS-S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ components:

line_types:
- name: main
diameter: 0.185
diameter: 0.333 # volume-equivalent
type: chain
transverse_added_mass: 1.0
tangential_added_mass: 0.0
Expand Down
3 changes: 2 additions & 1 deletion tests/environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: test


channels:
- conda-forge
- defaults
Expand Down Expand Up @@ -29,7 +30,7 @@ dependencies:
- psutil
- pbr
- pytables
- rosco ==2.8.0
- rosco ==2.9.0
- sshtunnel
- simpy
- tomli
Expand Down

0 comments on commit f09558d

Please sign in to comment.