From 051cabbe2b2ea6d9d74c6e24e604f76eb29c9619 Mon Sep 17 00:00:00 2001 From: Fern Carrera Date: Fri, 31 May 2019 14:22:23 -0700 Subject: [PATCH] Added files --- .../__pycache__/cruise_comp.cpython-36.pyc | Bin 0 -> 1342 bytes .../__pycache__/range_comp.cpython-36.pyc | Bin 0 -> 1254 bytes .../thrust_weight_comp.cpython-36.pyc | Bin 0 -> 1614 bytes .../weight_buildup_comp.cpython-36.pyc | Bin 0 -> 2128 bytes Model/Weight/thrust_weight_comp.py | 32 +++++++ Model/Weight/weight_buildup_comp.py | 74 ++++++++++++++++ Model/costanalysis/CostBuildup.py | 80 ++++++++++++++++++ Model/costanalysis/ToolingCost.py | 61 +++++++++++++ 8 files changed, 247 insertions(+) create mode 100644 Model/Propulsion/__pycache__/cruise_comp.cpython-36.pyc create mode 100644 Model/Propulsion/__pycache__/range_comp.cpython-36.pyc create mode 100644 Model/Weight/__pycache__/thrust_weight_comp.cpython-36.pyc create mode 100644 Model/Weight/__pycache__/weight_buildup_comp.cpython-36.pyc create mode 100644 Model/Weight/thrust_weight_comp.py create mode 100644 Model/Weight/weight_buildup_comp.py create mode 100644 Model/costanalysis/CostBuildup.py create mode 100644 Model/costanalysis/ToolingCost.py diff --git a/Model/Propulsion/__pycache__/cruise_comp.cpython-36.pyc b/Model/Propulsion/__pycache__/cruise_comp.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..277b291f6f135261d7d9072c123fc6242df9b3b3 GIT binary patch literal 1342 zcmZWoL66%+6rLG7j+0H&>~82bEGiao35QiH)C*d%328w>>T20lsT5hVEWdHqt&?%b zwhES4LTWko1P9>2oqxcAAHjJ}NL+|GA#R*_W2e+oXY}5@Z|2Q6Gw;3mpx^I)_TAs^ zZzdsskVZpHrYPxqsDJ>C$%-y0CBPQ!QvwE<&k2~EJ~I{uv@XcR+Mp+yP_=vS%OsA1 zD4UB_BG!DJEr0w$w|`Co?eelQG^Qx&Tc|i$P#_Bi6xeful+^(Xv!+(vxy+-KYsP@0 zyKZ`Hq0CXz?@^WH5ndD+7%v#D5$4|%k_%p4Iqek23whZ#o81fB+p&7s&21P?rgt zytBUs;ocQNzQX6H?(GNji@Waq***96ojV`9_XY5HtIwoJ@;Hse+O2Qt1y~kG$ychC z@+?m}x*o2hB6QH~Y(Tr%i{YzUI;u7VhIYo*M$v`;s-h^+F_!#@Twz6)#)xF3q+sHl zu}?hu2KxlA9TMC##67yA_D-d~=<@Av{`&lvpWdBr^kWH#^hq_uHIE zTRZG%)z@l(YNH>&M8Wp^N%SW|*+YBz^`l?2Z*Q1WOq(Gu#iT6{a9UYarc>3f)0|fK zsOS`ZTrpPJt<_lXXzTRk8P_1yM-tj&4ja-DwW-aDy+%H^uBVfhvORC@uej%_uIH@; zoL>#4|$JAU;qFB literal 0 HcmV?d00001 diff --git a/Model/Propulsion/__pycache__/range_comp.cpython-36.pyc b/Model/Propulsion/__pycache__/range_comp.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0cb8405ec33f31815638413fb5c22463fb3a68a5 GIT binary patch literal 1254 zcmZWoOK%%D5GMB_tz_A;0jII+9=3-TQ4UUmAeX?XABxk9?HG1b1B(SViycbdU|%7* zO(ZBlf#ez>*Yw;=|4aJ^cq-6KeeAWT&a4DmKuPc;haZRY;PBD%a`)Gt{|R3@jQzzH z8p>=BhkAej40y(J9&paU3M{Y#8@ho5t-$@BK^wde3_QW#+d&ID=d8bUg<7o7&D!DH zDoc}856ZkM3sLCw6K8BhG-H46UIjR%t1Gzm%V%m=yGcXM!NPeDhx!UZuz&+Y^Bk-X z3|+9n!Px;9O}0$uEG|ZZ3?*oyX*9by1~}9u!j!$jSO6pVXz`hZ>I+f}qq*Tc=v+%2 zy0Ek$^F82pN*oX>G4^S6G}$;U z-w5fSiPv>11^9dZQ99J+a7gsve>Cy~S*J=E{^R8Kc_mO~n2pn7giJDL&L-a+$8Y^6 z7yiZlGogh1N%-IThq;g=Q6yvk(StlK4A+x8Kcu<1xgtkBNjWt9p0N_uw~bYzFK?ta ztz78K5^$>%14L<2)!KAvS=O4?t00mrmLjTRsna-96si*0@HZxJW9I*TK6nzoKxb6= zOvoZGpbVduNu6U&sPN&7!THnhc>geb`1tWbcwB$)1Yn{$axXRx(!P<1yo@e&tP4t$eowvM&E&feLYh?YB*@ vtVEGRTyDozDw_m-Nvibm1@@NAt(q7qZKQ0g!Lt)l%Ho(us}n;PQY_L#TN~#T zr~DmZLtfxffr0go(b_|nhSvtC;knRhcwN|Pcpmf`ULUp_-T8hQtvCx{ybQu36N>U` zkjZrr!I_V;~#MYw2J*4R^C*Uk>ul9&N-;gGym8(N2~VhH*l-SZq;w0-fC>_s;)^i zrPb%3$~3o?r&E(4<>f0bsxLl~e3_u=O~pbvu@uXe%36y;wG&>PWPqVg0N_VyUKXmW zmswfp^#FJn2ZH<9fFcTFsoN=ey!?%b8>o=KXVdQ&&m|Xf@tBJ=NFiH1%)&Ck&dbH^ z=hNB4#nT6m7Ps%*`C;)i10G*s{osqjXwhFAG5R5j`yfA6w&X>b<2OX)9s;5L4=-kX zR_)eL{GXH$Okrs0A{-r@n#Blu7v&9fgK{2{9fHZ|qHbL}2?GIdkf& z=6)F2GCLq%p5kMix@LqK$mnib8wTDX**Iu>XkE1Z!}`M+9IbS_2>Iil=%Nul4f>xY zJPnQpSA*{8x&GUn>z{?t%@utO+ZqN4=l|fCFvZebu{@e|#1NyZZL}qoQwvKf`f~0R z>ssl-wUu)1RZ-736(E8Hdks4g)4on28 r?X*ntQ!&P{^0J(#2?W_ekViuI%w#pV47GVC_pm<4UES51m3r)7gshIP literal 0 HcmV?d00001 diff --git a/Model/Weight/__pycache__/weight_buildup_comp.cpython-36.pyc b/Model/Weight/__pycache__/weight_buildup_comp.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa82578cea9c2eb1ed247352e0d1e7c32275428f GIT binary patch literal 2128 zcmZ8iYitx%6rQ=WuP)Q>mcAd9^NIX?HsT<%(25PlaHj1bN&~N=S36|}N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PiT+@nWsG4jpYuce| z-V7{uCuU#|GR87mz*x36>#6LzIE=+YF_~)+S}t2gsR;S}C03{0qX~O-dGb XS^&k7dG)caK^oiHTjij#7$g4z0~=1D literal 0 HcmV?d00001 diff --git a/Model/Weight/thrust_weight_comp.py b/Model/Weight/thrust_weight_comp.py new file mode 100644 index 0000000..c88999f --- /dev/null +++ b/Model/Weight/thrust_weight_comp.py @@ -0,0 +1,32 @@ +import numpy as np +from openmdao.api import ExplicitComponent + +class ThrustWeightComp(ExplicitComponent): + + def setup(self): + self.add_input('G',desc = 'climb gradient') + self.add_input('n',desc = 'load factor') + self.add_input('e',desc = 'oswald efficieny') + self.add_input('AR',desc = 'aspect ratio') + self.add_input('cd0',desc = 'parasitic drag') + self.add_input('rho',desc = 'density') + self.add_input('W_S',desc = 'Wing Loading') + self.add_input('Vc',desc = 'Cruise Speed') + + self.add_output('T_W_climb',desc = 'Thrust-to-Weight ratio climb') + self.add_output('T_W_cruise',desc = 'Thrust-to-Weight ratio cruise') + self.add_output('T_W_maneuver',desc = 'Thrust-to-Weight ratio maneuver') + + self.declare_partials(of = '*', wrt = '*', method = 'cs') + + def compute(self,inputs,outputs): + q = 0.5*inputs['rho']*inputs['Vc']*inputs['Vc'] + twclimb = inputs['G'] + (inputs['W_S']/(np.pi*inputs['e']*inputs['AR']*q)) + (inputs['cd0']*q/(inputs['W_S'])) + cl = 2*inputs['W_S']/(inputs['rho']*inputs['Vc']*inputs['Vc']) + cd = inputs['cd0'] + (1/(np.pi*inputs['e']*inputs['AR']))*cl*cl + twcruise = (cl/cd)**(-1) + twmaneuver = (inputs['cd0']*q/(inputs['W_S'])) + (inputs['n']*inputs['n'])*(inputs['W_S']/(np.pi*inputs['e']*inputs['AR']*q)) + + outputs['T_W_climb'] = twclimb + outputs['T_W_cruise'] = twcruise + outputs['T_W_maneuver'] = twmaneuver \ No newline at end of file diff --git a/Model/Weight/weight_buildup_comp.py b/Model/Weight/weight_buildup_comp.py new file mode 100644 index 0000000..77643c9 --- /dev/null +++ b/Model/Weight/weight_buildup_comp.py @@ -0,0 +1,74 @@ +from openmdao.api import ExplicitComponent +import numpy as np + +class EmptyWeightComp(ExplicitComponent): + # Coefficients + + + def setup(self): + self.add_input('AR',desc='aspect ratio') + #self.add_input('Wb',desc='battery weight') + self.add_input('V',desc='cruise speed') + self.add_input('Neg',desc='number of engines') + self.add_input('W0',desc='gross weight') + self.add_input('Np',desc='number of people') + + self.declare_partials(of='*', wrt='*', method='cs') + self.add_output('We',desc='empty weight') + + + def compute(self, inputs, outputs): + + #Wb = inputs['Wb']*2.205 + AR = inputs['AR'] + Np = inputs['Np'] + V = inputs['V']*3.281 # convert to american + t_c = 0.12 # thickness to chord ratio + L_f = 21.33 # Fuselage structural length [ft] + Lm = 5 # lenth of main landing gear [in] + Neg = inputs['Neg'] # number of engines + Nl = 1 # ultimate landing gear factor + Nz = 3.9 # ultimate load factor + q = 0.5*0.002377*(V**2) # dynamic pressure at cruise + Sf = 362.744 # fuselage wetted area + Sw = 142.233 # trapezoidal wing area + Wdg = inputs['W0']*2.2046 # gross weight + Wen = 110 # engine weight each [lb] + Wl = Wdg # langing gross weight + #Wuav = 800 # usual 800-1400 + M = V/1116.13 # mach + L_D = 15.35 # lift over drag + B_w = 31.5 # wing span + + #wing + W_w = 0.036*(Sw**0.758)*(AR**0.86)*(q**0.006)*((100*t_c)**(-0.3))*((Nz*Wdg)**0.49) + # fuselage + W_f = 0.052*(Sf**1.086)*((Nz*Wdg)**0.22)*(L_f**(-0.051))*((L_D)**(-0.072))*(q**0.241) + # landing gear + W_lg = 0.095*((Nl*Wl)**0.768)*((Lm/12)**0.845) + # installed engine + W_ie = 2.575*(Wen**0.922)*(Neg) + # flight controls + W_fc = 0.053*(L_f**1.536)*(B_w**0.371)*((Nz*Wdg*10**(-4))**0.8) + # hydraulics + W_h = 0.001*Wdg + # avionics + W_av = 33 # vahana avionics = 15 kg = 33.069 lb + # electrical + W_el = 12.57*(W_av)**0.51 + # air conditioning + W_ac = 0.265*Wdg**0.52*Np**0.68*W_av**0.17*M**0.08 + # furnishings + W_fur = 0.0582*Wdg - 65 + # actuators + # 12 actuators, 0.65 kg each + W_act = 12*1.43 + + We = 0.8*(W_w + W_f + W_lg + W_ie + W_fc + W_h + W_av + W_el + W_ac + W_fur + W_act)/2.205 + #print('weight',We) + outputs['We'] = We # outputs kg + + + + + \ No newline at end of file diff --git a/Model/costanalysis/CostBuildup.py b/Model/costanalysis/CostBuildup.py new file mode 100644 index 0000000..bc34366 --- /dev/null +++ b/Model/costanalysis/CostBuildup.py @@ -0,0 +1,80 @@ +# Estimate tooling cost of a vehicle by summing tooling costs for all major +# components +# +# Inputs: +# rProp - Prop/rotor radius [m] +# cruiseOutput - Structure with cruise performance data +# +# Outputs: +# toolCostPerVehicle - Estimate of tool cost per vehicle [$] +# +# Functions Called: +# toolingCost.m + +#function toolCostPerVehicle = costBuildup(rProp,cruiseOutput) +import numpy as np +from ToolingCost import ToolingCost + +def CostBuildup(r_prop,c_ref, b_ref): + # Inputs + fuselage_width = 1 + fuselage_length = 5 + toc = 0.15 # Wing / canard thickness + prop_radius = r_prop + prop_chord = 0.15 * prop_radius + x_hinge = 0.8 + winglet = 0.2 + + parts_per_tool = 1000 + + fuselage_height = 1.3 # Guess + span = b_ref + chord = c_ref + + # tool_cost_per_vechile = 100 # used as test value + + # Wing Tooling + wing_tool_cost = np.array([0, 0, 0, 0]) + wing_tool_cost[0] = ToolingCost((span - fuselage_width)/2, toc*chord, chord*0.2) # Leading Edge + wing_tool_cost[1] = ToolingCost((span - fuselage_width)/2, toc*chord*0.7, chord*0.2) # Aft spar + wing_tool_cost[2] = ToolingCost((span - fuselage_width)/2, chord*0.75, 0.02)*2 # Upper/Lower skin + wing_tool_cost[3] = ToolingCost(span, toc*chord, chord*.20) # Forward spar + wing_tool_cost = 2*(2*sum(wing_tool_cost[0:3])+wing_tool_cost[3]) # Total wing tooling cost (matched tooling) + + # Winglet Tooling + winglet_tool_cost = np.array([0, 0, 0, 0]) + winglet_tool_cost[0] = ToolingCost(winglet*span/2, toc*chord, chord*.2) # Leading edge + winglet_tool_cost[1] = ToolingCost(winglet*span/2,toc*chord*0.7,chord*.2) # Aft spar + winglet_tool_cost[2] = ToolingCost(winglet*span/2,chord*0.75,0.02)*2 # Upper/Lower skin + winglet_tool_cost[3] = ToolingCost(winglet*span/2,toc*chord,chord*.20) # Forward spar + winglet_tool_cost = 4*sum(winglet_tool_cost) # Total winglet tooling cost (matched tooling) + + # Canard Tooling + canard_tool_cost = wing_tool_cost # Total canard tooling cost + + # Fuselage Tooling + fuselage_tool_cost = np.array([0, 0, 0, 0]) + fuselage_tool_cost[0] = ToolingCost(fuselage_length*.8,fuselage_height,fuselage_width/2)*2 # Right/Left skin + fuselage_tool_cost[1] = ToolingCost(fuselage_length*.8,fuselage_width/2,fuselage_height/4) # Keel + fuselage_tool_cost[2] = ToolingCost(fuselage_width,fuselage_height,0.02)*2 # Fwd/Aft Bulkhead + fuselage_tool_cost[3] = ToolingCost(fuselage_length*.1,fuselage_width,fuselage_height/3) # Nose/Tail cone + fuselage_tool_cost = 2*sum(fuselage_tool_cost) # Total fuselage tooling cost (matched tooling) + + # Prop Tooling + prop_tool_cost = np.array([0, 0]) + prop_tool_cost[0] = ToolingCost(prop_radius,prop_chord,prop_chord*toc/2)*2 # Skin + prop_tool_cost[1] = ToolingCost(prop_radius,prop_chord*toc,prop_chord/4)*2 # Spar tool + prop_tool_cost = 4*sum(prop_tool_cost) # Total propeller tooling cost (left/right hand) (matched tooling) + + # Control Surface (2 tools) + control_tool_cost = np.array([0, 0]) + control_tool_cost[0] = ToolingCost((span-fuselage_width)/2,(1-x_hinge)*chord,chord*toc/4) # Skin + control_tool_cost[1] = ToolingCost((span-fuselage_width)/2,(1-x_hinge)*chord,chord*toc/4) # Skin + control_tool_cost = 8*sum(control_tool_cost) # Total wing tooling (matched tooling) + + # Total tool cost + total_tool_cost = wing_tool_cost + canard_tool_cost + fuselage_tool_cost + prop_tool_cost + control_tool_cost + winglet_tool_cost + + tool_cost_per_vechile = total_tool_cost / parts_per_tool + + return tool_cost_per_vechile \ No newline at end of file diff --git a/Model/costanalysis/ToolingCost.py b/Model/costanalysis/ToolingCost.py new file mode 100644 index 0000000..01ce407 --- /dev/null +++ b/Model/costanalysis/ToolingCost.py @@ -0,0 +1,61 @@ +# Estimates tooling cost based on part dimensions including material, rough +# machining, and finishing machining +# +# Inputs: +# length - part length [m] +# width - part width [m] +# depth - part depth [m] +# +# Output: +# cost - Tool cost [$] +# +import math + +def ToolingCost(length, width, depth): + # Material + tool_side_offset = 0.09 # Offset on each side of tool + tool_depth_offset = 0.03 # Offset at bottom of tool + tool_cost = 10000 # Cost be m^3 of tooling material [$/m^3] + + tool_volume = (length + 2 * tool_side_offset) * (width + 2 * tool_side_offset) * (depth + tool_depth_offset) + material_cost = tool_cost * tool_volume # Tooling material costs + + # Machining (Rough Pass) + rough_SFM = 200 # Roughing surface feet per minute + rough_FPT = 0.003 # Roughing feed per tooth [in] + rough_cost_rate = 150/3600 # Cost to rough [$/s] + rough_bit_diam = 0.05 # Rougher diameter [m] + + rough_bit_depth = rough_bit_diam/4 # Rougher cut depth [m] + rough_RPM = 3.82 * rough_SFM / (39.37 * rough_bit_diam) # Roughing RPM + rough_feed = rough_FPT * rough_RPM * 2 * 0.00042 # Roughing Feed [m/s] + rough_bit_step = 0.8 * rough_bit_diam # Rougher step size + + cut_volume = length * math.pi * depth * width / 4 # Amount of material to rough out + rough_time = cut_volume / (rough_feed * rough_bit_step * rough_bit_depth) # Time for roughing + rough_cost = rough_time * rough_cost_rate # Roughing cost + + # Machining (Finish Pass) + finish_SFM = 400 # Roughing surface feet per minute + finish_FPT = 0.004 # Roughing feed per tooth [in] + finish_cost_rate = 175/3600 # Cost to finish [$/s] + finish_bit_diam = 0.006 # Finish diameter [m] + finish_passes = 5 # Number of surface passes + + finish_RPM = 3.82 * finish_SFM / (39.37 * finish_bit_diam) # Roughing RPM + finish_feed = finish_FPT * finish_RPM * 2 * 0.00042 # Roughing Feed [m/s] + + def EllipsePerimeter(a, b): + h = (a - b)**2 / (a + b)**2 + p = math.pi*(a+b)*(1+3*h/(10+(4-3*h)**0.5)) + return p + + finish_bit_step = 0.8 * finish_bit_diam # Rougher step size + cut_area = length * EllipsePerimeter(width/2,depth)/2; # Amount of material to rough out + finish_time = cut_area / (finish_feed * finish_bit_step) * finish_passes; # Time for roughing + finish_cost = finish_time * finish_cost_rate; # Roughing cost + + # Total Cost + cost = material_cost + rough_cost + finish_cost + + return cost \ No newline at end of file