Skip to content

Commit

Permalink
Added multiple blade element model
Browse files Browse the repository at this point in the history
  • Loading branch information
courtin committed Apr 11, 2018
1 parent b9cbe7d commit 35dc0f2
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 28 deletions.
27 changes: 24 additions & 3 deletions gpkitmodels/GP/aircraft/motor/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ElecMotor(Model):
Qstar 1 [kg/(N*m)] motor specific torque
W [lbf] motor weight
Qmax [N*m] motor max. torque
V_max 300 [V] motor max voltage
V_max 300 [V] motor max voltage
"""

Expand Down Expand Up @@ -75,7 +75,7 @@ def setup(self, parent,state):
exec parse_variables(Propulsor_Performance.__doc__)
self.prop = parent.prop.flight_model(parent.prop,state)
self.motor = parent.motor.flight_model(parent.motor,state)
self.stat_FS = FlightState()
#self.stat_FS = FlightState()
#self.stat_FS.substitutions[V_static]
#self.stat_prop = parent.prop.flight_model(stat_FS)

Expand All @@ -85,7 +85,7 @@ def setup(self, parent,state):
self.prop.omega == self.motor.omega
]

return constraints, self.components, self.stat_FS
return constraints, self.components#, self.stat_FS

class Propulsor(Model):
"""Propulsor model
Expand All @@ -109,4 +109,25 @@ def setup(self):

return [self.W >= self.prop.W + self.motor.W], components

class Actuator_Propulsor(Model):
"""Propulsor model
Variables
---------
W [lbf] propulsor weight
"""
flight_model = Propulsor_Performance

def setup(self):
exec parse_variables(Propulsor.__doc__)

#self.prop = Actuator_Propeller()
self.prop = Actuator_Propeller()
self.motor = ElecMotor()

components = [self.prop, self.motor]

return [self.W >= self.prop.W + self.motor.W], components


29 changes: 26 additions & 3 deletions gpkitmodels/GP/aircraft/motor/motor_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from gpkit import Model, parse_variables, SignomialsEnabled, SignomialEquality, units
from motor import Propulsor, ElecMotor, ElecMotor_Performance
from motor import Actuator_Propulsor,Propulsor, ElecMotor, ElecMotor_Performance
from gpkitmodels.GP.aircraft.prop.propeller import Actuator_Propeller
from gpkitmodels.GP.aircraft.wing.wing_test import FlightState

Expand All @@ -17,6 +17,27 @@ def setup(self):

return fs,p,pp

class Actuator_Propulsor_Test(Model):
"""Propulsor Test Model
"""

def setup(self):
fs = FlightState()
p = Actuator_Propulsor()
pp = p.flight_model(p,fs)
pp.substitutions[pp.prop.T] = 100
#pp.substitutions[pp.prop.AR_b] = 15
self.cost = 1./pp.motor.etam + p.W/(1000*units('lbf')) + 1./pp.prop.eta

return fs,p,pp
def actuator_propulsor_test():

test = Actuator_Propulsor_Test()
#sol = test.debug()
sol = test.solve()
#sol = test.solve()
print sol.table()

def propulsor_test():

test = Propulsor_Test()
Expand Down Expand Up @@ -96,7 +117,7 @@ def motor_test():
sol = test.solve()
#sol = test.debug()

#print sol.table()
print sol.table()

def motor_eta_speed():
test = Motor_P_Test()
Expand All @@ -116,8 +137,10 @@ def motor_eta_speed():
print sol.table()

def test():
motor_test()
#motor_test()
#actuator_propulsor_test()
propulsor_test()


if __name__ == "__main__":
test()
Expand Down
22 changes: 20 additions & 2 deletions gpkitmodels/GP/aircraft/prop/prop_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" propelle tests "
from propeller import Actuator_Propeller
from propeller import One_Element_Propeller
from propeller import One_Element_Propeller, Multi_Element_Propeller
from gpkit import units
#from qprop import QProp
from gpkitmodels.GP.aircraft.wing.wing_test import FlightState
Expand Down Expand Up @@ -28,6 +28,23 @@ def OE_eta_test():
#sol = pp.debug()
print sol.table()

def ME_eta_test():

fs = FlightState()
p = Multi_Element_Propeller()
p.substitutions[p.T_m] = 100
p.substitutions[p.R] = 2
pp = p.flight_model(p,fs)
pp.substitutions[pp.T] = 100

#pp.substitutions[pp.omega] = 500

#pp.substitutions[pp.omega] = 1000
pp.cost = 1./pp.eta + pp.Q/(100.*units("N*m"))
sol = pp.localsolve(iteration_limit = 400)
#sol = pp.debug()
print sol.table()

#def qprop_test():
#
# fs = FlightState()
Expand All @@ -40,7 +57,8 @@ def OE_eta_test():
def test():
"tests"
#eta_test()
OE_eta_test()
#OE_eta_test()
ME_eta_test()
#qprop_test()

if __name__ == "__main__":
Expand Down
Loading

0 comments on commit 35dc0f2

Please sign in to comment.