The Gitlab server is succesfully updated to version 14.4.0

Many users are receiving emails regarding excessive amounts of log-in attempts, which are brute-force attempts to crack your password. We are working on a 2FA solution, so no action is needed yet. If you receive emails regarding "sign-in from new location", please check the IP address and if unknown, notify frza@dtu.dk immediately.

Commit 61701e26 authored by Frederik Zahle's avatar Frederik Zahle
Browse files

small fixes

parent bdd975a5
......@@ -12,56 +12,56 @@ from openmdao.lib.datatypes.api import Float, Array, Bool, Int
class SEAMBladeStructure(Component):
Nsections = Int(iotype='in', desc='number of sections')
blade_sections = Int(iotype='in', desc='number of sections along blade')
lifetime_cycles = Float(1.e7, iotype='in', desc='Equivalent lifetime cycles')
wohler_exponent_blade_flap = Float(iotype='in', desc='Wohler exponent')
wohler_exponent_blade_flap = Float(iotype='in', desc='Blade flap fatigue Wohler exponent')
PMtarget = Float(iotype='in', desc='')
rotor_diameter = Float(iotype='in', units='m', desc='Rotor diameter')
# RootChord = Float(iotype='in', units='m', desc='')
# root_chord = Float(iotype='in', units='m', desc='')
# MaxChord = Float(iotype='in', units='m', desc='')
MaxChordrR = Float(iotype='in', units='m', desc='Spanwise position of maximum chord')
blade_root_flap_max = Float(iotype='in', units='kN*m', desc='Max blade root flap moment')
blade_root_edge_max = Float(iotype='in', units='kN*m', desc='Max blade root flap moment')
blade_root_flap_leq = Float(iotype='in', units='kN*m', desc='Blade root flap lifetime eq. moment')
blade_root_edge_leq = Float(iotype='in', units='kN*m', desc='Blade root flap lifetime eq. moment')
blade_root_flap_max = Float(iotype='in', units='kN*m', desc='Max blade root flapwise moment')
blade_root_edge_max = Float(iotype='in', units='kN*m', desc='Max blade root edgewise moment')
blade_root_flap_leq = Float(iotype='in', units='kN*m', desc='Blade root flapwise lifetime eq. moment')
blade_root_edge_leq = Float(iotype='in', units='kN*m', desc='Blade root edgewise lifetime eq. moment')
tif_blade_root_flap_ext = Float(1., iotype='in', desc='Technology improvement factor flap extreme')
tif_blade_root_edge_ext = Float(1., iotype='in', desc='Technology improvement factor edge extreme')
tif_blade_root_flat_fat = Float(1., iotype='in', desc='Technology improvement factor flap LEQ')
tif_blade_root_flap_fat = Float(1., iotype='in', desc='Technology improvement factor flap LEQ')
sc_frac_flap = Float(iotype='in', desc='spar cap fraction of chord')
sc_frac_edge = Float(iotype='in', desc='spar cap fraction of thickness')
SF_blade = Float(iotype='in', desc='')
Slim_ext_blade = Float(iotype='in', units='MPa', desc='')
Slim_fat_blade = Float(iotype='in', units='MPa', desc='')
Slim_ext_blade = Float(iotype='in', units='MPa', desc='Ultimate strength')
Slim_fat_blade = Float(iotype='in', units='MPa', desc='Fatigue strength')
AddWeightFactorBlade = Float(iotype='in', desc='Additional weight factor for blade shell')
blade_material_density = Float(iotype='in', units='kg/m**3', desc='Average density of blade materials')
blade_mass = Float(iotype = 'out', units = 'kg', desc = 'Blade mass' )
RootChord = Float(iotype = 'out', units = 'm', desc = 'blade root chord') # 07/09/2015 added for HubSE model
root_chord = Float(iotype = 'out', units = 'm', desc = 'blade root chord') # 07/09/2015 added for HubSE model
def execute(self):
volumen = 0.
r = np.linspace(0, self.rotor_diameter/2., self.Nsections)
r = np.linspace(0, self.rotor_diameter/2., self.blade_sections)
C = np.zeros(r.shape)
thick = np.zeros(r.shape)
RootChord = (self.rotor_diameter/2.)/25.
if RootChord < 1:
RootChord = 1
root_chord = (self.rotor_diameter/2.)/25.
if root_chord < 1:
root_chord = 1
MaxChord = 0.001*(self.rotor_diameter/2.)**2-0.0354*(self.rotor_diameter/2.)+1.6635 #Empirical
if MaxChord < 1.5:
RootChord = 1.5
root_chord = 1.5
self.RootChord = RootChord
self.root_chord = root_chord
for i in range(self.Nsections):
for i in range(self.blade_sections):
# Calculating the chord and thickness
if r[i] > (self.MaxChordrR*self.rotor_diameter/2.):
......@@ -81,7 +81,7 @@ class SEAMBladeStructure(Component):
C[i] = MaxChord-(MaxChord)/((self.rotor_diameter/2.) - \
self.MaxChordrR*(self.rotor_diameter/2.)) * \
(self.MaxChordrR*(self.rotor_diameter/2.)-r[i])
thick[i] = RootChord
thick[i] = root_chord
if thick[i]<0.001:
thick[i] = 0.001
......@@ -104,7 +104,7 @@ class SEAMBladeStructure(Component):
# Calculating load flapwise fatigue
Mfat_flap = (self.blade_root_flap_leq-1.75*self.blade_root_flap_leq*r/(self.rotor_diameter/2.) + \
0.75*self.blade_root_flap_leq*r/(self.rotor_diameter/2.)*r / \
(self.rotor_diameter/2.))*self.tif_blade_root_flat_fat
(self.rotor_diameter/2.))*self.tif_blade_root_flap_fat
# Calculating load edgewise fatigue
Mfat_edge = (self.blade_root_edge_leq-1.75*self.blade_root_edge_leq*r/(self.rotor_diameter/2.) + \
......@@ -116,8 +116,8 @@ class SEAMBladeStructure(Component):
self.Mfat_edge = Mfat_edge
# Calculating thickness flapwise extreme
text_flap = np.zeros(self.Nsections)
for i in range(self.Nsections):
text_flap = np.zeros(self.blade_sections)
for i in range(self.blade_sections):
norm = self.solve_text_flap(0.01, C[i], thick[i], Mext_flap[i], 1.)
res = minimize(self.solve_text_flap, 0.01, args = (C[i], thick[i], Mext_flap[i], norm), bounds=[(1.e-6, 0.5)], method = 'SLSQP', tol = 1.e-8)
text_flap[i] = res['x']
......@@ -125,25 +125,24 @@ class SEAMBladeStructure(Component):
if not res['success']: print 'WARNING enter text_flap', i,res
# Calculating thickness edgewise extreme
text_edge = np.zeros(self.Nsections)
for i in range(self.Nsections):
text_edge = np.zeros(self.blade_sections)
for i in range(self.blade_sections):
norm = self.solve_text_edge(0.01, C[i], thick[i], Mext_flap[i], 1.)
res = minimize(self.solve_text_edge, 0.01, args = (C[i], thick[i], Mext_edge[i], norm), bounds=[(1.e-6, 0.5)], method = 'SLSQP', tol = 1.e-8)
text_edge[i] = res['x']
if not res['success']: print 'WARNING solve_text_edge', i,res
# Calculating thickness flapwise fatigue
tfat_flap = np.zeros(self.Nsections)
for i in range(self.Nsections):
tfat_flap = np.zeros(self.blade_sections)
for i in range(self.blade_sections):
norm = self.solve_tfat_flap(0.01, C[i], thick[i], Mfat_flap[i], 1.)
res = minimize(self.solve_tfat_flap, 0.01, args = (C[i], thick[i], Mfat_flap[i], norm), bounds=[(1.e-6, 0.5)], method = 'SLSQP', tol = 1.e-8)
print 'norm', norm
tfat_flap[i] = res['x']
if not res['success']: print 'WARNING solve_tfat_flap', i, res
# Calculating thickness edgewise fatigue
tfat_edge = np.zeros(self.Nsections)
for i in range(self.Nsections):
tfat_edge = np.zeros(self.blade_sections)
for i in range(self.blade_sections):
norm = self.solve_tfat_edge(0.01, C[i], thick[i], Mfat_edge[i], 1.)
res = minimize(self.solve_tfat_edge, 0.01, args = (C[i], thick[i], Mfat_edge[i], norm), bounds=[(1.e-6, 0.5)], method = 'SLSQP', tol = 1.e-8)
tfat_edge[i] = res['x']
......@@ -166,29 +165,7 @@ class SEAMBladeStructure(Component):
self.volume *= self.AddWeightFactorBlade
self.blade_mass = self.blade_material_density * self.volume
print 'BladeWeigth', self.blade_mass
#
# rotor = self.blade_mass*self.BladeCostPerMass/1e6 # Meuro
# print 'rotor', rotor
# # Scaling laws for hub, spinner, pitch
# HubMass = 0.954*self.blade_mass+5680.3
# print 'HubMass', HubMass
#
# HubCost = HubMass*self.HubCostPerMass/1e6
# print 'HubCost', HubCost
#
# #PitchCost
#
# SpinnerMass = 18.5*self.rotor_diameter-520.5
# print 'SpinnerMass', SpinnerMass
#
# SpinnerCost = SpinnerMass*self.SpinnerCostPerMass/1e6
# print 'SpinnerCost', SpinnerCost
#Rotor = 3*(self.blade_mass*self.BladeCostPerMass/1e6)+HubCost+PitchCost+SpinnerCost
print 'blade mass', self.blade_mass
# Defining functions in order to solve for the thickness
......
......@@ -3,25 +3,10 @@ import numpy as np
import unittest
from SEAMRotor.SEAMRotor import SEAMBladeStructure
class SEAMRotorTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# add some tests here...
#def test_SEAMRotor(self):
#pass
if __name__ == "__main__":
# unittest.main()
def configure():
top = SEAMBladeStructure()
top.Nsections = 21
top.blade_sections = 21
top.lifetime_cycles = 1e7
top.wohler_exponent_blade_flap = 10.0
top.PMtarget = 1.0
......@@ -46,44 +31,67 @@ if __name__ == "__main__":
top.AddWeightFactorBlade = 1.2 # Additional weight factor for blade shell
top.blade_material_density = 2100. # [kg / m^3]
top.execute()
data = np.loadtxt('Rotor_outputfile.txt')
# Comparing found values for thickness with Kenneth's
datacompare_text_flap = (abs(data[:, 5]-top.text_flap))
datacompare_text_edge = (abs(data[:, 7]-top.text_edge))
datacompare_tfat_flap = (abs(data[:, 9]-top.tfat_flap))
datacompare_tfat_edge = (abs(data[:,11]-top.tfat_edge))
import matplotlib.pylab as plt
# Plot illustrating the absolute differences for the thicknesses as function of the radius
plt.figure(1)
plt.plot(top.r, datacompare_text_flap, 'o-', label = 'text_flap')
plt.plot(top.r, datacompare_text_edge, 'o-', label = 'text_edge')
plt.plot(top.r, datacompare_tfat_flap, 'o-', label = 'tfat_flap')
plt.plot(top.r, datacompare_tfat_edge, 'o-', label = 'tfat_edge')
plt.legend()
plt.title("abs differences between thickness's as function of radius")
plt.axis([0, 90, 0, 0.0003])
plt.xlabel('radius [m]')
plt.ylabel("abs difference between thickness's")
plt.grid()
plt.show()
# Plot illustrating the 4 thicknesess's as function of the radius
plt.figure(2)
plt.plot(top.r, top.text_flap, '>-', label = 'text_flap')
plt.plot(top.r, top.text_edge, '>-', label = 'text_edge')
plt.plot(top.r, top.tfat_flap, '>-', label = 'tfat_flap')
plt.plot(top.r, top.tfat_edge, '>-', label = 'tfat_edge')
plt.legend()
plt.title('Thickness\'s as function of radius')
plt.xlabel('radius [m]')
plt.ylabel('spar thickness [m]')
plt.grid()
plt.show()
return top
class SEAMRotorTestCase(unittest.TestCase):
def setUp(self):
pass
def test_mass(self):
top = configure()
top.run()
self.assertAlmostEqual(top.blade_mass, 33485.1942627, places = 6)
# add some tests here...
#def test_SEAMRotor(self):
#pass
if __name__ == "__main__":
unittest.main()
# data = np.loadtxt('Rotor_outputfile.txt')
#
# # Comparing found values for thickness with Kenneth's
# datacompare_text_flap = (abs(data[:, 5]-top.text_flap))
# datacompare_text_edge = (abs(data[:, 7]-top.text_edge))
# datacompare_tfat_flap = (abs(data[:, 9]-top.tfat_flap))
# datacompare_tfat_edge = (abs(data[:,11]-top.tfat_edge))
#
# import matplotlib.pylab as plt
#
# # Plot illustrating the absolute differences for the thicknesses as function of the radius
# plt.figure(1)
# plt.plot(top.r, datacompare_text_flap, 'o-', label = 'text_flap')
# plt.plot(top.r, datacompare_text_edge, 'o-', label = 'text_edge')
# plt.plot(top.r, datacompare_tfat_flap, 'o-', label = 'tfat_flap')
# plt.plot(top.r, datacompare_tfat_edge, 'o-', label = 'tfat_edge')
#
# plt.legend()
# plt.title("abs differences between thickness's as function of radius")
# plt.axis([0, 90, 0, 0.0003])
# plt.xlabel('radius [m]')
# plt.ylabel("abs difference between thickness's")
# plt.grid()
# plt.show()
#
# # Plot illustrating the 4 thicknesess's as function of the radius
# plt.figure(2)
# plt.plot(top.r, top.text_flap, '>-', label = 'text_flap')
# plt.plot(top.r, top.text_edge, '>-', label = 'text_edge')
# plt.plot(top.r, top.tfat_flap, '>-', label = 'tfat_flap')
# plt.plot(top.r, top.tfat_edge, '>-', label = 'tfat_edge')
#
# plt.legend()
# plt.title('Thickness\'s as function of radius')
# plt.xlabel('radius [m]')
# plt.ylabel('spar thickness [m]')
# plt.grid()
#
# plt.show()
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