summaryrefslogtreecommitdiff
path: root/2132/CH5/EX5.9/Example5_9.sce
blob: 82595d8b823a419109182c8e4e618c1b3165e445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//Example 5.9
clc;
clear;
close;
format('v',8);
//Given data :
Z1=0;//meter
Z2=4;//meter
rho=0.8;//sp. gravity

Q=250*10^-3;//m/s or cumec
D1=250/1000;//meter
D2=500/1000;//meter
A1=%pi*D1^2/4;//m^2
A2=%pi*D2^2/4;//m^2
v1=Q/A1;//m/s
v2=Q/A2;//m/s
p1=0.1*10^3;//N/m^2
p2=0.06*10^3;//N/m^2
g=9.81;//constant
Vhead1=v1^2/2/g;//meter
Phead1=p1/rho/g;//meter
Vhead2=v2^2/2/g;//meter
Phead2=p2/rho/g;//meter
H1=Z1+Vhead1+Phead1;//meter
H2=Z2+Vhead2+Phead2;//meter
if H1>H2 then
    disp("Total head at A("+string(H1)+" meter) is greater than total head at B("+string(H2)+" meter). Flow will take place from A-B.");
    HeadLoss=H1-H2;//meter
    disp(HeadLoss,"Head Loss in meter : ");
else
    disp("Total head at B("+string(H2)+" meter) is greater than total head at A("+string(H1)+" meter). Flow will take place from B-A.");
    HeadLoss=H2-H1;//meter
    disp(HeadLoss,"Head Loss in meter : ");end