Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions motorlib/nozzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
from .simResult import SimAlert, SimAlertLevel, SimAlertType
from .constants import maximumRefDiameter, maximumRefLength

def eRatioFromPRatio(k, pRatio):
"""Returns the expansion ratio of a nozzle given the pressure ratio it causes."""
def eRatioFromPRatio(k: float, pRatio: float) -> float:
"""
Returns the expansion ratio of a nozzle given the pressure ratio it causes.

Args:
k (float): ratio of specific heats (also known as the adiabatic index or heat capacity ratio)
pRatio (float): nozzle exit plane pressure at to stagnation pressure ratio

Returns:
float: Optimum expansion ratio
"""
return (((k+1)/2)**(1/(k-1))) * (pRatio ** (1/k)) * ((((k+1)/(k-1))*(1-(pRatio**((k-1)/k))))**0.5)

class Nozzle(PropertyCollection):
Expand Down
Loading