-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mjburton
committed
Feb 23, 2018
1 parent
5c432bc
commit ca4d658
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from propeller import Propeller | ||
from gpkitmodels.GP.aircraft.wing.wing_test import FlightState | ||
|
||
def eta_test(): | ||
|
||
fs = FlightState() | ||
p = Propeller(fs) | ||
p.substitutions[p.T] = 100 | ||
p.cost = 1/p.eta | ||
sol = p.solve() | ||
print sol.table() | ||
|
||
def test(): | ||
"tests" | ||
eta_test() | ||
|
||
if __name__ == "__main__": | ||
test() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
" propeller model " | ||
from numpy import pi | ||
from gpkit import Model, parse_variables | ||
|
||
class Propeller(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 | ||
eta [-] overall efficiency | ||
z1 self.helper [-] efficiency helper 1 | ||
z2 [-] efficiency helper 2 | ||
""" | ||
|
||
def helper(self, c): | ||
return 2. - 1./c[self.etaadd] | ||
|
||
def setup(self, state): | ||
exec parse_variables(Propeller.__doc__) | ||
|
||
V = state.V | ||
rho = state.rho | ||
|
||
return [eta <= etav*etai, | ||
Tc == T/(0.5*rho*V**2*pi*R**2), | ||
z2 >= 1 + Tc, | ||
etai*(z1 + z2**0.5/etaadd) <= 2] |