-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prop #157
Merged
Merged
Prop #157
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ca4d658
initial propeller efficiency model
875e650
modify tests
a06db84
initial qprop
f30e2ea
Add prop structure and performance models
courtin 129cd22
Add prop structure and performance models
courtin eb7c39d
Updated propeller to base and performance class
courtin 9bfa23c
update units tests to include prop model
4d2da32
Merge branch 'prop' of https://github.com/convexengineering/library i…
3b2c57b
Changes per mike's review
courtin 1840d3e
Merge branch 'prop' of github.com:convexengineering/gplibrary into prop
courtin 195883c
small changes
602606f
remove qprop
0b3c8ae
Merge branch 'master' into prop
c47db82
add static model in
05cbb85
add missing __init__.py
bqpd 210802e
update prop unit test
db5e4cb
add fit csvs to setup.py (#159)
bqpd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
gpkitmodels/GP/aircraft/wing/wing_test.py | ||
gpkitmodels/GP/aircraft/tail/tail_tests.py | ||
gpkitmodels/GP/aircraft/fuselage/test_fuselage.py | ||
gpkitmodels/GP/aircraft/prop/prop_test.py |
Empty file.
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,21 @@ | ||
" propeller tests " | ||
from gpkitmodels.GP.aircraft.prop.propeller import Propeller | ||
from gpkitmodels.GP.aircraft.wing.wing_test import FlightState | ||
from gpkit import Model | ||
|
||
def simpleprop_test(): | ||
" test simple propeller model " | ||
fs = FlightState() | ||
p = Propeller() | ||
pp = p.flight_model(p, fs) | ||
m = Model(1/pp.eta, [fs, p, pp]) | ||
m.substitutions.update({"rho": 1.225, "V": 50, "T": 100}) | ||
m.solve() | ||
|
||
def test(): | ||
"tests" | ||
simpleprop_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,56 @@ | ||
" propeller model " | ||
from numpy import pi | ||
from gpkit import Model, parse_variables | ||
|
||
class Propeller_Performance(Model): | ||
""" Propeller Model | ||
|
||
Variables | ||
--------- | ||
T [N] thrust | ||
Tc [-] coefficient of thrust | ||
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 | ||
lam [-] advance ratio | ||
CT [-] thrust coefficient | ||
CP [-] power coefficient | ||
Q [N*m] torque | ||
omega [rpm] propeller rotation rate | ||
|
||
""" | ||
|
||
def helper(self, c): | ||
" helper function to avoid signomial constraint " | ||
return 2. - 1./c[self.etaadd] | ||
|
||
def setup(self, static, state): | ||
exec parse_variables(Propeller_Performance.__doc__) | ||
|
||
V = state.V | ||
rho = state.rho | ||
R = static.R | ||
|
||
return [eta <= etav*etai, | ||
Tc == T/(0.5*rho*V**2*pi*R**2), | ||
z2 >= Tc + 1, | ||
etai*(z1 + z2**0.5/etaadd) <= 2, | ||
], static | ||
|
||
class Propeller(Model): | ||
""" Propeller Model | ||
|
||
Variables | ||
--------- | ||
R 1 [m] prop radius | ||
|
||
""" | ||
#TODO add weight model | ||
flight_model = Propeller_Performance | ||
|
||
def setup(self): | ||
exec parse_variables(Propeller.__doc__) | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great to have bounds as well!