Skip to content

Commit

Permalink
move wingskin constraints to global level
Browse files Browse the repository at this point in the history
  • Loading branch information
mjburton committed Oct 12, 2017
1 parent fd2626b commit b095621
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
8 changes: 5 additions & 3 deletions gpkitmodels/GP/aircraft/wing/wing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def setup(self, N=5, lam=0.5, spar="CapSpar", hollow=False):

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

if not hollow:
self.winginterior = WingInterior(self.surf["c_{ave}"], self.surf["b"], N)
Expand All @@ -34,6 +34,8 @@ def setup(self, N=5, lam=0.5, spar="CapSpar", hollow=False):
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"]),
]

self.flight_model = WingAero
Expand Down Expand Up @@ -76,7 +78,7 @@ class WingLoading(Model):
"wing loading cases"
def setup(self, wing, Wcent, Wwing=None, V=None, CL=None):

loading = [wing.wingskin.loading()]
loading = [wing.skin.loading(wing)]
loading.append(wing.spar.loading(wing, Wcent))
if Wwing:
loading.append(wing.spar.gustloading(wing, Wcent, Wwing, V, CL))
Expand Down
14 changes: 5 additions & 9 deletions gpkitmodels/GP/aircraft/wing/wing_skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class WingSkin(Model):
"wing skin model"
def setup(self, S, croot, b):
def setup(self):

rhocfrp = Variable("\\rho_{CFRP}", 1.6, "g/cm^3", "density of CFRP")
W = Variable("W", "lbf", "wing skin weight")
Expand All @@ -13,15 +13,11 @@ def setup(self, S, croot, b):
Jtbar = Variable("\\bar{J/t}", 0.01114, "1/mm",
"torsional moment of inertia")

constraints = [W >= rhocfrp*S*2*t*g,
t >= tmin,
b == b,
croot == croot]
constraints = [t >= tmin]

return constraints
self.loading = WingSkinL

def loading(self):
return WingSkinL(self)
return constraints

class WingSkinL(Model):
"wing skin loading model for torsional loads in skin"
Expand All @@ -35,6 +31,6 @@ def setup(self, static):

constraints = [
taucfrp >= (1/static["\\bar{J/t}"]/(static["c_{root}"])**2
/ static["t"]*Cmw*static["S"]*rhosl*Vne**2)]
/ static.skin["t"]*Cmw*static["S"]*rhosl*Vne**2)]

return constraints

0 comments on commit b095621

Please sign in to comment.