Skip to content

polykin.flow.prv¤

area_relief_gas ¤

area_relief_gas(
    W: float,
    P1: float,
    P2: float,
    T: float,
    k: float,
    M: float,
    Z: float = 1.0,
    steam: bool = False,
    Kd: float = 0.975,
    Kb: float = 1.0,
    Kc: float = 1.0,
    KSH: float = 1.0,
) -> dict

Calculate the required effective discharge area of a pressure relief device in gas (or vapor) or steam service.

The calculation is done according to the API standard 520.

References

  • Sizing, Selection, and Installation of Pressure-relieving Devices in Refineries: Part I—Sizing and Selection, API Standard 520, 8th ed., 2008.
PARAMETER DESCRIPTION
W

Required relieving mass flow rate (kg/h).

TYPE: float

P1

Relieving pressure, absolute (bara).

TYPE: float

P2

Back pressure, absolute (bara).

TYPE: float

T

Absolute relieving temperature of the gas at the valve inlet (K).

TYPE: float

k

Ideal gas specific heat ratio at relieving temperature.

TYPE: float

M

Molar mass of gas (g/mol).

TYPE: float

Z

Compressibility factor of the gas at relieving pressure and temperature. If a calculated value is not available, use Z=1.0, which leads to a conservative estimate of the discharge area.

TYPE: float DEFAULT: 1.0

steam

Flag for steam service. A special calculation is used for devices in steam service that operate at critical (sonic) flow conditions.

TYPE: bool DEFAULT: False

Kd

Effective discharge coefficient. Use Kd=0.975 when sizing a PRV and Kd=0.62 when sizing a rupture disk without PRV.

TYPE: float DEFAULT: 0.975

Kb

Backpressure correction factor for balanced bellows valves.

TYPE: float DEFAULT: 1.0

Kc

Combination correction factor for installations with a rupture disk upstream of the PRV. Use Kc=1.0 if there is no rupture disk, and Kc=0.9 if there is a rupture disk.

TYPE: float DEFAULT: 1.0

KSH

Steam superheat correction factor, equal to 1.0 for saturated steam.

TYPE: float DEFAULT: 1.0

RETURNS DESCRIPTION
dict

Dictionary of results, including the critical flow nozzle pressure Pcf (bara), the flow condition critical_flow (bool), and the effective discharge area A (mm²).

Examples:

Estimate the required discharge area of a pressure relief valve in gas service, using the API standard 520. The required flow is 24270 kg/h, the relieving pressure is 6.7 bara, the back pressure is 0 barg, the relieving temperature is 348 K, the gas specific heat ratio is 1.11, the gas molar mass is 51 g/mol, and the compressibility factor is 0.9.

>>> from polykin.flow import area_relief_gas
>>> res = area_relief_gas(W=24270, P1=6.7, P2=1.01325,
...                       T=348, k=1.11, M=51, Z=0.9)
>>> print(f"Effective discharge area: {res['A']:.0f} mm²")
Effective discharge area: 3699 mm²
Source code in src/polykin/flow/prv.py
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
def area_relief_gas(W: float,
                    P1: float,
                    P2: float,
                    T: float,
                    k: float,
                    M: float,
                    Z: float = 1.0,
                    steam: bool = False,
                    Kd: float = 0.975,
                    Kb: float = 1.0,
                    Kc: float = 1.0,
                    KSH: float = 1.0
                    ) -> dict:
    r"""Calculate the required effective discharge area of a pressure relief
    device in gas (or vapor) or steam service. 

    The calculation is done according to the API standard 520.

    **References**

    * Sizing, Selection, and Installation of Pressure-relieving Devices in
      Refineries: Part I—Sizing and Selection, API Standard 520, 8th ed., 2008.

    Parameters
    ----------
    W : float
        Required relieving mass flow rate (kg/h).
    P1 : float
        Relieving pressure, absolute (bara).
    P2 : float
        Back pressure, absolute (bara).
    T : float
        Absolute relieving temperature of the gas at the valve inlet (K).
    k : float
        Ideal gas specific heat ratio at relieving temperature.
    M : float
        Molar mass of gas (g/mol).
    Z : float
        Compressibility factor of the gas at relieving pressure and temperature.
        If a calculated value is not available, use `Z=1.0`, which leads to a 
        conservative estimate of the discharge area. 
    steam : bool
        Flag for steam service. A special calculation is used for devices in
        steam service that operate at critical (sonic) flow conditions.
    Kd: float
        Effective discharge coefficient. Use `Kd=0.975` when sizing a PRV and
        `Kd=0.62` when sizing a rupture disk without PRV.
    Kb : float
        Backpressure correction factor for balanced bellows valves.
    Kc : float
        Combination correction factor for installations with a rupture disk
        upstream of the PRV. Use `Kc=1.0` if there is no rupture disk, and
        `Kc=0.9` if there is a rupture disk.
    KSH : float
        Steam superheat correction factor, equal to 1.0 for saturated steam.

    Returns
    -------
    dict
        Dictionary of results, including the critical flow nozzle pressure 
        `Pcf` (bara), the flow condition `critical_flow` (bool), and the 
        effective discharge area `A` (mm²).

    Examples
    --------
    Estimate the required discharge area of a pressure relief valve in gas 
    service, using the API standard 520. The required flow is 24270 kg/h, the
    relieving pressure is 6.7 bara, the back pressure is 0 barg, the relieving
    temperature is 348 K, the gas specific heat ratio is 1.11, the gas molar
    mass is 51 g/mol, and the compressibility factor is 0.9.
    >>> from polykin.flow import area_relief_gas
    >>> res = area_relief_gas(W=24270, P1=6.7, P2=1.01325,
    ...                       T=348, k=1.11, M=51, Z=0.9)
    >>> print(f"Effective discharge area: {res['A']:.0f} mm²")
    Effective discharge area: 3699 mm²
    """

    # Convert pressures from bar to kPa
    P1 *= 1e2
    P2 *= 1e2

    # Critical flow nozzle pressure
    Pcf = P1 * (2/(k + 1))**(k/(k - 1))
    critical_flow = (P2 <= Pcf)

    if critical_flow:
        if steam:
            if P1 <= 10339.0:
                KN = 1.0
            elif P1 < 22057.0:
                KN = (0.02764*P1 - 1000)/(0.03324*P1 - 1061)
            else:
                raise ValueError('`P1` out of range.')
            A = 190.5*W/(P1*Kd*Kb*Kc*KN*KSH)
        else:
            C = 0.03948*sqrt(k*(2/(k + 1))**((k + 1)/(k - 1)))
            A = W/(C*Kd*P1*Kb*Kc)*sqrt(T*Z/M)
    else:
        r = P2/P1
        F2 = sqrt((k/(k - 1))*r**(2/k) * ((1 - r**((k - 1)/k))/(1 - r)))
        A = 17.9*W/(F2*Kd*Kc)*sqrt(T*Z/(M*P1*(P1 - P2)))

    result = {
        'Pcf': Pcf,  # kPa
        'critical_flow': critical_flow,
        'A': A  # mm²
    }

    return result