summaryrefslogtreecommitdiff
path: root/536/CH4/EX4.2/Example_4_2.sce
blob: 5b57ce4dcceb6aafc1f58077bede59529e7fadd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
clc;

printf("\n Example 4.2\n");

l=30;//Length of the tube
d=150e-3;//Diameter of the tube
P1=0.4e3;//Initial Pressure
P2=0.13e3;//final Pressure
//X=e/d, Relative roughness
//Y=R/(rho*u^2) = 0.004
X=0.003;
Y=0.005;
v1=21.15e1;

G_A=poly([0],'G_A');
f=(G_A^2*log(P1/P2))+((P2^2-P1^2)/(2*P1*v1))+(4*(Y*l/d)*G_A^2);
A=roots(f);
printf("\n The approximate flow rate = %.2f kg/m^2 s",A(1));