blob: f8c2217d411ff4406416f2e1c3611441905bcc0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
clear
clc
//Example 10.4 FLOW RATE IN A PIPE (CASE 2)
g=9.81; //[m/s^2]
L=1000; //[m]
D=0.20; //diameter[m]
A=%pi*D^2/4 //area[m^2]
v=10^-6; //viscosity[m^2/s]
hf=12.2; //[m]
P=D^(3/2)*sqrt(2*g*hf/L)/v
ks=0.12; //[mm]
//Relative roughness
Rr=ks/D
//From Moody diagram for P and Rr
f=0.019; //friction factor
//Darcy-Weisbach equation
V=sqrt(hf*2*g*(D/L)/f) //[m/s]
//Discharge
Q=V*A //[m^3/s]
printf("\nThe flow rate of water through the pipe = %.2f m^3/s.\n",Q)
|