core.compressible_flow¶
Compressible flow relations for convergent-divergent nozzle analysis.
- Isentropic flow — Critical pressure ratio, exit Mach from expansion ratio, exit pressure, choked-flow detection.
- Nozzle performance — Ideal and corrected thrust coefficient (Cf), optimal expansion ratio for a given altitude, effective exit conditions under overexpanded flow separation, thrust from Cf.
machwave.core.compressible_flow
¶
Compressible flow theory and analysis.
FlowBranch
¶
Bases: StrEnum
Branch of the area-Mach relation that a solution is taken from.
Source code in machwave/core/compressible_flow/isentropic.py
get_critical_pressure_ratio(k)
¶
Get critical pressure ratio for choked flow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
float
|
Isentropic exponent. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Critical pressure ratio. |
get_exit_mach_from_expansion_ratio(k, expansion_ratio, branch=FlowBranch.SUPERSONIC)
¶
Get exit Mach number from expansion ratio.
Every expansion ratio above unity satisfies the area-Mach relation at one subsonic and one supersonic Mach number. The supersonic root is returned by default, which is the started nozzle flowing full. A nozzle that is not started carries a normal shock in its divergent section and leaves subsonically, so its physical root is the subsonic one and has to be asked for explicitly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
float
|
Isentropic exponent. |
required |
expansion_ratio
|
float
|
Expansion ratio (A_exit / A_throat). |
required |
branch
|
FlowBranch
|
Branch of the area-Mach relation to solve on. |
SUPERSONIC
|
Returns:
| Type | Description |
|---|---|
float
|
Exit Mach number. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the expansion ratio lies outside the range the branch covers. |
Source code in machwave/core/compressible_flow/isentropic.py
get_exit_pressure(k_exhaust, expansion_ratio, chamber_pressure, branch=FlowBranch.SUPERSONIC)
¶
Get exit pressure from isentropic relations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k_exhaust
|
float
|
Isentropic exponent at exit. |
required |
expansion_ratio
|
float
|
Expansion ratio. |
required |
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
branch
|
FlowBranch
|
Branch of the area-Mach relation to solve the exit Mach number on. |
SUPERSONIC
|
Returns:
| Type | Description |
|---|---|
float
|
Exit pressure [Pa]. |
Source code in machwave/core/compressible_flow/isentropic.py
get_expansion_ratio_from_exit_mach(mach, k)
¶
Get expansion ratio from exit Mach number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mach
|
float
|
Mach number. |
required |
k
|
float
|
Isentropic exponent. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Expansion ratio (A / A_throat). |
Source code in machwave/core/compressible_flow/isentropic.py
get_ideal_thrust_coefficient_terms(chamber_pressure, exit_pressure, external_pressure, expansion_ratio, k_exhaust)
¶
Get the momentum and pressure terms of the ideal thrust coefficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
exit_pressure
|
float
|
Exit pressure [Pa]. |
required |
external_pressure
|
float
|
External pressure [Pa]. |
required |
expansion_ratio
|
float
|
Expansion ratio. |
required |
k_exhaust
|
float
|
Isentropic exponent at exit. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Momentum term then pressure term. The pressure term is positive when under |
float
|
expanded and negative when over expanded. |
References
https://www.nakka-rocketry.net/th_thrst.html
Source code in machwave/core/compressible_flow/nozzle.py
get_maximum_expansion_ratio(k, branch)
¶
Get the largest expansion ratio the exit Mach solver resolves on a branch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
float
|
Isentropic exponent. |
required |
branch
|
FlowBranch
|
Branch of the area-Mach relation. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Expansion ratio at the Mach limit of the branch. |
Source code in machwave/core/compressible_flow/isentropic.py
get_optimal_expansion_ratio(k, chamber_pressure, atmospheric_pressure)
¶
Get optimal expansion ratio for DeLaval nozzle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
float
|
Isentropic exponent. |
required |
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
atmospheric_pressure
|
float
|
External pressure [Pa]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Optimal expansion ratio. |
Source code in machwave/core/compressible_flow/nozzle.py
get_separated_exit_conditions(k_exhaust, expansion_ratio, chamber_pressure, external_pressure, separation_pressure_ratio)
¶
Get the effective exit conditions accounting for flow separation.
The model implemented is based on the work of Summerfield et al. (1954) and assumes that flow separation occurs when the exit pressure is below a certain fraction of the ambient pressure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k_exhaust
|
float
|
Isentropic exponent at exit. |
required |
expansion_ratio
|
float
|
Geometric expansion ratio. |
required |
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
external_pressure
|
float
|
Ambient pressure [Pa]. |
required |
separation_pressure_ratio
|
float
|
Separation-to-ambient pressure ratio. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Effective expansion ratio and effective exit pressure [Pa]. The effective |
float
|
expansion ratio never falls below the throat value of unity. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the geometric expansion ratio lies outside the range the supersonic branch of the area-Mach relation covers. |
References
Summerfield, M., Foster, C. R., & Swan, W. C. (1954). Flow separation in overexpanded supersonic exhaust nozzles.
Source code in machwave/core/compressible_flow/nozzle.py
get_thrust_from_thrust_coefficient(thrust_coefficient, chamber_pressure, nozzle_throat_area)
¶
Get thrust from thrust coefficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thrust_coefficient
|
float
|
Thrust coefficient. |
required |
chamber_pressure
|
float
|
Chamber stagnation pressure [Pa]. |
required |
nozzle_throat_area
|
float
|
Nozzle throat area [m^2]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Thrust [N]. |
Source code in machwave/core/compressible_flow/nozzle.py
is_flow_choked(chamber_pressure, external_pressure, critical_pressure_ratio)
¶
Check if flow is choked.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
external_pressure
|
float
|
External pressure [Pa]. |
required |
critical_pressure_ratio
|
float
|
Critical pressure ratio. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if flow is choked, False otherwise. |