From ca4d658e6a30e09a7fd5e5451dd5e79e9a9f7e52 Mon Sep 17 00:00:00 2001 From: mjburton Date: Thu, 22 Feb 2018 21:40:37 -0500 Subject: [PATCH] initial propeller efficiency model --- gpkitmodels/GP/aircraft/prop/prop_test.py | 19 +++++++++++++ gpkitmodels/GP/aircraft/prop/propeller.py | 34 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 gpkitmodels/GP/aircraft/prop/prop_test.py create mode 100644 gpkitmodels/GP/aircraft/prop/propeller.py diff --git a/gpkitmodels/GP/aircraft/prop/prop_test.py b/gpkitmodels/GP/aircraft/prop/prop_test.py new file mode 100644 index 00000000..247f4b01 --- /dev/null +++ b/gpkitmodels/GP/aircraft/prop/prop_test.py @@ -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() + diff --git a/gpkitmodels/GP/aircraft/prop/propeller.py b/gpkitmodels/GP/aircraft/prop/propeller.py new file mode 100644 index 00000000..3802a426 --- /dev/null +++ b/gpkitmodels/GP/aircraft/prop/propeller.py @@ -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]