You are on page 1of 2

# Air Flow in Galvanized Iron pipe:

Air at 200F and 15 psig is to be passed through a horizontal 150 foot length of new
galvanized iron pipe. It is desired to determine the correct diameter of the pipe for a given
flow rate (cubic feet of air per second). If the maximum allowable pressure drop in the
pipe is 5 psi, generate a plot of flow rate versus possible pipe diameters ranging from 2
inches to 6 inches. It is estimated that the inside surface roughness of the pipe will be
approximately 0.0005 feet.
clear, clc, clf
p1=(15+14.7)*144, T1=tc(200,'F','R'), L=150, Q=15, xp=5*144
nu=airprops2(T1,'nu','eng','R'), g=32.17
[R,cp,cv,k]=gas_constants('air','eng')

function [Q]=f1(d)
d=d/12
noreport=1
e=0.0005
eqs=[
'Q=%pi*d^2/4*vel'
'Nr=vel*d/nu'
'xp/L=f*rho*vel^2/2/d'
'p1=rho*g*R*T1'
'1/sqrt(f)=-2*log10(e/3.7/d+2.51/Nr/sqrt(f))' ]
var=['vel';'rho';'f';'Q';'Nr'];
x0=[190,0.0038,0.022,15,2.5e5];
sol=solve_it()
for i=1:length(sol)
execstr(var(i)+'='+string(sol(i)));
end
Endfunction

figure(1), clf(1)
n=20, d=linspace(2,6,n)
fplot2d(d,f1), xgrid
xtitle('Air flow in a Galvanized Iron Pipe',...
'Pipe diameter - inches',...
'Flow rate - ft^3/s')
u2=get('current_axes'); u2.font_size=4;
u3=u2.title; u3.font_size=5;
u3=u2.x_label; u3.font_size=4;
u3=u2.y_label; u3.font_size=4;