Skip to content

Commit

Permalink
Squashed 'RAFT/' changes from 049117494..96936f0f3
Browse files Browse the repository at this point in the history
96936f0f3 changes to how frequencies are specified
3c3f642a9 use regular strings if no variable formatting
2a808db76 import and path cleanup
12997a02f bug fix with where potential flow wave excitation force is calculated
ed0080acc Minor edits for compatibility:
f4f5309d2 Merge remote-tracking branch 'dan/control' into rotor
4180c1e24 Adding needed yaml import
fa55d56d1 Updating spar YAMLs for rotor inputs, and minor plotting updates.
31eb63eec Merge remote-tracking branch 'upstream/rotor' into control
70625d0ba Add wind spectrum and first attempt at thrust excitation
8dac8514b Reduce ROSCO pitch gains to match thrust spectrum ground truth
b48e6c4cc Merge pull request #4 from WISDEM/omdao_gb
08cd380e4 raise error if no frequencies are listed to run
50101d1f7 Merge remote-tracking branch 'upstream/rotor' into control
e60ae4911 Merge remote-tracking branch 'upstream/dev' into control
13e48772b Merge remote-tracking branch 'upstream/rotor' into control
0989ff102 Merge branch rotor into dev
efddaa960 Added checks and handling for instability, fixed yawstiff:

git-subtree-dir: RAFT
git-subtree-split: 96936f0f3f2378e699bfca6f3f0adc5e47f24cac
  • Loading branch information
gbarter committed Jun 29, 2021
1 parent 85a60c9 commit 0cf7e82
Show file tree
Hide file tree
Showing 11 changed files with 2,620 additions and 95 deletions.
874 changes: 867 additions & 7 deletions designs/DTU10MW.yaml

Large diffs are not rendered by default.

1,024 changes: 1,018 additions & 6 deletions designs/OC3spar.yaml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions designs/VolturnUS-S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cases:
#wave_period : 10 # (peak) period (s)
#wave_height : 4 # (significant) height (m)
#wave_heading : 0 # (deg)


keys : [wind_speed, wind_heading, turbulence, turbine_status, yaw_misalign, wave_spectrum, wave_period, wave_height, wave_heading ]
data : # m/s deg % or e.g. 2B_NTM string deg string (s) (m) (deg)
Expand Down Expand Up @@ -1055,9 +1056,9 @@ turbine:


pitch_control:
GS_Angles: [0.08951732571568687, 0.11113133201402342, 0.12982917355231283, 0.1466420801733839, 0.16211366466881905, 0.17655839335287876, 0.19019635501633186, 0.2031735797715147, 0.2155988980768675, 0.22755610891787487, 0.23910432007046029, 0.25029505429019794, 0.261175108296815, 0.2717701141434908, 0.2821130743895577, 0.2922299908966622, 0.30213155066939196, 0.3118425748263288, 0.32137789704483055, 0.3307503670667345, 0.3399699865577445, 0.3490461860239008, 0.3579880322509144, 0.3668047339186282, 0.37550289814624044, 0.3840890078940221, 0.3925675520014984, 0.4009446279452681]
GS_Kp: [-1.3577105502989462, -1.2022843685437077, -1.0708549194177244, -0.9582630743745694, -0.8607297095205451, -0.7754232092569442, -0.7001800303510133, -0.6333186502486411, -0.5735124113109392, -0.5197005998242658, -0.47102498684717165, -0.42678371240552293, -0.3863972240349146, -0.3493827470593987, -0.3153348933114633, -0.2839107527034031, -0.25481830344353146, -0.22780730986914496, -0.20266210648191768, -0.17919582739515136, -0.1572457543239439, -0.13666953808436225, -0.11734210805288207, -0.09915312775509398, -0.0820048872139108, -0.06581054702303714, -0.05049266752014871, -0.035981970477687836]
GS_Ki: [-0.17894491650627248, -0.16397538879097576, -0.1513170531162574, -0.14047301946725416, -0.13107930991420289, -0.12286320368570448, -0.11561632391744817, -0.10917671849690443, -0.1034166133382032, -0.09823384815435132, -0.09354576452975885, -0.08928476437884968, -0.08539502939237623, -0.08183006219898042, -0.07855081873709882, -0.07552427238274959, -0.07272229770523143, -0.07012079381210852, -0.06769898935959591, -0.06543888677457954, -0.06332481420661495, -0.06134306161000666, -0.05948158308525387, -0.057729751819724194, -0.05607815709384934, -0.054518435162958796, -0.0530431275978591, -0.05164556201983143]
GS_Angles: [0.06019804, 0.08713416, 0.10844806, 0.12685912, 0.14339822, 0.1586021 , 0.17279614, 0.18618935, 0.19892772, 0.21111989, 0.22285021, 0.23417256, 0.2451469 , 0.25580691, 0.26619545, 0.27632495, 0.28623134, 0.29593266, 0.30544521, 0.314779 , 0.32395154, 0.33297489, 0.3418577 , 0.35060844, 0.35923641, 0.36774807, 0.37614942, 0.38444655, 0.39264363, 0.40074407]
GS_Kp: [-0.9394215 , -0.80602855, -0.69555026, -0.60254912, -0.52318192, -0.45465531, -0.39489024, -0.34230736, -0.29568537, -0.25406506, -0.2166825 , -0.18292183, -0.15228099, -0.12434663, -0.09877533, -0.0752794 , -0.05361604, -0.0335789 , -0.01499149, 0.00229803, 0.01842102, 0.03349169, 0.0476098 , 0.0608629 , 0.07332812, 0.0850737 , 0.0961602 , 0.10664158, 0.11656607, 0.12597691]
GS_Ki: [-0.07416547, -0.06719673, -0.0614251 , -0.05656651, -0.0524202 , -0.04884022, -0.04571796, -0.04297091, -0.04053528, -0.03836094, -0.03640799, -0.03464426, -0.03304352, -0.03158417, -0.03024826, -0.02902079, -0.02788904, -0.02684226, -0.02587121, -0.02496797, -0.02412567, -0.02333834, -0.02260078, -0.02190841, -0.0212572 , -0.02064359, -0.0200644 , -0.01951683, -0.01899836, -0.01850671]
Fl_Kp: -9.35
wt_ops:
v: [3.0, 3.266896551724138, 3.533793103448276, 3.800689655172414, 4.067586206896552, 4.334482758620689, 4.601379310344828, 4.868275862068966, 5.135172413793104, 5.402068965517241, 5.6689655172413795, 5.935862068965518, 6.2027586206896554, 6.469655172413793, 6.736551724137931, 7.00344827586207, 7.270344827586207, 7.537241379310345, 7.804137931034483, 8.071034482758622, 8.337931034482759, 8.604827586206897, 8.871724137931036, 9.138620689655173, 9.405517241379311, 9.672413793103448, 9.939310344827586, 10.206206896551725, 10.473103448275863, 10.74, 11.231724137931035, 11.723448275862069, 12.215172413793104, 12.706896551724139, 13.198620689655172, 13.690344827586207, 14.182068965517242, 14.673793103448276, 15.16551724137931, 15.657241379310346, 16.14896551724138, 16.640689655172416, 17.13241379310345, 17.624137931034483, 18.11586206896552, 18.607586206896553, 19.099310344827586, 19.591034482758623, 20.082758620689653, 20.57448275862069, 21.066206896551726, 21.557931034482756, 22.049655172413793, 22.54137931034483, 23.03310344827586, 23.524827586206897, 24.016551724137933, 24.508275862068963, 25.0]
Expand Down
5 changes: 2 additions & 3 deletions raft/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def convertIEAturbineYAML2RAFT(fname_turbine):
Rhub = 0.5 * wt_init["components"]["hub"]["diameter"] # [m] - hub radius
d['precone'] = np.rad2deg(wt_init["components"]["hub"]["cone_angle"]) # [deg] - rotor precone angle
d['shaft_tilt'] = np.rad2deg(wt_init["components"]["nacelle"]["drivetrain"]["uptilt"]) # [deg] - nacelle uptilt angle
d['overhang'] = np.rad2deg(wt_init["components"]["nacelle"]["drivetrain"]["overhang"]) # [m] - distance from tower centerline to blade root location?
d['overhang'] = wt_init["components"]["nacelle"]["drivetrain"]["overhang"] # [m] - distance from tower centerline to blade root location?
d['nBlades'] = wt_init["assembly"]["number_of_blades"] # [-] - number of blades

# Set discretization parameters
Expand Down Expand Up @@ -600,7 +600,7 @@ def convertIEAturbineYAML2RAFT(fname_turbine):
outfile.write(f" Zhub : {d['Zhub']} # hub height [m]\n")
outfile.write(f" Rhub : {d['Rhub']} # hub radius [m]\n")
outfile.write(f" precone : {d['precone']} # [rad]\n")
outfile.write(f" shaft_tilt : {d['shaft_tilt']} # [rad]\n\n")
outfile.write(f" shaft_tilt : {d['shaft_tilt']} # [rad]\n")
outfile.write(f" overhang : {d['overhang']} # [m]\n\n")
outfile.write(f" env: \n")
outfile.write(f" rho : {d['env']['rho']} # air density [kg/m^3]\n")
Expand All @@ -612,7 +612,6 @@ def convertIEAturbineYAML2RAFT(fname_turbine):
outfile.write(f" presweepTip : {d['blade']['presweepTip']} # \n")
outfile.write(f" Rtip : {d['blade']['Rtip']} # rotor radius\n\n")

outfile.write(f"\n")
outfile.write(f" geometry: # r chord theta precurve presweep\n")
outfile.write(f" # (m) (m) (deg) (m) (m)\n")
for i in range(len(d['blade']['r'])):
Expand Down
18 changes: 9 additions & 9 deletions raft/member2pnl.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,23 @@ def writeMesh(savedNodes, savedPanels, oDir=""):
if osp.isdir(oDir) is not True:
os.makedirs(oDir)

oFilePath = os.path.join(oDir, f'HullMesh.pnl')
oFilePath = os.path.join(oDir, 'HullMesh.pnl')

oFile = open(oFilePath, 'w')
oFile.write(f' --------------Hull Mesh File---------------\n\n')
oFile.write(f' # Number of Panels, Nodes, X-Symmetry and Y-Symmetry\n')
oFile.write(' --------------Hull Mesh File---------------\n\n')
oFile.write(' # Number of Panels, Nodes, X-Symmetry and Y-Symmetry\n')
oFile.write(f' {numPanels} {numNodes} 0 0\n\n')

oFile.write(f' #Start Definition of Node Coordinates ! node_number x y z\n')
oFile.write(' #Start Definition of Node Coordinates ! node_number x y z\n')
for i in range(numNodes):
oFile.write(f'{i+1:>5}{savedNodes[i][0]:18.3f}{savedNodes[i][1]:18.3f}{savedNodes[i][2]:18.3f}\n')
oFile.write(f' #End Definition of Node Coordinates\n\n')
oFile.write(' #End Definition of Node Coordinates\n\n')

oFile.write(f' #Start Definition of Node Relations ! panel_number number_of_vertices Vertex1_ID Vertex2_ID Vertex3_ID (Vertex4_ID)\n')
oFile.write(' #Start Definition of Node Relations ! panel_number number_of_vertices Vertex1_ID Vertex2_ID Vertex3_ID (Vertex4_ID)\n')
for i in range(numPanels):
oFile.write(''.join([f'{p:>8}' for p in savedPanels[i]])+'\n')
oFile.write(f' #End Definition of Node Relations\n\n')
oFile.write(f' --------------End Hull Mesh File---------------\n')
oFile.write(' #End Definition of Node Relations\n\n')
oFile.write(' --------------End Hull Mesh File---------------\n')

oFile.close()

Expand Down Expand Up @@ -524,4 +524,4 @@ def writeMeshToGDF(vertices, filename="platform.gdf", aboveWater=True):
#writeMesh(nodes, panels)

vertices = meshMemberForGDF(stations, diameters, rA, rB, dz_max=5, da_max=5)
writeMeshToGDF(vertices)
writeMeshToGDF(vertices)
7 changes: 2 additions & 5 deletions raft/omdao_raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ def setup(self):
nline_types = mooring_opt['nline_types']
nconnections = mooring_opt['nconnections']

# frequency domain
self.add_input('frequency_range', val=np.zeros(nfreq), units='Hz', desc='Frequency range to compute response over')

# turbine inputs
self.add_input('turbine_mRNA', val=0.0, units='kg', desc='RNA mass')
self.add_input('turbine_IxRNA', val=0.0, units='kg*m**2', desc='RNA moment of inertia about local x axis')
Expand Down Expand Up @@ -300,8 +297,8 @@ def compute(self, inputs, outputs, discrete_inputs, discrete_outputs):
design['settings'] = {}
design['settings']['XiStart'] = float(modeling_opt['XiStart'])
design['settings']['dlsMax'] = float(modeling_opt['dlsMax'])
design['settings']['min_freq'] = float(inputs['frequency_range'][0])
design['settings']['max_freq'] = float(inputs['frequency_range'][-1])
design['settings']['min_freq'] = float(modeling_opt['min_freq'])
design['settings']['max_freq'] = float(modeling_opt['max_freq'])

# Environment layer data
design['site'] = {}
Expand Down
Loading

0 comments on commit 0cf7e82

Please sign in to comment.