Skip to content

polykin.flow.prv¤

area_relief_liquid ¤

area_relief_liquid(
    Q: float,
    P1: float,
    P2: float,
    mu: float,
    Gl: float,
    Kd: float = 0.65,
    Kw: float = 1.0,
    Kc: float = 1.0,
) -> float

Calculate the required effective discharge area of a pressure relief device in liquid service.

The calculation is done according to the API standard 520, assuming the valves are designed in accordance with the ASME code.

References

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

Required relieving volume flow rate (L/min).

TYPE: float

P1

Relieving pressure (bar). Can be absolute or gauge, as long as it is consistent with P2.

TYPE: float

P2

Back pressure (bar). Can be absolute or gauge, as long as it is consistent with P1.

TYPE: float

mu

Viscosity at relieving temperature (cP).

TYPE: float

Gl

Relative density of the liquid at relieving temperature with respect to water at standard conditions.

TYPE: float

Kd

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

TYPE: float DEFAULT: 0.65

Kw

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

RETURNS DESCRIPTION
float

Effective discharge area (mm²).

Examples:

Estimate the required discharge area of a pressure relief valve in liquid service, using the API standard 520. The required flow is 6814 L/min, the relieving pressure is 18.96 barg, the back pressure is 3.45 barg, the liquid relative density is 0.9, the liquid viscosity is 396 cP, and the valve back pressure correction factor is 0.97.

>>> from polykin.flow import area_relief_liquid
>>> A = area_relief_liquid(Q=6814, P1=18.96, P2=3.45, mu=396, Gl=0.9, Kw=0.97)
>>> print(f"Effective discharge area: {A:.0f} mm²")
Effective discharge area: 3172 mm²
Source code in src/polykin/flow/prv.py
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
def area_relief_liquid(Q: float,
                       P1: float,
                       P2: float,
                       mu: float,
                       Gl: float,
                       Kd: float = 0.65,
                       Kw: float = 1.0,
                       Kc: float = 1.0,
                       ) -> float:
    r"""Calculate the required effective discharge area of a pressure relief
    device in liquid service. 

    The calculation is done according to the API standard 520, assuming the
    valves are designed in accordance with the ASME code.

    **References**

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

    Parameters
    ----------
    Q : float
        Required relieving volume flow rate (L/min).
    P1 : float
        Relieving pressure (bar). Can be absolute or gauge, as long as it is 
        consistent with `P2`.
    P2 : float
        Back pressure (bar). Can be absolute or gauge, as long as it is 
        consistent with `P1`.
    mu : float
        Viscosity at relieving temperature (cP).
    Gl : float
        Relative density of the liquid at relieving temperature with respect to
        water at standard conditions.
    Kd : float
        Effective discharge coefficient. Use `Kd=0.65` when sizing a PRV and
        `Kd=0.62` when sizing a rupture disk without PRV.
    Kw : 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.

    Returns
    -------
    float
        Effective discharge area (mm²).

    Examples
    --------
    Estimate the required discharge area of a pressure relief valve in liquid 
    service, using the API standard 520. The required flow is 6814 L/min, the
    relieving pressure is 18.96 barg, the back pressure is 3.45 barg, the liquid
    relative density is 0.9, the liquid viscosity is 396 cP, and the valve back 
    pressure correction factor is 0.97.
    >>> from polykin.flow import area_relief_liquid
    >>> A = area_relief_liquid(Q=6814, P1=18.96, P2=3.45, mu=396, Gl=0.9, Kw=0.97)
    >>> print(f"Effective discharge area: {A:.0f} mm²")
    Effective discharge area: 3172 mm²
    """

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

    A = 0.0
    A_old = 0.0
    converged = False
    MAX_ITER = 50
    for i in range(MAX_ITER):

        if i == 0:
            Kv = 1.0
        else:
            Re = 18800*Q*Gl/(mu*sqrt(A))
            Kv = 1/(0.9935 + 2.878/Re**0.5 + 342.75/Re**1.5)

        A = 11.78*Q/(Kd*Kw*Kc*Kv)*sqrt(Gl/(P1 - P2))

        if abs((A - A_old)/A) < 1e-5:
            converged = True
            break
        else:
            A_old = A

    if not converged:
        raise ValueError(f"Failed to converge after {MAX_ITER} iterations.")

    return A