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
6 changes: 3 additions & 3 deletions gpkitmodels/GP/aircraft/tail/empennage.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def setup(self, N=2):
self.htail = HorizontalTail()
self.hSparModel = self.htail.sparModel
self.htail.substitutions.update({self.htail.mfac: 1.1})
lh = self.lh = self.htail.lh
lh = self.htail.lh
self.vtail = VerticalTail()
self.vSparModel = self.vtail.sparModel
self.vtail.substitutions.update({self.vtail.mfac: 1.1})
lv = self.lv = self.vtail.lv
lv = self.vtail.lv
self.tailboom = TailBoom(N=N)
self.components = [self.htail, self.vtail, self.tailboom]
l = self.l = self.tailboom.l
l = self.tailboom.l

constraints = [
W/mfac >= sum(c.W for c in self.components),
Expand Down
22 changes: 13 additions & 9 deletions gpkitmodels/GP/aircraft/tail/tail_aero.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ class TailAero(Model):

Upper Unbounded
---------------
Cd, Re, S, V, b, rho (if not rhovalue)
Cd, Re
static.planform.S, static.planform.b
state.V, state.rho (if not rhovalue)

Lower Unbounded
---------------
S, tau, V, b, rho (if not rhovalue)
static.planform.S, static.planform.tau, static.planform.b
state.V, state.rho (if not rhovalue)

LaTex Strings
-------------
Expand All @@ -30,16 +33,17 @@ class TailAero(Model):
"""
def setup(self, static, state):
self.state = state
self.static = static
exec parse_variables(TailAero.__doc__)

cmac = self.cmac = static.planform.cmac
b = self.b = static.planform.b
S = self.S = static.planform.S
tau = self.tau = static.planform.tau
rho = self.rho = state.rho
cmac = static.planform.cmac
b = static.planform.b
S = static.planform.S
tau = static.planform.tau
rho = state.rho
self.rhovalue = rho.key.value
V = self.V = state.V
mu = self.mu = state.mu
V = state.V
mu = state.mu
path = os.path.dirname(__file__)
fd = pd.read_csv(path + os.sep + "tail_dragfit.csv").to_dict(
orient="records")[0]
Expand Down
6 changes: 4 additions & 2 deletions gpkitmodels/GP/aircraft/wing/boxspar.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BoxSpar(Model):

Lower Unbounded
---------------
Sy, b, J
Sy, surface.b, J

LaTex Strings
-------------
Expand All @@ -59,9 +59,11 @@ class BoxSpar(Model):
coreMaterial = foamhd

def setup(self, N, surface):
self.N = N
self.surface = surface
exec parse_variables(BoxSpar.__doc__)

b = self.b = surface.b
b = surface.b
cave = surface.cave
tau = surface.tau
deta = surface.deta
Expand Down
11 changes: 6 additions & 5 deletions gpkitmodels/GP/aircraft/wing/capspar.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class CapSpar(Model):

Upper Unbounded
---------------
W, cave, tau
W, surface.cave, surface.tau

Lower Unbounded
---------------
Sy, b
Sy, surface.b

LaTex Strings
-------------
Expand All @@ -55,12 +55,13 @@ class CapSpar(Model):
coreMaterial = foamhd

def setup(self, N, surface):
self.surface = surface
exec parse_variables(CapSpar.__doc__)

cave = self.cave = surface.cave
b = self.b = surface.b
cave = surface.cave
b = surface.b
deta = surface.deta
tau = self.tau = surface.tau
tau = surface.tau
rho = self.material.rho
rhoshear = self.shearMaterial.rho
rhocore = self.coreMaterial.rho
Expand Down
4 changes: 2 additions & 2 deletions gpkitmodels/GP/aircraft/wing/gustloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class GustL(SparLoading):
Upper Unbounded
---------------
v, cl, wing.spar.I, wing.spar.tshear, wing.spar.Sy
J (if wingSparJ)
wing.spar.J (if wingSparJ)
theta (if not wingSparJ), M (if not wingSparJ)

Lower Unbounded
---------------
Ww, wing.planform.b, wing.planform.cave
qne (if wingSparJ)
state.qne (if wingSparJ)
theta (if not wingSparJ), M (if not wingSparJ)

LaTex Strings
Expand Down
17 changes: 9 additions & 8 deletions gpkitmodels/GP/aircraft/wing/sparloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class SparLoading(Model):

Upper Unbounded
---------------
I, Sy, J (if wingSparJ)
wing.spar.I, wing.spar.Sy, wing.spar.J (if wingSparJ)
theta (if not wingSparJ), M (if not wingSparJ)

Lower Unbounded
---------------
b, W, cave, qne (if wingSparJ)
wing.planform.b, W, wing.planform.cave, state.qne (if wingSparJ)
theta (if not wingSparJ), M (if not wingSparJ)

LaTex Strings
Expand All @@ -50,16 +50,17 @@ def new_qbarFun(self, c):

def setup(self, wing, state):
self.wing = wing
self.state = state
exec parse_variables(SparLoading.__doc__)

Beam.qbarFun = self.new_qbarFun
Beam.SbarFun = self.new_SbarFun
self.beam = Beam(self.wing.N)

b = self.b = self.wing.planform.b
I = self.I = self.wing.spar.I
Sy = self.Sy = self.wing.spar.Sy
cave = self.cave = self.wing.planform.cave
b = self.wing.planform.b
I = self.wing.spar.I
Sy = self.wing.spar.Sy
cave = self.wing.planform.cave
E = self.wing.spar.material.E
sigma = self.wing.spar.material.sigma
deta = self.wing.planform.deta
Expand All @@ -76,8 +77,8 @@ def setup(self, wing, state):
self.wingSparJ = hasattr(self.wing.spar, "J")

if self.wingSparJ:
qne = self.qne = state.qne
J = self.J = self.wing.spar.J
qne = state.qne
J = self.wing.spar.J
G = self.wing.spar.shearMaterial.G
cm = self.wing.planform.CM
constraints.extend([
Expand Down
18 changes: 11 additions & 7 deletions gpkitmodels/GP/aircraft/wing/wing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ class WingAero(Model):

Upper Unbounded
---------------
Cd, Re, AR, cmac, V, rho (if not rhovalue)
Cd, Re
static.planform.AR, static.planform.cmac
state.V, state.rho (if not rhovalue)

Lower Unbounded
---------------
cmac, V, rho (if not rhovalue)
static.planform.cmac
state.V, state.rho (if not rhovalue)

LaTex Strings
-------------
Expand All @@ -117,18 +120,19 @@ class WingAero(Model):
"""
def setup(self, static, state,
fitdata=dirname(abspath(__file__)) + sep + "jho_fitdata.csv"):
self.static = static
self.state = state
exec parse_variables(WingAero.__doc__)

df = pd.read_csv(fitdata)
fd = df.to_dict(orient="records")[0]

AR = self.AR = static.planform.AR
cmac = self.cmac = static.planform.cmac
rho = self.rho = state.rho
AR = static.planform.AR
cmac = static.planform.cmac
rho = state.rho
self.rhovalue = rho.key.value
V = self.V = state.V
mu = self.mu = state.mu
V = state.V
mu = state.mu

if fd["d"] == 2:
independentvars = [self.CL, self.Re]
Expand Down
7 changes: 4 additions & 3 deletions gpkitmodels/GP/aircraft/wing/wing_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class WingCore(Model):

Lower Unbounded
---------------
cave, b
surface.cave, surface.b

LaTex Strings
-------------
Expand All @@ -30,10 +30,11 @@ class WingCore(Model):
material = foamhd

def setup(self, surface):
self.surface = surface
exec parse_variables(WingCore.__doc__)

cave = self.cave = surface.cave
b = self.b = surface.b
cave = surface.cave
b = surface.b
deta = surface.deta
rho = self.material.rho

Expand Down
14 changes: 8 additions & 6 deletions gpkitmodels/GP/aircraft/wing/wing_skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class WingSkin(Model):

Upper Unbounded
---------------
W, croot
W, surface.croot

Lower Unbounded
---------------
S
surface.S

LaTex Strings
-------------
Expand All @@ -36,10 +36,11 @@ class WingSkin(Model):
material = cfrpfabric

def setup(self, surface):
self.surface = surface
exec parse_variables(WingSkin.__doc__)

croot = self.croot = surface.croot
S = self.S = surface.S
croot = surface.croot
S = surface.S
rho = self.material.rho
tau = self.material.tau
tmin = self.material.tmin
Expand All @@ -62,7 +63,7 @@ class WingSecondStruct(Model):

Lower Unbounded
---------------
S
surface.S

LaTex Strings
-------------
Expand All @@ -71,8 +72,9 @@ class WingSecondStruct(Model):

"""
def setup(self, surface):
self.surface = surface
exec parse_variables(WingSecondStruct.__doc__)

S = self.S = surface.S
S = surface.S

return [W >= rhoA*S*g]