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,
) -> PRVResult

Calculate the required effective discharge area of a pressure relief device in gas or steam service (single-phase flow).

The calculation is done according to the API standard 520. No distinction is made between gas and vapor (synomyms in this context).

The calculation method relies on assumptions whose validity diminishes as the gas approaches the critical point. Typically, the reduced volume of the relieving gas should be greater than 2.0.

References

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

Required relieving mass flow rate (kg/h).

TYPE: float

P1

Upstream relieving pressure, absolute (bara).

TYPE: float

P2

Downstream 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. The value can be obtained from the manufacturer or estimated with the help of Figure 31 of the API standard 520.

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. Use KSH=1.0 for saturated steam. For superheated steam, the value can be obtained from Tables 12 or 13 of the API standard 520.

TYPE: float DEFAULT: 1.0

RETURNS DESCRIPTION
PRVResult

Dataclass containing the results of the calculation.

Examples:

Estimate the required discharge area of a pressure relief valve in gas service, according to 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
>>> area_relief_gas(W=24270, P1=6.7, P2=1.01325, T=348, k=1.11, M=51, Z=0.9)
PRVResult(Pcf=3.90e+00 bara, critical_flow=True, A=3.70e+03 mm²)
Source code in src/polykin/flow/prv.py
 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
                    ) -> PRVResult:
    r"""Calculate the required effective discharge area of a pressure relief
    device in gas or steam service (single-phase flow). 

    The calculation is done according to the API standard 520. No distinction 
    is made between gas and vapor (synomyms in this context). 

    The calculation method relies on assumptions whose validity diminishes as 
    the gas approaches the critical point. Typically, the reduced volume of the
    relieving gas should be greater than 2.0.

    **References**

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

    Parameters
    ----------
    W : float
        Required relieving mass flow rate (kg/h).
    P1 : float
        Upstream relieving pressure, absolute (bara).
    P2 : float
        Downstream 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. The value
        can be obtained from the manufacturer or estimated with the help of 
        Figure 31 of the API standard 520.
    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. Use `KSH=1.0` for saturated steam.
        For superheated steam, the value can be obtained from Tables 12 or 13
        of the API standard 520.

    Returns
    -------
    PRVResult
        Dataclass containing the results of the calculation.

    Examples
    --------
    Estimate the required discharge area of a pressure relief valve in gas 
    service, according to 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
    >>> area_relief_gas(W=24270, P1=6.7, P2=1.01325, T=348, k=1.11, M=51, Z=0.9)
    PRVResult(Pcf=3.90e+00 bara, critical_flow=True, A=3.70e+03 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)))

    return PRVResult(Pcf/1e2,  critical_flow, A)