Skip to content

Commit

Permalink
add surface to arguments for skin and foam models
Browse files Browse the repository at this point in the history
  • Loading branch information
mjburton committed Oct 13, 2017
1 parent 80f0691 commit 328d5c7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
12 changes: 3 additions & 9 deletions gpkitmodels/GP/aircraft/tail/horizontal_tail.py
Expand Up @@ -33,20 +33,14 @@ def setup(self, N=3, lam=0.8):

self.skin = WingSkin(self.surf)
self.skin.substitutions.update({"\\rho_{CFRP}": 0.049})
self.foam = WingInterior()
self.foam = WingInterior(self.surf)
self.foam.substitutions.update({"\\bar{A}_{jh01}": 0.0548})
self.foam.substitutions.update({"\\rho_{foam}": 0.024})

self.components = [self.skin, self.foam]

constraints = [
W/mfac >= sum([c["W"] for c in self.components]),
mh*(1+2.0/self.surf["AR"]) <= 2*np.pi,
self.foam["W"] >= 2*(
self.foam["g"]*self.foam["\\rho_{foam}"]
*self.foam["\\bar{A}_{jh01}"]*self.surf["c_{ave}"]**2
* (self.surf["b"]/2)*self.surf["d\\eta"]).sum()
]
constraints = [W/mfac >= sum([c["W"] for c in self.components]),
mh*(1+2.0/self.surf["AR"]) <= 2*np.pi]

self.flight_model = TailAero

Expand Down
10 changes: 2 additions & 8 deletions gpkitmodels/GP/aircraft/tail/vertical_tail.py
Expand Up @@ -29,19 +29,13 @@ def setup(self, N=3, lam=0.8):

self.skin = WingSkin(self.surf)
self.skin.substitutions.update({"\\rho_{CFRP}": 0.049})
self.foam = WingInterior()
self.foam = WingInterior(self.surf)
self.foam.substitutions.update({"\\bar{A}_{jh01}": 0.0548})
self.foam.substitutions.update({"\\rho_{foam}": 0.024})

self.components = [self.skin, self.foam]

constraints = [
W/mfac >= sum([c["W"] for c in self.components]),
self.foam["W"] >= 2*(
self.foam["g"]*self.foam["\\rho_{foam}"]
*self.foam["\\bar{A}_{jh01}"]*self.surf["c_{ave}"]**2
* (self.surf["b"]/2)*self.surf["d\\eta"]).sum()
]
constraints = [W/mfac >= sum([c["W"] for c in self.components])]

self.flight_model = TailAero

Expand Down
16 changes: 4 additions & 12 deletions gpkitmodels/GP/aircraft/wing/wing.py
Expand Up @@ -10,7 +10,7 @@
from gpfit.fit_constraintset import XfoilFit

#pylint: disable=invalid-name, attribute-defined-outside-init, unused-variable
#pylint: disable=too-many-instance-attributes
#pylint: disable=too-many-instance-attributes, too-many-locals

class Wing(Model):
"""
Expand Down Expand Up @@ -39,19 +39,11 @@ def setup(self, N=5, lam=0.5, hollow=False):
self.skin = WingSkin(self.surf)
self.components = [self.spar, self.skin]


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

if not hollow:
self.foam = WingInterior()
self.foam = WingInterior(self.surf)
self.components.extend([self.foam])
constraints.extend([
self.foam["W"] >= 2*(
self.foam["g"]*self.foam["\\rho_{foam}"]
* self.foam["\\bar{A}_{jh01}"]*self.surf["c_{ave}"]**2
* (self.surf["b"]/2)*self.surf["d\\eta"]).sum()])

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

self.flight_model = WingAero
self.loading = WingLoading
Expand Down
6 changes: 3 additions & 3 deletions gpkitmodels/GP/aircraft/wing/wing_interior.py
Expand Up @@ -3,15 +3,15 @@

class WingInterior(Model):
"wing interior model"
def setup(self):
def setup(self, surface):

W = Variable("W", "lbf", "interior mass of wing")
dmdy = Variable("(dm/dy)", "kg/m", "foam mass per length")
rhofoam = Variable("\\rho_{foam}", 0.036, "g/cm^3", "foam density")
Abar = Variable("\\bar{A}_{jh01}", 0.0753449, "-",
"jh01 non dimensional area")
g = Variable("g", 9.81, "m/s^2", "gravitational acceleration")

constraints = [Abar == Abar]
constraints = [W >= 2*(g*rhofoam*Abar*surface["c_{ave}"]**2
* surface["b"]/2* surface["d\\eta"]).sum()]

return constraints

0 comments on commit 328d5c7

Please sign in to comment.