Home
Generals
Unit converter
Periodic table
Molecular weight
Properties
Hydrocarbon properties
Steam properties
Psychrometric properties
Fuel gas LHV
Flue gas enthalpy
Dynamics
Equation of state
Flow convert (mass - volume)
Energy to emission
Flow rate
Darcy friction factor
Mean pressure
Flow compensation
Orifice sizing
Bernoulli equation
Steam pinhone
Control valve CV
Sizing
LMTD
Flash steam
Pump BHP
Performance
Cooling tower capability
Heater efficiency
Compressor efficiency
Turbine efficiency
About
ID
Name
Title
Keyword
Description
<div style="color: rgb(68, 68, 68); font-family: Consolas; font-size: 15px;"><div>This Python code calculates differential pressure or flow rate according to given pipe & fitting information for compressible fluid.</div><div><br><h2 style="margin: 0px; position: relative; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-weight: bold; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Trebuchet MS", Trebuchet, sans-serif; color: rgb(0, 0, 0);"><span style="font-family: Consolas;">Formula of DP and flow rate</span></h2></div><div><br></div><div>Calculate differential pressure in pipes based on information on the following pipes/accessory equipment</div><div><br>w : Flow rate [lb/hr]<br>△P : Delta Pressure [psia]<br>L : Length [ft]<br>D : Pipe Diameter [ft]<br>d : Pipe Diameter [in]<br>ρ : Density [lb/ft3]<br>f : Friction factor<br><br></div><div>Here, Friction factor (f) must be calculated using separate charts and programs.<br><br></div><div>Calculation formulas based on CRANE BOOK<br><b><span style="color: rgb(128, 1, 128);"><br></span></b></div><div><b><span style="color: rgb(128, 1, 128);">Kpipe = f * l/D<br></span></b><b><span style="color: rgb(128, 1, 128);">K = Kpipe + Kfitting<br></span></b><b><span style="color: rgb(128, 1, 128);"><br></span></b></div><div><b><span style="color: rgb(128, 1, 128);">compressible fluid<br></span></b><b><span style="color: rgb(128, 1, 128);">△P = (K * W^2) / (1891^2 * d^4 * ρ * Y^2)<br></span></b><b><span style="color: rgb(128, 1, 128);">w = 1891 * d^2 * √(△P * ρ / K) * Y</span></b></div><p><b><span style="color: rgb(128, 1, 128);"><br>liquid fluid<br>△P = (K * W^2) / (1891^2 * d^4 * ρ)<br>w = 1891 * d^2 * √(△P * ρ / K)</span></b></p><h2 style="margin: 0px; position: relative; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-weight: bold; font-stretch: normal; font-size: 14px; line-height: normal; font-family: "Trebuchet MS", Trebuchet, sans-serif; color: rgb(0, 0, 0);"><b><span style="color: rgb(128, 1, 128); font-family: Consolas;">Python code</span></b></h2><div><b><span style="color: rgb(128, 1, 128);"><br></span></b></div><p><span style="color: rgb(43, 0, 254);">import math</span><br></p><span style="color: rgb(43, 0, 254);"><br>def compressibledp(W, l, d, r, Y, f, Kf):<br> D = d * 12<br> Kp = f*l/D<br> K = Kp + Kf<br> dp = (K*pow(W, 2))/(pow(1891, 2)*pow(d, 4)*r*pow(Y, 2))<br> return dp<br><br>W = 220 # Flow rate (W, lb/hr)<br>l = 30.48 # Length (L, ft)<br>d = 1.969 # Pipe Diameter (d, in)<br>r = 0.0774 # Density (ρ, lb/ft3)<br>Y = 1.0 # Net Expansion Factor (Y)<br>f = 0.005 # Friction factor (f)<br>Kf = 500 # Resistance coefficient of fittings<br><br>dp = compressibledp(W, l, d, r, Y, f, Kf)<br>print("delta pressure of pipe = ", dp, "psia")<br><br>def compressibleflow(dp, l, d, r, Y, f, Kf):<br> D = d * 12<br> Kp = f * l / D<br> K = Kp + Kf<br> W = 1891 * pow(d, 2) * math.sqrt(dp * r / K) * Y<br> return W<br><br>dp = 5.933 # Delta Pressure (△P, psia)<br>m = 30.48 # Length (L, ft)<br>d = 1.969 # Pipe Diameter (d, in)<br>r = 0.0774 # Density (ρ, lb/ft3)<br>Y = 1 # Net Expansion Factor (Y)<br>f = 0.005 # Friction factor (f)<br>Kf = 500 # Resistance coefficient of fittings<br><br>flow = compressibleflow(dp, l, d, r, Y, f, Kf)<br>print("mass flow of pipe = ", flow, "lb/hr")<br></span><p>When run the code, you will receive the following results.</p><span style="color: rgb(43, 0, 254);">delta pressure of pipe = 5.82 psia<br></span><span style="color: rgb(43, 0, 254);">mass flow of pipe = 222 lb/hr</span><div><br></div><div><br></div></div>