Showing posts with label differential pressure. Show all posts
Showing posts with label differential pressure. Show all posts

Crane differential pressure or flow rate for compressible fluid (Imperial)

This Python code calculates differential pressure or flow rate according to given pipe & fitting information for compressible fluid.

Formula of DP and flow rate


Calculate differential pressure in pipes based on information on the following pipes/accessory equipment

w    : Flow rate [lb/hr]
△P  : Delta Pressure [psia]
L    : Length [ft]
D    : Pipe Diameter [ft]
d    : Pipe Diameter [in]
ρ    : Density [lb/ft3]
f    : Friction factor

Here, Friction factor (f) must be calculated using separate charts and programs.

Calculation formulas based on CRANE BOOK

Kpipe = f * l/D
K     = Kpipe + Kfitting

compressible fluid
△P = (K * W^2) / (1891^2 * d^4 * ρ  * Y^2)
w = 1891 * d^2 * √(△P * ρ / K) * Y


liquid fluid
△P = (K * W^2) / (1891^2 * d^4 * ρ)
w = 1891 * d^2 * √(△P * ρ / K)

Python code


Run Python code below : https://www.mycompiler.io/view/6fwILhy1i1P

import math

def compressibledp(W, l, d, r, Y, f, Kf):

    Kp = f*l/D
    K = Kp + Kf
    dp = (K*pow(W, 2))/(pow(1891, 2)*pow(d, 4)*r*pow(Y, 2))
    return dp

W = 220      # Flow rate (W, lb/hr)
l = 30.48    # Length (L, ft)
D = 0.01524  # Pipe Diameter (D, ft)
d = 1.969    # Pipe Diameter (d, in)
r = 0.0774   # Density (ρ, kg/m3)
Y = 1.0      # Net Expansion Factor (Y)
f = 0.005    # Friction factor (f)
Kf = 500     # Resistance coefficient of fittings

dp = compressibledp(W, l, d, r, Y, f, Kf)
print("delta pressure of pipe = ", dp, "psia")

def compressibleflow(dp, l, d, r, Y, f, Kf):
    
    Kp = f*l/D
    K = Kp + Kf
    W = 1891 * pow(d, 2) * math.sqrt(dp * r / K) * Y
    return W

dp = 5.933   # Delta Pressure (△P, psia)
m = 30.48    # Length (L, ft)
D = 0.01524  # Pipe Diameter (d, ft)
d = 1.969    # Pipe Diameter (d, in)
r = 0.0774   # Density (ρ, lb/ft3)
Y = 1        # Net Expansion Factor (Y)
f = 0.005    # Friction factor (f)
Kf = 500     # Resistance coefficient of fittings

flow = compressibleflow(dp, l, d, r, Y, f, Kf)
print("mass flow of pipe = ", flow, "lb/hr")

When run the code, you will receive the following results.

delta pressure of pipe =  5.933 psia
mass flow of pipe =  220 lb/hr

Crane differential pressure or flow rate for compressible fluid (SI)

This Python code calculates differential pressure or flow rate according to given pipe & fitting information for compressible fluid.

Calculate differential pressure in pipes based on information on the following pipes/accessory equipment

Flow rate (W) [kg/hr]
Delta Pressure (△P) [kgf/cm2]
Length (L) [m]
Pipe Diameter (d) [mm]
Density (ρ) [kg/m3]
Net Expansion Factor (Y)
Friction factor (f)

Here, Net Expansion Factor (Y) and Friction factor (f) must be calculated using separate charts and programs.

Calculation formulas based on CRANE BOOK

Kpipe = f * l/(d/1000)
K = Kpipe + Kfitting

compressible fluid

△P = (K * W^2) / (1.2646^2 * 0.981 * d^4 * ρ * Y^2)
w = 1.2646 * d^2 * √(△P * 0.981 * ρ / K) * Y

liquid fluid

△P = (K * W^2) / (1.2646^2 * 0.981 * d^4 * ρ)
w = 1.2646 * d^2 * √(△P * 0.981 * ρ / K)

import math

def compressibledp(W, l, d, r, Y, f, Kf):

    Kp = f*l/(d/1000)
    K = Kp + Kf
    dp = (K*pow(W, 2))/(pow(1.2646, 2)*0.981*pow(d, 4)*r*pow(Y, 2))
    return dp

W = 100   # Flow rate (W, kg/hr)
l = 100   # Length (L, m)
d = 50    # Pipe Diameter (d, mm)
r = 1.24  # Density (ρ, kg/m3)
Y = 1.0   # Net Expansion Factor (Y)
f = 0.005 # Friction factor (f)
Kf = 500  # Resistance coefficient of fittings

dp = compressibledp(W, l, d, r, Y, f, Kf)
print("delta pressure of pipe = ", dp, "kgf/cm2")

def compressibleflow(dp, l, d, r, Y, f, Kf):
    
    Kp = f*l/(d/1000)
    K = Kp + Kf
    W = 1.2646 * pow(d, 2) * math.sqrt(dp * 0.981 * r / K) * Y
    return W

dp = 0.42  # Delta Pressure (△P ,kgf/cm2)
m = 100    # Length (L, m)
d = 50     # Pipe Diameter (d, mm)
r = 1.24   # Density (ρ, kg/m3)
Y = 1      # Net Expansion Factor (Y)
f = 0.005  # Friction factor (f)
Kf = 500   # Resistance coefficient of fittings

flow = compressibleflow(dp, l, d, r, Y, f, Kf)
print("mass flow of pipe = ", flow, "kg/hr")

When run the code, you will receive the following results.

delta pressure of pipe =  0.42 kgf/cm2
mass flow of pipe =  100 kg/hr