CV_CHOKE_PRESS_GAS
Solves for either upstream or downstream pressure at the choking limit for gas flow through a control valve.
The governing relationships are:
P_1 = -\frac{7P_2}{5\gamma x_T - 7}, \quad P_2 = \frac{P_1}{7}(-5\gamma x_T + 7)
Provide one pressure (p_inlet or p_outlet) with x_T and \gamma to compute the corresponding choked pressure.
Excel Usage
=CV_CHOKE_PRESS_GAS(xt_factor, gamma, p_inlet, p_outlet)
xt_factor(float, required): Pressure difference ratio factor (-)gamma(float, required): Specific heat capacity ratio (-)p_inlet(float, optional, default: null): Inlet pressure (Pa)p_outlet(float, optional, default: null): Outlet pressure (Pa)
Returns (float): Choked pressure (Pa)
Example 1: Docs example (given P1)
Inputs:
| xt_factor | gamma | p_inlet |
|---|---|---|
| 1 | 1.3 | 100000 |
Excel formula:
=CV_CHOKE_PRESS_GAS(1, 1.3, 100000)
Expected output:
7142.86
Example 2: Docs example (given P2)
Inputs:
| xt_factor | gamma | p_outlet |
|---|---|---|
| 1 | 1.3 | 7142.86 |
Excel formula:
=CV_CHOKE_PRESS_GAS(1, 1.3, 7142.86)
Expected output:
100000
Example 3: Air at 1.0 XT
Inputs:
| xt_factor | gamma | p_inlet |
|---|---|---|
| 1 | 1.4 | 100000 |
Excel formula:
=CV_CHOKE_PRESS_GAS(1, 1.4, 100000)
Expected output:
0
Example 4: Nitrogen at 0.7 XT
Inputs:
| xt_factor | gamma | p_inlet |
|---|---|---|
| 0.7 | 1.4 | 100000 |
Excel formula:
=CV_CHOKE_PRESS_GAS(0.7, 1.4, 100000)
Expected output:
30000
Python Code
Show Code
from fluids.control_valve import control_valve_choke_P_g
def cv_choke_press_gas(xt_factor, gamma, p_inlet=None, p_outlet=None):
"""
Calculates the pressure at which choked flow occurs in a gas control valve.
See: https://fluids.readthedocs.io/fluids.control_valve.html#fluids.control_valve.control_valve_choke_P_g
This example function is provided as-is without any representation of accuracy.
Args:
xt_factor (float): Pressure difference ratio factor (-)
gamma (float): Specific heat capacity ratio (-)
p_inlet (float, optional): Inlet pressure (Pa) Default is None.
p_outlet (float, optional): Outlet pressure (Pa) Default is None.
Returns:
float: Choked pressure (Pa)
"""
try:
xt_factor = float(xt_factor)
gamma = float(gamma)
if p_inlet is not None:
p_inlet = float(p_inlet)
if p_outlet is not None:
p_outlet = float(p_outlet)
if xt_factor <= 0:
return "Error: XT factor must be positive."
if gamma <= 1:
return "Error: Specific heat capacity ratio must be greater than 1."
if p_inlet is None and p_outlet is None:
return "Error: Either inlet pressure or outlet pressure must be provided."
if p_inlet is not None and p_outlet is not None:
return "Error: Provide either inlet pressure or outlet pressure, not both."
return float(control_valve_choke_P_g(xT=xt_factor, gamma=gamma, P1=p_inlet, P2=p_outlet))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
Pressure difference ratio factor (-)
Specific heat capacity ratio (-)
Inlet pressure (Pa)
Outlet pressure (Pa)