Skip to content

Commit

Permalink
move components from aerosurf to wing
Browse files Browse the repository at this point in the history
  • Loading branch information
mjburton committed Oct 12, 2017
1 parent b6a9610 commit 3e3400b
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions gpkitmodels/GP/aircraft/wing/wing.py
Expand Up @@ -16,17 +16,22 @@ def setup(self, N=5, lam=0.5, spar="CapSpar", hollow=False):

W = Variable("W", "lbf", "wing weight")


self.surf = AeroSurf(N=N, lam=lam, spar=spar, hollow=hollow)
self.spar = CapSpar(self.surf["b"], self.surf["c_{ave}"], self.surf["\\tau"], N)
self.wingskin = WingSkin(self.surf["S"], self.surf["c_{root}"], self.surf["b"])
self.components = [self.spar, self.wingskin]

constraints = [W == self.surf.topvar("W")]
if not hollow:
self.winginterior = WingInterior(self.surf["c_{ave}"], self.surf["b"], N)
self.components.extend([self.winginterior])

self.spar = self.surf.spar
self.wingskin = self.surf.wingskin
constraints = [W/self.surf.topvar("m_{fac}") >= sum(c["W"] for c in self.components)]

self.flight_model = WingAero
self.loading = WingLoading

return constraints, self.surf
return constraints, self.surf, self.components

class AeroSurf(Model):
"The thing that creates the lift"
Expand Down Expand Up @@ -59,20 +64,7 @@ def setup(self, N=5, lam=0.5, spar="CapSpar", hollow=False):
croot == S/b*cb[0],
cmac == croot*cbarmac]

if spar == "CapSpar":
self.spar = CapSpar(b, cave, tau, N)
elif spar == "TubeSpar":
self.spar = TubeSpar(b, cave, tau, N)
self.wingskin = WingSkin(S, croot, b)
self.components = [self.spar, self.wingskin]

if not hollow:
self.winginterior = WingInterior(cave, b, N)
self.components.extend([self.winginterior])

constraints.extend([W/mfac >= sum(c["W"] for c in self.components)])

return self.components, constraints
return constraints

class WingLoading(Model):
"wing loading cases"
Expand Down

0 comments on commit 3e3400b

Please sign in to comment.