IS_CHOKED_GAS

Overview

The IS_CHOKED_GAS function determines if the gas flow through a control valve is choked (critical). Choked flow occurs when the velocity of the gas reaches the speed of sound at the vena contracta, preventing further flow increase with decreasing downstream pressure.

The condition is checked using the differential pressure ratio x, the specific heat ratio factor Fgamma, and the critical pressure ratio factor xT (or xTP if fittings are present).

This implementation uses the fluids library.

This example function is provided as-is without any representation of accuracy.

Excel Usage

=IS_CHOKED_GAS(x, Fgamma, xT, xTP)
  • x (float, required): Differential pressure ratio (dP/P1) [-]
  • Fgamma (float, required): Specific heat ratio factor [-]
  • xT (float, optional, default: null): Pressure difference ratio factor of a valve without fittings [-]
  • xTP (float, optional, default: null): Pressure difference ratio factor of a valve with fittings [-]

Returns (bool): True if flow is choked (critical), False otherwise.

Examples

Example 1: Non-choked flow example

Inputs:

x Fgamma xT
0.544 0.929 0.6

Excel formula:

=IS_CHOKED_GAS(0.544, 0.929, 0.6)

Expected output:

false

Example 2: Choked flow example

Inputs:

x Fgamma xT
0.6 0.929 0.6

Excel formula:

=IS_CHOKED_GAS(0.6, 0.929, 0.6)

Expected output:

true

Example 3: Non-choked with fittings

Inputs:

x Fgamma xTP
0.544 0.929 0.625

Excel formula:

=IS_CHOKED_GAS(0.544, 0.929, 0.625)

Expected output:

false

Example 4: Choked with fittings

Inputs:

x Fgamma xTP
0.8 0.929 0.625

Excel formula:

=IS_CHOKED_GAS(0.8, 0.929, 0.625)

Expected output:

true

Python Code

import micropip
await micropip.install(["fluids"])
from fluids.control_valve import is_choked_turbulent_g as fluids_is_choked

def is_choked_gas(x, Fgamma, xT=None, xTP=None):
    """
    Determines if a gas flow in a control valve is choked (critical) or not according to IEC 60534.

    See: https://fluids.readthedocs.io/fluids.control_valve.html#fluids.control_valve.is_choked_turbulent_g

    This example function is provided as-is without any representation of accuracy.

    Args:
        x (float): Differential pressure ratio (dP/P1) [-]
        Fgamma (float): Specific heat ratio factor [-]
        xT (float, optional): Pressure difference ratio factor of a valve without fittings [-] Default is None.
        xTP (float, optional): Pressure difference ratio factor of a valve with fittings [-] Default is None.

    Returns:
        bool: True if flow is choked (critical), False otherwise.
    """
    # Validate inputs
    try:
        x = float(x)
        Fgamma = float(Fgamma)

        if xT is not None:
            xT = float(xT)
        if xTP is not None:
            xTP = float(xTP)
    except (ValueError, TypeError):
        return "Error: All inputs must be numbers."

    if x < 0:
        return "Error: Differential pressure ratio must be non-negative."
    if Fgamma <= 0:
        return "Error: Fgamma must be positive."

    # Ensure at least one critical pressure ratio is provided
    if xT is None and xTP is None:
        return "Error: Either xT or xTP must be provided."

    try:
        return fluids_is_choked(x=x, Fgamma=Fgamma, xT=xT, xTP=xTP)
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator