Skip to content

Commit

Permalink
use single model for tail boom bending, call beam model in bending
Browse files Browse the repository at this point in the history
  • Loading branch information
mjburton committed Dec 15, 2017
1 parent dc69f8f commit fef0178
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 66 deletions.
9 changes: 5 additions & 4 deletions gpkitmodels/GP/aircraft/tail/empennage.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ def setup(self):
l = self.l = self.tailboom.l

state = TailBoomState()
self.hbend = self.tailboom.hbending(self.tailboom, self.htail, state)
self.vbend = self.tailboom.vbending(self.tailboom, self.vtail, state)
self.vtor = self.tailboom.vtorsion(self.tailboom, self.vtail, state)
loading = [self.hbend, self.vbend, self.vtor]
self.tailboom.tailLoad.__name__ = "HTailBoomBending"
self.hbend = self.tailboom.tailLoad(self.tailboom, self.htail, state)
self.tailboom.tailLoad.__name__ = "VTailBoomBending"
self.vbend = self.tailboom.tailLoad(self.tailboom, self.vtail, state)
loading = [self.hbend, self.vbend]

constraints = [
W/mfac >= sum(c.W for c in self.components),
Expand Down
76 changes: 21 additions & 55 deletions gpkitmodels/GP/aircraft/tail/tail_boom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from numpy import pi
from gpkit import Model, parse_variables
from .tube_spar import TubeSpar
from gpkitmodels.GP.beam.beam import Beam

#pylint: disable=exec-used, undefined-variable, invalid-name
#pylint: disable=attribute-defined-outside-init
Expand Down Expand Up @@ -89,54 +90,14 @@ def setup(self, tailboom, vtail, state):
taucfrp >= T*d0/2/J
]

class VerticalBoomBending(Model):
""" Tail Boom Bending from Vtail Deflection
class TailBoomBending(Model):
""" Tail Boom Bending
Variables
---------
F [N] vertical tail force
F [N] tail force
th [-] tail boom deflection angle
thmax 0.1 [-] max tail boom deflection angle
Upper Unbounded
---------------
I0
Lower Unbounded
---------------
S, l
LaTex Strings
-------------
th \\theta
thmax \\theta_{\\mathrm{max}}
"""
def setup(self, tailboom, vtail, state):
exec parse_variables(VerticalBoomBending.__doc__)

I0 = self.I0 = tailboom.I
l = self.l = tailboom.l
S = self.S = vtail.planform.S
E = self.E = tailboom.material.E
k = self.k = tailboom.k
rhosl = self.rhosl = state.rhosl
Vne = self.Vne = state.Vne
CLmax = vtail.planform.CLmax

return [F >= 0.5*rhosl*Vne**2*S*CLmax,
th >= F*l**2/E/I0*(1+k)/2,
th <= thmax,
]

class HorizontalBoomBending(Model):
""" Tail Boom Bending from Htail Deflection
Variables
---------
F [N] horizontal tail force
th [-] tail boom deflection angle
thmax 0.1 [-] max tail boom deflection angle
kappa 0.1 [-] max tail boom deflection
Upper Unbounded
---------------
Expand All @@ -153,21 +114,28 @@ class HorizontalBoomBending(Model):
"""
def setup(self, tailboom, htail, state):
exec parse_variables(HorizontalBoomBending.__doc__)
exec parse_variables(TailBoomBending.__doc__)

N = tailboom.N
Beam.qbarFun = [1e-10]*N
Beam.SbarFun = [1.]*N
beam = Beam(N)

I0 = self.I0 = tailboom.I
I = self.I = tailboom.I
l = self.l = tailboom.l
S = self.S = htail.planform.S
E = self.E = tailboom.material.E
k = self.k = tailboom.k
rhosl = self.rhosl = state.rhosl
Vne = self.Vne = state.Vne
CLmax = htail.planform.CLmax
deta = tailboom.deta

return [F >= 0.5*rhosl*Vne**2*S,
th >= F*l**2/E/I0*(1+k)/2,
th*CLmax <= thmax,
]
return beam, [beam["dx"] == deta,
F >= 0.5*rhosl*Vne**2*S,
beam["\\bar{EI}"] <= E*I/F/l**2/2,
th == beam["\\theta"][-1],
beam["\\bar{\\delta}"][-1]*CLmax <= kappa
]

class TailBoom(TubeSpar):
""" Tail Boom Model
Expand All @@ -181,17 +149,15 @@ class TailBoom(TubeSpar):
"""

flight_model = TailBoomAero
hbending = HorizontalBoomBending
vbending = VerticalBoomBending
vtorsion = VerticalBoomTorsion
tailLoad = TailBoomBending

def setup(self, N=2):
exec parse_variables(TailBoom.__doc__)
self.N = N

self.spar = TubeSpar.setup(self, N, self)

d0 = self.d0 = self.d[0]

return self.spar, S == l*pi*d0


8 changes: 5 additions & 3 deletions gpkitmodels/GP/aircraft/tail/tail_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ def test_emp():
emp.htail.Vh <= emp.htail.planform.S*emp.htail.lh/Sw/cmac,
emp.vtail.Vv <= emp.vtail.planform.S*emp.vtail.lv/Sw/bw,
emp, fs, htperf, vtperf, tbperf])
m.solve(verbosity=0)
sol = m.solve(verbosity=0)
return sol

def test():
test_htail()
test_vtail()
test_emp()
sol = test_emp()
return sol

if __name__ == "__main__":
test()
sol = test()
4 changes: 1 addition & 3 deletions gpkitmodels/GP/aircraft/tail/tube_spar.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class TubeSpar(Model):
I [m^4] moment of inertia
d [in] diameter
t [in] thickness
J [m^4] polar moment of inertia
dm [kg] segment mass
Upper Unbounded
Expand Down Expand Up @@ -51,5 +50,4 @@ def setup(self, N, surface):
return [I <= pi*t*d**3/8.0,
dm >= pi*rho*d*deta*t*kfac*l,
W/mfac >= g*dm.sum(),
t >= tmin,
J <= pi/8.0*d**3*t]
t >= tmin]
2 changes: 1 addition & 1 deletion gpkitmodels/GP/beam/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def setup(self, N):
if self.SbarFun is None:
with Vectorize(N):
qbar = self.qbar = Variable("\\bar{q}", self.qbarFun, "-",
"normalized loading")
"normalized loading")
Sbartip = Variable("\\bar{S}_{tip}", 1e-10, "-", "Tip loading")
constraints.extend([
Sbar[:-1] >= Sbar[1:] + 0.5*dx*(qbar[:-1] + qbar[1:]),
Expand Down

0 comments on commit fef0178

Please sign in to comment.