This project provides functions in Python for standard calculations for Pressure Safety Valve (PSV) flow rate and sizing. The intention is to use the routines in a Jupyter Notebook file for documenting engineering work.
The calculations should be adequate for engineering consulting work and preliminary sizing or rating. Definative sizing or rating calculations should be performed with methodologies or rating factors provided by the PSV manufacturer.
The code is written in Python (and is the authors first Python package uploaded to GitHub). The code is intended to be used in a Jupyter Notebook. I have not used the routines in a stand-alone Python environment.
The following lines of code are needed in a Jupyter Notebook (Python shell) to pull the unregistered package from GitHub and use the package.
TBD
The package requires the following packages
The following code tests are available
Refer to the Jupyter Notebook file for an example of how the code is used.
For more examples, please refer to the Documentation
Functions are provided for rating and sizing of Steam, Vapour and Liquid PSVs. Units of measure used in the package are:
Functions
PSVsteamRate(areaMM2, Pkpa, State)
PSVsteamSize(Wkg, Pkpa, State)
PSVsteamFlux(Pkpa, State)
$$ Kd = 0.975 \ K{sh} = \mbox{Superheat derating (lookup table)} \ K_b = 1.0 \, \mbox{(no backpressure derating)} \ Kn = \frac{2.7644 \times Pkpa/100.0 - 1000.0}{3.3242 \times Pkpa/100.0 - 1061.0}, P > 10300 \mbox{kPa} \ Ppsi = Pkpa \times (14.503773800721813/100) \ flux{kg/hr.mm^2} = 51.45 \times Kd \times Ppsi \times K{sh} \times K_b \times K_n / (2.205 \times 25.4^2) $$
PSVvaporRate(areaMM2, P, Tcelcius, MW, k, Z)
PSVvaporSize(W, P, Tcelcius, MW, k, Z)
PSVvaporFlux(P, Tcelcius, MW, k, Z)
$$ Kd = 0.975 \, \mbox{discharge coefficient, can vary with mfg} \ Kb = 1.0 \, \mbox{do not consider backpressure derating} \ Kc = 1.0 \, \mbox{no derating for rupture disc} \ C = 0.03948 \sqrt{ k \left(\frac{2.0}{k+1}\right)^{(k+1)/(k-1)} } \, \mbox{API 520A fig 32} \ flux{kg/hr.mm2} = \frac{C Kd P Kb Kc}{\sqrt{T{kelvin} \times Z/MW}} $$
PSVliquidRate(areaMM2, P, Pback, d, mu)
$$ Kd = 0.65 \ Kw = 1.0 \ Kc = 1.0 \ Q = A{mm2} \frac{Kd Kw Kc Kv}{11.78} \sqrt{\Delta P/(\rho/1000)} \, \mbox{litres per minute} \ \mbox{where} \ R = \frac{Q 18800 \rho/1000}{\mu*\sqrt{A{mm2}}} \, \ Kv = 1.0 / (0.9935 + 2.878/\sqrt{R} + 342.75/(R^{1.5})) \ flowrate = Q60\rho/1000.0 \, \mbox{mass flow rate kg/h} $$
PSVliquidSize(W, P, Pback, d, mu)
$$ Q = 1000.0W/(\rho60.0) \, \mbox{l/min} \ Kd = 0.65 \ Kw = 1.0 \ Kc = 1.0 \ A{mm2} = 11.78 \frac{Q}{Kd Kw Kc Kv} \sqrt{(\rho/1000)/\Delta P} \ \mbox{where} \ R = \frac{Q 18800 \rho/1000}{\mu*\sqrt{A{mm2}}} \, \ Kv = 1.0 / (0.9935 + 2.878/\sqrt{R} + 342.75/(R^{1.5})) $$
Utility functions
getKsh(PkPa, State)
PSVareaOrifice(letter)
PSVfindOrifice(area)
waterPsat(T_c)
waterTsat(P_kPa)
thermExpansionRate(heat, alpha, heatCap)
$$ m = \frac{3600 \alpha q}{C_p} \, \mbox{kg/h} $$
poolFireReliefRate(wettedAreaM2,latent,prompt)
$$
F = 1.0 \, \mbox{no environmental credits} \
flowRate = \frac{C1 F A_{w,m2}^{0.82}}{1000 \Delta H} * 3600 \, \mbox{kg/h} \
\mbox{where} \
C1 = 70900 \, \mbox{if prompt fire fighting DOES NOT exist} \
C1 = 43200 \, \mbox{if prompt fire fighting exists}
$$
liquidVaporizeReliefRate(heat,latent)
$$ m = \frac{q}{\Delta H} * 3600 \, \mbox{kg/h} $$
Refer to the Jupyter notebook file PSVreliefExample.ipynb for working examples.
Send me a note.
Distributed under the MIT License. See LICENSE
for more information.
Kevin Dorma - @kevindorma - kevin@kevindorma.ca
Project Link: https://github.com/kevindorma/psvpy
Not sure who to acknowledge.