Bernoulli Equation

Bernoulli Equation (SI unit)

Bernoulli's law is an important principle used in fluid mechanics, describing the relationship between the velocity and pressure of a fluid. According to this law, as speed increases, pressure decreases, and as speed decreases, pressure increases. This principle is expressed by the following formula:

Energy basis   : P1/ρ1 + u1^2/2 + z1 = P2/ρ2 + u2^2/2 + z2 [Pa, kg/m3, m/s, m]
Pressure basis : P1 + ρ1*u1^2/2 + ρ1*g*z1 = P1 + ρ2*u2^2/2 + ρ2*g*z2 [Pa, kg/m3, m/s, m]
Head basis     : P1/(ρ1*g) + u1^2/2g + z1 = P2/(ρ2*g) + u2^2/2g + z2 [Pa, kg/m3, m/s, m]
 
Where,
ρ = fluid density (kg/m3)
g = acceleration due to gravity (9.8 m/s)
P1 = pressure at elevation-1 (Pa)
u1 = velocity at elevation-1 (m/s)
h1 = height of elevation-1 (m)
P2 = pressure at elevation-2 (Pa)
u2 = velocity at elevation-2 (m/s)
h2 = height at elevation-2 (m)

Example of Bernoulli Equation (SI unit)

Water at 25 degC enters a pipe at the velocity of 1 m/s and a pressure of 101.3 kPa. The pipe has a constant diameter and friction loss is negligible. A change in the pipe’s elevation changes the downstream pressure in the pipe to 2.1 atm. Most nearly, what is the elevation change?

P1/(ρ1*g) + u1^2/2g + z1 = P2/(ρ2*g) + u2^2/2g + z2
u1 = u2, ρ1 = ρ2
P1/(ρ1*g) + z1 = P2/(ρ2*g) + z2
101.3 kPa = 101,300 Pa
2.1 atm = 212,730 Pa
z2 - z1 = (P1 - P2)/ρ*g = (101,300 Pa - 212,730 Pa)/(997 kg/m3 * 9.81 m/sec) = -11.4 m

Bernoulli Equation (Imperial unit)


Energy basis   : P1*gc/ρ1 + u1^2/2 + g*z1 = P2*gc/ρ2 + u2^2/2 + g*z2 [lbf/ft2, lbm/ft3, ft/s, ft, 32.2 lbm-ft/lbf-sec2, 32.2 ft/sec2]
Pressure basis : P1 + ρ1*u1^2/2gc + ρ1*g*z1/gc = P1 + ρ2*u2^2/2gc + ρ2*g*z2/gc [lbf/ft2, lbm/ft3, ft/s, ft, 32.2 lbm-ft/lbf-sec2, 32.2 ft/sec2]
Head basis     : P1*gc/(ρ1*g) + u1^2/2g + z1 = P2*gc/(ρ2*g) + u2^2/2g + z2 [lbf/ft2, lbm/ft3, ft/s, ft, 32.2 lbm-ft/lbf-sec2, 32.2 ft/sec2]

Where,
ρ = fluid density (lbm/ft3)
g = acceleration due to gravity (32.2 ft/sec2)
P1 = pressure at elevation-1 (lbf/ft2, = psia * 144 in2/ft2)
u1 = velocity at elevation-1 (ft/s)
h1 = height of elevation-1 (ft)
P2 = pressure at elevation-2 (lbf/ft2, = psia * 144 in2/ft2)
u2 = velocity at elevation-2 (ft/s)
h2 = height at elevation-2 (ft)

Example of Bernoulli Equation (Imperial unit)

The pump supplies water at a flow rate of 4.0 ft3/sec from an open reservoir through a horizontal 8 inch pipe. the head loss from the reservoir to the suction of the pump is 2 ft-lbf/lbm. and the discharge is at 90 psi in to 6 inch pipe (5.761 inch). The pump has an efficiency of 65%. The head that must be delivered by the pump to water is?

P1*gc/(ρ1*g) + u1^2/2g + z1 + hpump = P2*gc/(ρ2*g) + u2^2/2g + z2 + hf
ρ1 = ρ2 = 62.4 lbm/ft3
u1 = 0
z1 = 0
z2 = 0
hf = 0
P2 - P1 = 90 psi = 90 lbf/in2 = 12,960 lbf/ft2
6 inch pipe diameter = 3.14*(5.761 inch * (1 ft / 12 inch)/2)^2 = 0.181 ft2
u2 = 4.0 ft3/sec / 0.181 ft2 = 22.1 ft/sec
gc = 32.2 lbm-ft/lbf-sec2, 
g = 32.2 ft/sec2
hpump = (P2-P1)*gc/(ρ*g) + u2^2/2g = 12,960 lbf/ft2 / 62.4 lbm/ft3 + 22.1^2 / (2 * 32.2) = 215 ft



Darcy friction factor f calculation

Darcy friction factor f as a function of Reynolds number Re and pipe relative roughness ε / d, fitting the data of experimental studies of turbulent flow in smooth and rough pipes.

The equation can be used to (alliteratively) solve for the Darcy–Weisbach friction factor f.

For a conduit flowing completely full of fluid at Reynolds numbers greater than 4000, it is expressed as:

1/√(f) = -2*log((e/d)/3.7 + 2.51/(Nre*√(f))

As can see from the formula, simple calculation is not possible, so user should use iterative calculations or a solver to find the value of f that satisfies the formula.

Pipe Material Commercial Steel, e = 0.05
Pipe Internal Diameter (d, mm) = 25
Reynold's Number (Re) = 100000
Relative Roughness (ε/D)  0.002
Friction factor (f) 0.023


Run Python code below : https://www.mycompiler.io/view/4rbUNlvs1QN

import math
import numpy as np

def frictionfactor(piping, d, Nre):

    piping = "Commercial Steel"
    if piping == "Commercial Steel": e = 0.05
    if piping == "Cast Iron": e = 0.26
    if piping == "Galvanized Iron": e = 0.15
    if piping == "Asphalted Cast Iron": e = 0.12
    if piping == "Drawn Tubing": e = 0.0015

    if (Nre > 1 and Nre <= 2000):
        
        f_result = 64 / Nre

    elif Nre > 4000:

        delta_result = 1
        delta = 1

        for f in np.arange(0.001, 0.1, 0.001):
            lhs = 1/math.sqrt(f)
            rhs = -2*math.log10((e/d)/3.7 + 2.51/(Nre*math.sqrt(f)))
            delta = abs(lhs - rhs)
            if (delta < delta_result):
                delta_result = delta
                f_result = f
    else:
        pass
    
    return f_result

f = frictionfactor("Commercial Steel", 25, 10000)
print("darcy friction factor = ", f)

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

darcy friction factor =  0.034


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

Equation of state

Energy engineers frequently calculate the equation of state for gases. The Python example below is an example of calculating the value of an unknown variable using the ideal equation of state and the Van der waals equation of state.

Ideal equation of state

      P = 0.082*T/V

Van Der Waals equation of state

      P = (0.082 * T) / (V - b) - a / V^2

      a = (27 * 0.082^2 * Tc^2) / (64 * Pc)
      b = (0.082 * Tc) / (8 * Pc)


Python code of equation of state 


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

import numpy as np

def eos(p, v, t, pc, tc, EOS, PVT):
 
    delta = 99999; 
    delta_result = 99999; 
 
    if EOS == "Ideal":

        if (PVT == 'P'):
            p = 0.082 * t / v
            result = p
        elif PVT == 'V':
            v = 0.082 * t / p
            result = v
        elif PVT == 'T':
            t = p * v / 0.082
            result = t

    elif EOS == "VanderWaals":

        a = 27*(pow(0.082,2)*pow(tc,2))/(64*pc)
        b = 0.082*tc/(8*pc)

        if PVT == 'P':
            p = (0.082*t)/(v-b)-a/pow(v,2)
            result = p
     
        elif PVT == 'V':
            v = 0.082 * t / p
            v_start = v*1-(v*0.5)
            v_end = v*1+(v*0.5)
            v_interval = v*1/2000

            Iteration = np.arange(v_start, v_end, v_interval)

            for v_temp in Iteration:
             
                p1 = p
                p2 = (0.082*t)/(v_temp-b)-a/pow(v_temp,2)
              
                delta = abs(p1 - p2)

                if (delta < delta_result):
                    delta_result = delta
                    v_result = v_temp                
          
            v_result = round(v_result*1000)/1000
            result = v_result

        elif PVT == 'T':
            t = (p*1+a/pow(v,2))*(v-b)/0.082
            result = t
    else:
        pass

    return result

P = 10          # Pressure (P, atm) = 10
V = 2.403       # Volume/mole (V, L/gmol) = 2.403
T = 298.15      # Temperature (T, K) = 298.15
Pc = 45.80      # Critical Pressure (Pc, atm) = 45.80
Tc = 190.7      # Critical Temperature (Tc, K) = 190.7

print(eos(P, V, T, Pc, Tc, 'Ideal', 'P'))
print(eos(P, V, T, Pc, Tc, 'Ideal', 'V'))
print(eos(P, V, T, Pc, Tc, 'Ideal', 'T'))

print(eos(P, V, T, Pc, Tc, 'VanderWaals', 'P'))
print(eos(P, V, T, Pc, Tc, 'VanderWaals', 'V'))
print(eos(P, V, T, Pc, Tc, 'VanderWaals', 'T'))

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

10.174
2.445
293.049
9.968
2.395
299.072

Unit converter

For energy engineers, unit conversion is the most basic of basics. In the field, there are gauge units and absolute units, so minor mistakes can lead to very different calculation results. Also, there are times when you want to verify your unit conversion.

Python code of unit converter


The Python code below is an example of temperature and pressure engineering unit conversion.
dbUnit = [
         ['C', 'Temperature', 1.0, 0.0],
         ['K', 'Temperature', 1.0, 273.15],
         ['F', 'Temperature', 1.8, 32.0],
         ['R', 'Temperature', 1.8, 491.67],
         ['kPa', 'Pressure',  1.0, 0.0],
         ['MPa', 'Pressure',  0.001, 0.0],
         ['bar', 'Pressure',  0.01, 0.0],
         ['N/m2', 'Pressure', 1000.0, 0.0],
         ['atm', 'Pressure', 0.009869233, 0.0],
         ['at', 'Pressure', 0.01019716, 0.0],
         ['kg/cm2', 'Pressure', 0.01019716, 0.0],
         ['psia', 'Pressure', 0.1450377, 0.0],
         ['lbf/ft2', 'Pressure', 20.88543, 0.0],
         ['torr', 'Pressure', 7.500615, 0.0],
         ['kPag', 'Pressure', 1.0, -101.325],
         ['MPag', 'Pressure', 0.001, -0.101325],
         ['bar_g', 'Pressure', 0.01, -1.01325],
         ['N/m2_g', 'Pressure', 1000.0, -101325.0],
         ['atm_g', 'Pressure', 0.009869, -1.0],
         ['ate', 'Pressure', 0.01019716, -1.033227],
         ['kg/cm2_g', 'Pressure', 0.01019716, -1.033227],
         ['psig', 'Pressure', 0.1450377, -14.696],
         ['lbf/ft2_g', 'Pressure', 20.88543, -2116.216],
         ['torr_g', 'Pressure', 7.500615, -760.0],
         ]


def loadUnit(search):
    for i in range(len(dbUnit)):
        if dbUnit[i][0] == search:
            UnitGroup = dbUnit[i][1]
            UnitScale = float(dbUnit[i][2])
            UnitOffset = float(dbUnit[i][3])

    return UnitGroup, UnitScale , UnitOffset

def unitconv(number, Unit_old, Unit_new):
    
    Group_old, Scale_old, Offset_old = loadUnit(Unit_old)
    Group_new, Scale_new, Offset_new = loadUnit(Unit_new)

    if Scale_old == 0 or Group_old != Group_new: 
        return None

    return ((number - Offset_old) / Scale_old) * Scale_new + Offset_new

print(unitconv(50, "C", "R")) # 50 C = 581.67 R
print(unitconv(10, "bar_g", "kPa")) # 10 bar_g = 1101.325 kPA



Enthalpy chart for Air, N2, O2, H2O, CO, CO2, SO2

Enthalpy chart used when performing enthalpy calculations to calculate the energy loss of flue gas discharged from the stack. Air, N2, O2, H2O, CO, CO2, SO2 enthalpy curves (Btu/lb) are presented as a function of temperature (degF).




Air Preheater in fired heater

Air Preheat System is usually applied to increase a fired heater’s efficiency, and the economics of air preheating should be compared with other forms of flue gas heat recovery. Air preheat systems become more profitable with increasing fuel costs, with increasing process inlet temperature (i.e., higher stack flue gas temperature), and with increasing fired duty.

Economic analysis of preheater


The economic analysis should account for the APH system’s capital costs, operating costs, maintenance costs, fuel savings and the value (if any) of increased capacity. In the case of a system retrofit, the economic analysis should include the cost of incremental heater downtime for the preheat system installation. In addition to economics, the system’s impact on the heater’s operations and maintenance should also be considered. Compared to natural draft systems, air preheat systems typically provide the following operational advantages:

a. Reduced fuel consumption.
b. Improved control of combustion air flow.
c. Reduced oil burner fouling.
d. Better flame pattern control.
e. More complete combustion of difficult fuels. 
Air preheat systems typically have the following operational disadvantages (vs. natural draft systems):
a. Increased radiant section operating temperatures (coil, film, supports, etc.).
b. Increased potential for corrosion of flue gas wetted components downstream of the preheat exchanger, from sulfuric acid condensation.
c. Formation of acid mists, resulting in stack plume, if fuel sulfur content is high.
d. Increased maintenance requirements for mechanical equipment.
e. Increased nitrogen oxide concentration in the flue gas.
f. Reduced stack effluent velocity and dispersion of the flue gases.

In all applications, the use of an air preheat system will increase both the heater’s firebox temperature and radiant flux rate(s). Because of these hotter operating conditions, a thorough review of the heater’s mechanical and process design under APH operations should be performed on all retrofit applications. The hotter firebox temperatures could result in overheated tube supports, guides, tubes, and/or unacceptably high process film temperatures.

In some cases, an air preheat system may provide an increase in fired heater capacity or duty. For example, when a fired heater’s operation is limited by a large flame envelope or poor flame shape (flame impingement on tubes) or by inadequate draft (flue gas removal limitations), the addition of an air preheat system may increase the heater’s capacity.

Based on the flue gas and air flow through the system, the three system types are:

a. Balanced Draft APH Systems (most common type).
b. Forced Draft APH Systems. 
c. Induced Draft APH Systems.

The common “balanced draft” system has both a forced draft (FD) fan and an induced draft (ID) fan. The system is balanced because the combustion air charge, provided by the forced draft fan, is balanced by the flue gas removal of the induced draft fan. In most applications, the forced draft fan is controlled by a “duty controller” that is reset by the heater’s O2 analyzer and the induced draft fan is controlled by an arch pressure controller.

In comparison, the simpler “forced draft” system has only a forced draft fan to provide the heater’s combustion air requirements. All flue gases are removed by stack draft. Because of the low draft generation capabilities of a stack, the exchanger’s flue gas side pressure drop must be kept very low, thus increasing the size and cost of the APH exchanger.

The third and last designation based on fluid flow design is the “induced draft” system, which has only an induced draft fan to remove flue gases from the heater and maintain the appropriate system draft. Combustion air flow is induced by the sub-atmospheric pressure of the heater. In this application, the exchanger must be carefully designed to minimize the combustion air pressure drop while providing the necessary heat transfer.

A typical balanced draft APH system, employing a direct exchanger, is illustrated in figures below.


Air Preheat System Using Regenerative, Recuperative, or Heat Pipe Air Preheater

Air Preheat System Using an Indirect Closed Air Preheater and Mechanical Circulation