Skip to content

Commit

Permalink
make surface an input to spar
Browse files Browse the repository at this point in the history
  • Loading branch information
mjburton committed Oct 13, 2017
1 parent c43fe50 commit 7e92c2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
22 changes: 12 additions & 10 deletions gpkitmodels/GP/aircraft/wing/capspar.py
Expand Up @@ -5,7 +5,7 @@

class CapSpar(Model):
"cap spar model"
def setup(self, N):
def setup(self, N, surface):

# phyiscal properties
rhocfrp = Variable("\\rho_{CFRP}", 1.6, "g/cm^3", "density of CFRP")
Expand All @@ -16,26 +16,28 @@ def setup(self, N):
I = Variable("I", "m^4", "spar x moment of inertia")
Sy = Variable("S_y", "m**3", "section modulus")
dm = Variable("dm", "kg", "segment spar mass")
dmdy = Variable("(dm/dy)", "kg/m", "spar mass per length")
w = Variable("w", "in", "spar width")
t = Variable("t", "in", "spar cap thickness")
tshear = Variable("t_{shear}", "in", "shear web thickness")

W = Variable("W", "lbf", "spar weight")
w_lim = Variable("w_{lim}", 0.15, "-", "spar width to chord ratio")
wlim = Variable("w_{lim}", 0.15, "-", "spar width to chord ratio")
tshearmin = Variable("t_{shear-min}", 0.012, "in",
"min shear web thickness")
g = Variable("g", 9.81, "m/s^2", "gravitational acceleration")
mfac = Variable("m_{fac}", 0.97, "-", "curvature knockdown factor")
rhofoam = Variable("\\rho_{foam}", 0.036, "g/cm^3", "foam density")

constraints = [I/mfac <= 2*w*t*(hin/2)**2,
dmdy >= (rhocfrp*(2*w*t + 2*tshear*(w + hin + 2*t))
+ rhofoam*w*hin),
W >= 2*dm.sum()*g,
Sy*(hin/2 + t) <= I,
tshear >= tshearmin
]
constraints = [
I/mfac <= 2*w*t*(hin/2)**2,
dm >= (rhocfrp*(2*w*t + 2*tshear*(w + hin + 2*t))
+ rhofoam*w*hin)*surface["b"]/2*surface["d\\eta"],
W >= 2*dm.sum()*g,
w <= wlim*surface["c_{ave}"],
surface["c_{ave}"]*surface["\\tau"] >= hin + 2*t,
Sy*(hin/2 + t) <= I,
tshear >= tshearmin
]

self.loading = ChordSparL
self.gustloading = GustL
Expand Down
7 changes: 1 addition & 6 deletions gpkitmodels/GP/aircraft/wing/wing.py
Expand Up @@ -35,18 +35,13 @@ def setup(self, N=5, lam=0.5, hollow=False):

self.surf = AeroSurf(N)
self.surf.substitutions.update(subdict)
self.spar = CapSpar(N)
self.spar = CapSpar(N, self.surf)
self.skin = WingSkin()
self.components = [self.spar, self.skin]


constraints = [
W/mfac >= sum(c["W"] for c in self.components),
self.spar["dm"] >= (self.spar["(dm/dy)"]*self.surf["b"]/2
* self.surf["d\\eta"]),
self.spar["w"] <= self.spar["w_{lim}"]*self.surf["c_{ave}"],
self.surf["c_{ave}"]*self.surf["\\tau"] >= (
self.spar["h_{in}"] + 2*self.spar["t"]),
self.skin["W"] >= (self.skin["\\rho_{CFRP}"]*self.surf["S"]*2
* self.skin["t"]*self.skin["g"]),
]
Expand Down

0 comments on commit 7e92c2c

Please sign in to comment.