Commit 90981f03 authored by Frederik Zahle's avatar Frederik Zahle
Browse files

variables renamed

parent 6fe0bc4c
......@@ -15,23 +15,23 @@ class SEAMBladeStructure(Component):
super(SEAMBladeStructure, self).__init__()
self.add_param('Nsections', 21, desc='number of sections')
self.add_param('Neq', 1.e7, desc='')
self.add_param('lifetime_cycles', 1.e7, desc='')
self.add_param('WohlerExpFlap', 10.0, desc='')
self.add_param('PMtarget', 1.0, desc='')
self.add_param('wohler_exponent_blade_flap', 10.0, desc='')
self.add_param('rotor_diameter', 177., units='m', desc='Rotor diameter')
self.add_param('MaxChordrR', 0.2, units='m', desc='Spanwise position of maximum chord')
self.add_param('overallMaxFlap', 47225., desc='Max blade root flap moment')
self.add_param('overallMaxEdge', 26712., desc='Max blade root edge moment')
self.add_param('blade_root_flap_max', 47225., units='kN*m', desc='Max blade root flap moment')
self.add_param('blade_root_flap_leq', 26975., units='kN*m', desc='Blade root flap lifetime eq. moment')
self.add_param('blade_root_edge_max', 26712., units='kN*m', desc='Max blade root edge moment')
self.add_param('blade_root_edge_leq', 24252., units='kN*m', desc='Blade root edge lifetime eq. moment')
self.add_param('TIF_FLext', 1., desc='Technology improvement factor flap extreme')
self.add_param('TIF_EDext', 1., desc='Technology improvement factor edge extreme')
self.add_param('TIF_FLfat', 1., desc='Technology improvement factor flap LEQ')
self.add_param('FlapLEQ', 26975., desc='Blade root flap lifetime eq. moment')
self.add_param('EdgeLEQ', 24252., desc='Blade root edge lifetime eq. moment')
self.add_param('TIF_FLfat', 1., desc='Technology improvement factor FlapLEQ')
self.add_param('PMtarget', 1.0, desc='')
self.add_param('sc_frac_flap', 0.3, desc='spar cap fraction of chord')
self.add_param('sc_frac_edge', 0.8, desc='spar cap fraction of thickness')
......@@ -40,10 +40,10 @@ class SEAMBladeStructure(Component):
self.add_param('Slim_fat_blade', 27, units='MPa', desc='')
self.add_param('AddWeightFactorBlade', 1.2, desc='Additional weight factor for blade shell')
self.add_param('BladeDens', 2100., units='kg/m**3', desc='density of blades')
self.add_param('blade_density', 2100., units='kg/m**3', desc='density of blades')
self.add_output('BladeWeight', 15.0, units='kg', desc='BladeMass' )
self.add_output('RootChord', 3.5, units='m', desc='blade root chord')
self.add_output('blade_mass', 15.0, units='kg', desc='Blade mass' )
self.add_output('root_chord', 3.5, units='m', desc='blade root chord')
def solve_nonlinear(self, params, unknowns, resids):
......@@ -69,7 +69,7 @@ class SEAMBladeStructure(Component):
Ine = (2/3.)* params['sc_frac_flap']*C*t**3- params['sc_frac_flap']*C*thick*t**2+ params['sc_frac_flap']*C*thick**2/2.*t
W = Ine/(thick/2.)
sfat = np.maximum(1.e-6, params['SF_blade']*1.e3*Mfat_flap/ W / 1.e6)
PM = params['Neq']/(pow(10, ( params['Slim_fat_blade'] - params['WohlerExpFlap']*np.log10(sfat))))
PM = params['lifetime_cycles']/(pow(10, ( params['Slim_fat_blade'] - params['wohler_exponent_blade_flap']*np.log10(sfat))))
return abs(PM - params['PMtarget']) / norm
# Solving for t in edge direction, fatigue
......@@ -77,21 +77,21 @@ class SEAMBladeStructure(Component):
Ine = (2/3.)* params['sc_frac_edge']*thick*t**3- params['sc_frac_edge']*thick*C*t**2+ params['sc_frac_edge']*thick*C**2/2.*t
W = Ine/(C/2.)
sfat = np.maximum(1.e-6, params['SF_blade']*1.e3*Mfat_edge/W/1.e6)
PM = params['Neq']/(pow(10, ( params['Slim_fat_blade'] - params['WohlerExpFlap']*np.log10(sfat))))
PM = params['lifetime_cycles']/(pow(10, ( params['Slim_fat_blade'] - params['wohler_exponent_blade_flap']*np.log10(sfat))))
return abs(PM - params['PMtarget']) / norm
r = np.linspace(0, rotor_radius, params['Nsections'])
C = np.zeros(r.shape)
thick = np.zeros(r.shape)
RootChord = rotor_radius/25.
if RootChord < 1:
RootChord = 1
root_chord = rotor_radius/25.
if root_chord < 1:
root_chord = 1
MaxChord = 0.001*rotor_radius**2-0.0354*rotor_radius+1.6635 #Empirical
if MaxChord < 1.5:
RootChord = 1.5
root_chord = 1.5
unknowns['RootChord'] = RootChord
unknowns['root_chord'] = root_chord
for i in range(params['Nsections']):
......@@ -113,7 +113,7 @@ class SEAMBladeStructure(Component):
C[i] = MaxChord-(MaxChord)/(rotor_radius - \
params['MaxChordrR']*rotor_radius) * \
(params['MaxChordrR']*rotor_radius-r[i])
thick[i] = RootChord
thick[i] = root_chord
if thick[i]<0.001:
thick[i] = 0.001
......@@ -126,30 +126,30 @@ class SEAMBladeStructure(Component):
# Calculating load flapwise extreme
Mext_flap = (
params['overallMaxFlap']
- 1.75 * params['overallMaxFlap'] * r / rotor_radius
+ 0.75 * params['overallMaxFlap'] * (r / rotor_radius)**2.
params['blade_root_flap_max']
- 1.75 * params['blade_root_flap_max'] * r / rotor_radius
+ 0.75 * params['blade_root_flap_max'] * (r / rotor_radius)**2.
) * params['TIF_FLext']
# Calculating load edgewise extreme
Mext_edge = (
params['overallMaxEdge']
- 1.75 * params['overallMaxEdge'] * r / rotor_radius
+ 0.75*params['overallMaxEdge']* (r / rotor_radius)**2.
params['blade_root_edge_max']
- 1.75 * params['blade_root_edge_max'] * r / rotor_radius
+ 0.75*params['blade_root_edge_max']* (r / rotor_radius)**2.
) * params['TIF_EDext']
# Calculating load flapwise fatigue
Mfat_flap = (
params['FlapLEQ']
- 1.75 * params['FlapLEQ'] * r/rotor_radius +
0.75 * params['FlapLEQ'] * (r/rotor_radius)**2.
params['blade_root_flap_leq']
- 1.75 * params['blade_root_flap_leq'] * r/rotor_radius +
0.75 * params['blade_root_flap_leq'] * (r/rotor_radius)**2.
) * params['TIF_FLfat']
# Calculating load edgewise fatigue
Mfat_edge = (
params['EdgeLEQ']
- 1.75 * params['EdgeLEQ'] * r/rotor_radius +
0.75 * params['EdgeLEQ'] * (r/rotor_radius)**2.
params['blade_root_edge_leq']
- 1.75 * params['blade_root_edge_leq'] * r/rotor_radius +
0.75 * params['blade_root_edge_leq'] * (r/rotor_radius)**2.
) * params['TIF_EDext']
self.Mext_flap = Mext_flap
......@@ -205,9 +205,9 @@ class SEAMBladeStructure(Component):
self.volume = np.trapz(2 * (params['sc_frac_flap'] * C * tfinal_flap +
params['sc_frac_edge'] * thick * tfinal_edge), r)
self.volume *= params['AddWeightFactorBlade']
unknowns['BladeWeight'] = params['BladeDens'] * self.volume
unknowns['blade_mass'] = params['blade_density'] * self.volume
print('BladeWeigth', unknowns['BladeWeight'])
print('blade_mass', unknowns['blade_mass'])
#
# rotor = self.BladeWeight*self.BladeCostPerMass/1e6 # Meuro
# print('rotor', rotor)
......
import unittest
import numpy as np
from openmdao.core import Group, Problem
from seamrotor import SEAMBladeStructure
__author__ = 'pire'
from seamrotor.seamrotor import SEAMBladeStructure
# __author__ = 'pire'
class TestSEAMBladeStructure(unittest.TestCase):
def test_BladeWeight(self):
def setup_prob():
top = Problem(root=Group())
blade = top.root.add('blade', SEAMBladeStructure(), promotes=['*'])
top.setup()
blade.params['Nsections'] = 21
blade.params['Neq'] = 1e7
blade.params['WohlerExpFlap'] = 10.0
blade.params['lifetime_cycles'] = 1e7
blade.params['wohler_exponent_blade_flap'] = 10.0
blade.params['PMtarget'] = 1.0
blade.params['rotor_diameter'] = 177. #[m]
......@@ -23,13 +24,13 @@ class TestSEAMBladeStructure(unittest.TestCase):
# blade.params['MaxChord'] = 2.5 #[m]
blade.params['MaxChordrR'] = 0.2 #[m]
blade.params['overallMaxFlap'] = 47225.
blade.params['overallMaxEdge'] = 26712.
blade.params['blade_root_flap_max'] = 47225.
blade.params['blade_root_edge_max'] = 26712.
blade.params['TIF_FLext'] = 1. # Tech Impr Factor _ flap extreme
blade.params['TIF_EDext'] = 1.
blade.params['FlapLEQ'] = 26975.
blade.params['EdgeLEQ'] = 24252.
blade.params['blade_root_flap_leq'] = 26975.
blade.params['blade_root_edge_leq'] = 24252.
blade.params['TIF_FLfat'] = 1.
blade.params['sc_frac_flap'] = 0.3 # sparcap fraction of chord flap
......@@ -40,17 +41,23 @@ class TestSEAMBladeStructure(unittest.TestCase):
blade.params['Slim_fat_blade'] = 27
blade.params['AddWeightFactorBlade'] = 1.2 # Additional weight factor for blade shell
blade.params['BladeDens'] = 2100. # [kg / m^3]
blade.params['blade_density'] = 2100. # [kg / m^3]
#blade.params['BladeCostPerMass'] = 15.0 #[e/kg]
#blade.params['HubCostPerMass'] = 3.5 #[e/kg]
#blade.params['SpinnerCostPerMass'] = 4.5 #[e/kg]
return top
class TestSEAMBladeStructure(unittest.TestCase):
def test_BladeWeight(self):
top = setup_prob()
top.run()
self.assertAlmostEqual(blade.unknowns['BladeWeight'], 30876.6559)
self.assertAlmostEqual(blade.unknowns['BladeWeight'], 30876.655915672229)
if __name__ == "__main__":
unittest.main()
# unittest.main()
top = setup_prob()
top.run()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment