core.compressible_flow¶
machwave.core.compressible_flow
¶
Compressible flow theory and analysis.
apply_thrust_coefficient_correction(ideal_thrust_coefficient, nozzle_correction_factor)
¶
Apply nozzle efficiency correction to thrust coefficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ideal_thrust_coefficient
|
float
|
Ideal thrust coefficient. |
required |
nozzle_correction_factor
|
float
|
Nozzle efficiency (0-1). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Corrected thrust coefficient. |
Source code in machwave/core/compressible_flow/nozzle.py
get_boundary_layer_percentage_loss(chamber_pressure_psi, throat_diameter_inch, expansion_ratio, time, c_1, c_2)
¶
Boundary layer correction factor accounts for the decrement in performance due to the viscous and heat transfer effects in the nozzle walls. It is time dependent.
Valid for liquid, solid, and hybrid propellants.
The time dependence is exponential due to the transient heat up, important in motors with short burn durations (less than 4 seconds). Dependence on expansion ratio represents the effect of a the amount of nozzle surface area.
Time constant C2 comes from analysis of a the transient heating of a BATES motor.
Time constant C1 was obtained from a direct measurement of the heat loss in a BATES motor, among other things.
Ordinary nozzle: C1 = 0.003650 C2 = 0.000937
Solid steel nozzle with relatively thick walls: C1 = 0.005060 C2 = 0.000000
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure_psi
|
float
|
The chamber pressure [psi]. |
required |
throat_diameter_inch
|
float
|
The throat diameter [in]. |
required |
expansion_ratio
|
float
|
The expansion ratio of the nozzle. |
required |
time
|
float
|
The time in seconds [s]. |
required |
c_1
|
float
|
Coefficient for the boundary layer correction factor. |
required |
c_2
|
float
|
Coefficient for the boundary layer correction factor. |
required |
Returns: The boundary layer correction factor.
Source code in machwave/core/compressible_flow/losses.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)
¶
Get exit Mach number from expansion ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
float
|
Isentropic exponent. |
required |
expansion_ratio
|
float
|
Expansion ratio (A_exit / A_throat). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Exit Mach number. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If solver fails to converge. |
Source code in machwave/core/compressible_flow/isentropic.py
get_exit_pressure(k_ex, expansion_ratio, chamber_pressure)
¶
Get exit pressure from isentropic relations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k_ex
|
float
|
Isentropic exponent at exit. |
required |
expansion_ratio
|
float
|
Expansion ratio. |
required |
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
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(chamber_pressure, exit_pressure, external_pressure, expansion_ratio, k_ex)
¶
Get ideal thrust coefficient for DeLaval nozzle.
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_ex
|
float
|
Isentropic exponent at exit. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Ideal thrust coefficient. |
References
https://www.nakka-rocketry.net/th_thrst.html
Source code in machwave/core/compressible_flow/nozzle.py
get_kinetics_percentage_loss(i_sp_th_frozen, i_sp_th_shifting, chamber_pressure_psi)
¶
The kinetics correction factor accounts for the decrement in performance due to incomplete heat transfer of latent heat to sensible heat caused by the finite time required for the gas phase chemical reactions to occur.
Valid for liquid, solid, and hybrid propellants. The expansion ratio of the i_sp_th_frozen and i_sp_th_shifting should be the same.
Pressure correction is applied for chamber pressures above 1.379 MPa (200 psi), in order to dampen the effect of the kinetics correction factor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i_sp_th_frozen
|
float
|
The specific impulse of the frozen flow [s]. |
required |
i_sp_th_shifting
|
float
|
The specific impulse of the shifting flow [s]. |
required |
chamber_pressure_psi
|
float
|
The chamber pressure [psi]. |
required |
Returns: The kinetics correction factor.
Source code in machwave/core/compressible_flow/losses.py
get_nozzle_divergent_percentage_loss(divergent_angle)
¶
Calculates the divergent nozzle correction factor given the half angle. NOTE: only applicable for a conical convergent-divergent nozzle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
divergent_angle
|
float
|
The half angle of the divergent nozzle. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The divergent correction factor. |
Source code in machwave/core/compressible_flow/losses.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_overall_nozzle_efficiency(eta_div, eta_kin, eta_bl, eta_2p, other_losses=OTHER_LOSSES_DEFAULT)
¶
Calculates the overall nozzle efficiency by combining the correction factors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eta_div
|
float
|
The divergent nozzle correction factor. |
required |
eta_kin
|
float
|
The kinetics correction factor. |
required |
eta_bl
|
float
|
The boundary layer correction factor. |
required |
eta_2p
|
float
|
The two-phase flow correction factor. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The overall nozzle efficiency. |
Source code in machwave/core/compressible_flow/losses.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
get_two_phase_flow_percentage_loss(chamber_pressure_psi, mole_fraction_of_condensed_phase, expansion_ratio, throat_diameter_inch, characteristic_length_inch)
¶
Two-phase flow correction factor accounts for the decrement in performance due to the presence of a condensed phase in the combustion products.
Valid for solid, and hybrid propellants.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure_psi
|
float
|
The chamber pressure [psi]. |
required |
mole_fraction_of_condensed_phase
|
float
|
The mole fraction of the condensed phase [moles/100g]. |
required |
expansion_ratio
|
float
|
The expansion ratio of the nozzle. |
required |
throat_diameter_inch
|
float
|
The throat diameter [in]. |
required |
characteristic_length_inch
|
float
|
The characteristic length [in]. |
required |
Returns: The two-phase flow correction factor.
Source code in machwave/core/compressible_flow/losses.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. |