Skip to content

Commit

Permalink
Add prop structure and performance models
Browse files Browse the repository at this point in the history
  • Loading branch information
courtin committed Mar 19, 2018
1 parent a06db84 commit f30e2ea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
5 changes: 3 additions & 2 deletions gpkitmodels/GP/aircraft/prop/prop_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def eta_test():
p = Propeller(fs)
p.substitutions[p.T] = 100
p.cost = 1/p.eta
p.solve()
sol = p.solve()
print sol.table()

def qprop_test():

Expand All @@ -23,7 +24,7 @@ def qprop_test():
def test():
"tests"
eta_test()
qprop_test()
#qprop_test()

if __name__ == "__main__":
test()
Expand Down
23 changes: 19 additions & 4 deletions gpkitmodels/GP/aircraft/prop/propeller.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
" propeller model "
from numpy import pi
from gpkit import Model, parse_variables
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality

class Propeller(Model):
""" Propeller Model
Variables
---------
R 10 [m] prop radius
"""
def setup(self):
exec parse_variables(Propeller.__doc__)

def performance(state):
return Propeller_Performance(self, state)

class Propeller_Performance(Model):
""" Propeller Model
Variables
---------
T [N] thrust
Tc [-] coefficient of thrust
R 0.3 [m] prop radius
etaadd 0.7 [-] swirl and nonuniformity losses
etav 0.85 [-] viscous losses
etai [-] inviscid losses
Expand All @@ -27,8 +40,10 @@ def setup(self, state):

V = state.V
rho = state.rho


return [eta <= etav*etai,
constraints = [eta <= etav*etai,
Tc == T/(0.5*rho*V**2*pi*R**2),
z2 >= 1 + Tc,
z2 >= Tc + 1,
etai*(z1 + z2**0.5/etaadd) <= 2]
return constraints

0 comments on commit f30e2ea

Please sign in to comment.