Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gpkitmodels/GP/aircraft/tail/horizontal_tail.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class HorizontalTail(Wing):

def setup(self, N=3):
exec parse_variables(HorizontalTail.__doc__)
Vh.key.descr['pr'] = 4
lh.key.descr['fix'] = True

self.ascs = Wing.setup(self, N)
self.planform.substitutions.update(
Expand Down
6 changes: 5 additions & 1 deletion gpkitmodels/GP/aircraft/tail/tail_boom.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class TailBoomState(Model):
"""
def setup(self):
exec parse_variables(TailBoomState.__doc__)

rhosl.key.descr['pr'] = 1
Vne.key.descr['pr'] = 8

class VerticalBoomTorsion(Model):
""" Tail Boom Torsion from Vertical Tail
Expand All @@ -83,6 +84,7 @@ class VerticalBoomTorsion(Model):
"""
def setup(self, tailboom, vtail, state):
exec parse_variables(VerticalBoomTorsion.__doc__)
taucfrp.key.descr['pr'] = 1

J = self.J = tailboom.J
d0 = self.d0 = tailboom.d
Expand Down Expand Up @@ -134,6 +136,7 @@ def setup(self, tailboom, htail, state):
self.htail = htail
self.tailboom = tailboom
exec parse_variables(TailBoomBending.__doc__)
kappa.key.descr['pr'] = 2

Beam.qbarFun = [1e-10]*N
Beam.SbarFun = [1.]*N
Expand Down Expand Up @@ -189,6 +192,7 @@ class TailBoom(TubeSpar):
def setup(self, N=5):
self.N = N
exec parse_variables(TailBoom.__doc__)
rhoA.key.descr['pr'] = 10
self.spar = super(TailBoom, self).setup(N, self)

if self.secondaryWeight:
Expand Down
9 changes: 9 additions & 0 deletions gpkitmodels/GP/aircraft/wing/capspar.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ def setup(self, N, surface):
self.surface = surface
exec parse_variables(CapSpar.__doc__)

E.key.descr['pr'] = 1
wlim.key.descr['pr'] = 3
hin.key.descr['fix'] = True
I.key.descr['fix'] = True
Sy.key.descr['fix'] = True
w.key.descr['fix'] = True
t.key.descr['fix'] = True
tshear.key.descr['fix'] = True

cave = self.cave = surface.cave
b = self.b = surface.b
deta = surface.deta
Expand Down
1 change: 1 addition & 0 deletions gpkitmodels/GP/aircraft/wing/gustloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def return_cosm1(self, c):

def setup(self, wing, state, out=False):
exec parse_variables(GustL.__doc__)
vgust.key.descr['pr'] = 7
self.load = SparLoading.setup(self, wing, state, out=out)

cbar = self.wing.planform.cbar
Expand Down
2 changes: 2 additions & 0 deletions gpkitmodels/GP/aircraft/wing/sparloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def new_qbarFun(self, c):
def setup(self, wing, state, out=False):
self.wing = wing
exec parse_variables(SparLoading.__doc__)
kappa.key.descr['pr'] = 3
twmax.key.descr['pr'] = 2

b = self.b = self.wing.planform.b
I = self.I = self.wing.spar.I
Expand Down
16 changes: 14 additions & 2 deletions gpkitmodels/GP/aircraft/wing/wing.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ def return_cmac(self, c):
def setup(self, N):
exec parse_variables(Planform.__doc__)

CLmax.key.descr['pr'] = 10
CM.key.descr['pr'] = 7
lam.key.descr['pr'] = 12
AR.key.descr['pr'] = 0
S.key.descr['fix'] = True
b.key.descr['fix'] = True
croot.key.descr['fix'] = False # True # <-----------------
cmac.key.descr['fix'] = True
cave.key.descr['fix'] = True

return [b**2 == S*AR,
cave == cbave*S/b,
croot == S/b*cbar[0],
Expand Down Expand Up @@ -122,6 +132,8 @@ def setup(self, static, state,
self.state = state
self.static = static
exec parse_variables(WingAero.__doc__)
CLstall.key.descr['pr'] = 3
e.key.descr['pr'] = 6

df = pd.read_csv(fitdata)
fd = df.to_dict(orient="records")[0]
Expand Down Expand Up @@ -154,7 +166,7 @@ class Wing(Model):
Variables
---------
W [lbf] wing weight
mfac 1.2 [-] wing weight margin factor
mfac 1.0 [-] wing weight margin factor

SKIP VERIFICATION

Expand Down Expand Up @@ -196,6 +208,6 @@ def setup(self, N=5):
self.foam = self.fillModel(self.planform)
self.components.extend([self.foam])

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

return constraints, self.planform, self.components
5 changes: 5 additions & 0 deletions gpkitmodels/GP/aircraft/wing/wing_skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class WingSkin(Model):
def setup(self, surface):
exec parse_variables(WingSkin.__doc__)

Jtbar.key.descr['pr'] = 2
Cmw.key.descr['pr'] = 4
rhosl.key.descr['pr'] = 1
Vne.key.descr['pr'] = 4

croot = self.croot = surface.croot
S = self.S = surface.S
rho = self.material.rho
Expand Down
13 changes: 13 additions & 0 deletions gpkitmodels/GP/materials/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class CFRPFabric(Model):
"""
def setup(self):
exec parse_variables(CFRPFabric.__doc__)
rho.key.descr['pr'] = 2
tmin.key.descr['pr'] = 1
tau.key.descr['pr'] = 2
E.key.descr['pr'] = 2
sigma.key.descr['pr'] = 2
G.key.descr['pr'] = 2

class CFRPUD(Model):
""" Carbon Fiber Reinforced Plastic Unidirectional Material Properties
Expand All @@ -41,6 +47,10 @@ class CFRPUD(Model):
"""
def setup(self):
exec parse_variables(CFRPUD.__doc__)
rho.key.descr['pr'] = 2
E.key.descr['pr'] = 1
sigma.key.descr['pr'] = 2
tmin.key.descr['pr'] = 1

class Kevlar(Model):
""" Kevlar Material Properties
Expand All @@ -60,3 +70,6 @@ class Kevlar(Model):
"""
def setup(self):
exec parse_variables(Kevlar.__doc__)
rho.key.descr['pr'] = 1
tmin.key.descr['pr'] = 1
tau.key.descr['pr'] = 2
2 changes: 2 additions & 0 deletions gpkitmodels/GP/materials/foam.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class FoamHD(Model):
"""
def setup(self):
exec parse_variables(FoamHD.__doc__)
rho.key.descr['pr'] = 5

class FoamLD(Model):
""" Foam low density material properties
Expand All @@ -29,3 +30,4 @@ class FoamLD(Model):
"""
def setup(self):
exec parse_variables(FoamLD.__doc__)
rho.key.descr['pr'] = 5