From ca2a9b9df597269e4f0b7f3d5c954998a5f2e53f Mon Sep 17 00:00:00 2001 From: aka_rev0 Date: Sat, 9 May 2026 21:24:14 +0300 Subject: [PATCH] Optimum expansion ration documentation update --- motorlib/nozzle.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/motorlib/nozzle.py b/motorlib/nozzle.py index 4b93ea0..cefebcc 100644 --- a/motorlib/nozzle.py +++ b/motorlib/nozzle.py @@ -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):