summaryrefslogtreecommitdiff
path: root/914/CH10
diff options
context:
space:
mode:
Diffstat (limited to '914/CH10')
-rwxr-xr-x914/CH10/EX10.1/ex10_1.sce20
-rwxr-xr-x914/CH10/EX10.11/ex10_11.sce84
-rwxr-xr-x914/CH10/EX10.12/ex10_12.sce46
-rwxr-xr-x914/CH10/EX10.14/ex10_14.sce15
-rwxr-xr-x914/CH10/EX10.15/ex10_15.sce42
-rwxr-xr-x914/CH10/EX10.16/ex10_16.sce27
-rwxr-xr-x914/CH10/EX10.17/ex10_17.sce13
-rwxr-xr-x914/CH10/EX10.2/ex10_2.sce17
-rwxr-xr-x914/CH10/EX10.3/ex10_3.sce16
-rwxr-xr-x914/CH10/EX10.4/ex10_4.sce43
-rwxr-xr-x914/CH10/EX10.5/ex10_5.sce29
-rwxr-xr-x914/CH10/EX10.6/ex10_6.sce19
-rwxr-xr-x914/CH10/EX10.7/ex10_7.sce22
-rwxr-xr-x914/CH10/EX10.8/ex10_8.sce41
-rwxr-xr-x914/CH10/EX10.9/ex10_9.sce37
15 files changed, 471 insertions, 0 deletions
diff --git a/914/CH10/EX10.1/ex10_1.sce b/914/CH10/EX10.1/ex10_1.sce
new file mode 100755
index 000000000..76d14fefd
--- /dev/null
+++ b/914/CH10/EX10.1/ex10_1.sce
@@ -0,0 +1,20 @@
+clc;
+warning("off");
+printf("\n\n example10.1 - pg405");
+T=30; //[degC] - temperature
+d=8.265*10^-4; //[m] - diameter of the capillary viscometer
+deltapbyL=-0.9364; //[psi/ft] - pressure drop per unit length
+deltapbyL=deltapbyL*(2.2631*10^4); //[kg/m^2*sec^2] - pressure drop per unit length
+Q=28.36*(10^-6)*(1/60);
+p=(0.88412-(0.92248*10^-3)*T)*10^3; //[kg/m^3] - density
+s=(%pi*(d^2))/4;
+U=Q/s;
+tauw=(d/4)*(-deltapbyL);
+shearrate=(8*U)/d;
+mu=tauw/(shearrate);
+printf("\n\n The viscosity is \n mu=%f kg/m*sec=%f cP",mu,mu*10^3);
+printf("\n\n Finally, it is important to check the reynolds number to make sure the above equation applies");
+Nre=(d*U*p)/(mu);
+disp(Nre,"Nre=");
+printf("\n\n The flow is well within the laminar region and therefore the above equation applies");
+
diff --git a/914/CH10/EX10.11/ex10_11.sce b/914/CH10/EX10.11/ex10_11.sce
new file mode 100755
index 000000000..c415581ea
--- /dev/null
+++ b/914/CH10/EX10.11/ex10_11.sce
@@ -0,0 +1,84 @@
+clc;
+warning("off");
+printf("\n\n example10.11 - pg 447");
+// given
+sp=1.1;
+p=sp*62.4; //[lb/ft^3] - density
+mu=2*6.72*10^-4; //[lb/ft*sec] - viscosity
+Q=400; //[gpm] - volumetric flow rate
+e=1.5*10^4; //roughness of steel pipe
+gc=32.174;
+kexit=1;
+kentrance=0.5;
+// 4 in schedule pipe
+d=4.026/12; //[ft]
+U4=Q/39.6; //[ft/sec]
+Lgv=13.08;
+Lglv=114.1;
+Le=40.26;
+Lpipe_4=22;
+Lfittings_4=Lgv+Lglv+Le;
+Lloss=0;
+L_4=Lpipe_4+Lfittings_4+Lloss;
+Nre_4=(d*U4*p)/mu;
+f=0.00475;
+Fpipe_4=((4*f*L_4)/d)*(U4^2)*(1/(2*gc));
+Floss_4=((kentrance+0)*(U4^2))/(2*gc);
+// 5 in schedule pipe
+d=5.047/12;
+U5=Q/62.3;
+Lgv=10.94;
+Le=75.71;
+Lpipe_5=100;
+Lfittings_5=Lgv+Le;
+Lloss=0;
+L_5=Lpipe_5+Lfittings_5+Lloss;
+Nre=(d*U5*p)/mu;
+f=0.00470;
+Fpipe_5=((4*f*L_5)/d)*(U5^2)*(1/(2*gc));
+Floss_5=((kexit+0)*(U5^2))/(2*gc);
+// 6 in schedule pipe
+d=6.065/12;
+U6=Q/90;
+Lgv=6.570;
+Le=30.36;
+Lpipe_6=4;
+Lfittings_6=Lgv+Le;
+Lloss=0;
+L_6=Lpipe_6+Lfittings_6+Lloss;
+Nre=(d*U6*p)/mu;
+f=0.00487;
+Fpipe_6=((4*f*L_6)/d)*(U6^2)*(1/(2*gc));
+kc=0.50;
+Floss_6=kc*((U6^2)/(2*gc));
+Ffittings=0;
+deltap_6=p*(Fpipe_6+Ffittings+Floss_6);
+// 3/4 in 18 gauge tube
+d=0.652112/12;
+L_3by4=15;
+U_3by4=(Q*0.962)/100;
+Floss_3by4=100*(kexit+kentrance)*((U_3by4^2)/2);
+Nre=d*U_3by4*p*(1/mu);
+// clearly the flow is turbulent
+f=0.08*((Nre)^(-1/4))+0.012*((d)^(1/2));
+deltap_3by4=((4*f*p*L_3by4)/d)*((U_3by4^2)/(2*gc));
+Fpipe_3by4=100*((4*f*L_3by4)/d)*((U_3by4^2)/(2*gc));
+deltap_spraysystem=25; //[psi]
+Fspraysystem=(deltap_spraysystem/p)*(144);
+delta_p=[p*(kexit+kentrance)]*[(U_3by4^2)/(2*gc)];
+Fpipe=Fpipe_4+Fpipe_5+Fpipe_6;
+Floss=Floss_4+Floss_5+Floss_6+Floss_3by4;
+ws=0+([(15^2)-0]/[2*gc])+38.9+382.5;
+w=(Q*p)/(7.48);
+Ws=(ws*w)/(33000);
+efficiency=0.6;
+Ws_actual=Ws/efficiency
+printf("\n\n The power supplied to th pump is\n W_actual = %f",Ws_actual);
+
+
+
+
+
+
+
+
diff --git a/914/CH10/EX10.12/ex10_12.sce b/914/CH10/EX10.12/ex10_12.sce
new file mode 100755
index 000000000..fb2a30697
--- /dev/null
+++ b/914/CH10/EX10.12/ex10_12.sce
@@ -0,0 +1,46 @@
+clc;
+warning("off");
+printf("\n\n example10.12 - pg454");
+// given
+kexit=1;
+kentrance=0.5;
+Q=400; //[gpm] - volumetric flow rate
+gc=32.174;
+// for 4 inch pipe
+d=4.026; //[inch]
+L=22; //[ft]
+Lbyd=(L*12)/(d);
+// adding the contributions due to fittings
+Lbyd=Lbyd+3*13+340+4*30;
+N=Lbyd/45;
+N=N+kentrance+0;
+U4=Q/39.6; //[ft/sec]
+Fpipe_4=(N*(U4^2))/(2*gc);
+printf("\n\n F(4 in.pipes) = %f ft*lbf/lbm",Fpipe_4);
+// for 5 inch pipe
+L=100; //[ft]
+d=5.047; //[inch]
+Lbyd=(L*12)/(d);
+// valves contributes 26 diameters and six elbows contribute 30 diameters ecah;therefore
+Lbyd=Lbyd+26+6*30;
+N=Lbyd/45; // no. of velocity heads
+N=N+kexit+kentrance;
+U5=Q/62.3;
+Fpipe_5=(N*(U5^2))/(2*gc);
+printf("\n\n F(5 in.pipes) = %f ft*lbf/lbm",Fpipe_5);
+// for 6 inch pipe
+d=6.065; //[inch]
+L=5; //[ft]
+Lbyd=(L*12)/(d);
+// adding the contributions due to fittings
+Lbyd=Lbyd+1*13+2*30;
+N=Lbyd/45;
+N=N+0+kentrance;
+U6=Q/90;
+Fpipe_6=(N*(U6^2))/(2*gc);
+printf("\n\n F(6 in.pipes) = %f ft*lbf/lbm",Fpipe_6);
+F_largepipes=Fpipe_4+Fpipe_5+Fpipe_6;
+printf("\n\n F(large pipes) = %f ft*lbf/lbm",F_largepipes);
+
+
+
diff --git a/914/CH10/EX10.14/ex10_14.sce b/914/CH10/EX10.14/ex10_14.sce
new file mode 100755
index 000000000..0d40f0d81
--- /dev/null
+++ b/914/CH10/EX10.14/ex10_14.sce
@@ -0,0 +1,15 @@
+clc;
+warning("off");
+printf("\n\n example10.14 - pg459");
+// given
+l=0.09238;
+rh=0.1624*l;
+L=300;
+de=4*rh;
+p=1000; //[kg/m^3]
+mu=10^-3; //[kg/m*sec]
+Uavg=1.667;
+Nre=(de*Uavg*p)/mu;
+f=0.0053;
+deltap=((4*f*L)/de)*(p*(Uavg^2)*(1/2));
+printf("\n\n -deltap = %e kg/m*s = %e N/m^2 = %f kPa",deltap,deltap,deltap*10^-3);
diff --git a/914/CH10/EX10.15/ex10_15.sce b/914/CH10/EX10.15/ex10_15.sce
new file mode 100755
index 000000000..a1cb511b2
--- /dev/null
+++ b/914/CH10/EX10.15/ex10_15.sce
@@ -0,0 +1,42 @@
+clc;
+warning("off");
+printf("\n\n example10.15 - pg466");
+// given
+Q=400; //[gpm]
+p=1.1*62.4; //[lbm/ft^3]
+mu=2*(6.72*10^-4); //[lb/ft*sec]
+e=1.5*10^4;
+// 4 inch schedule pipe
+d=0.3355;
+S=(%pi*(d^2))/4;
+U4=Q/39.6;
+ebyd=e/d;
+w=3671/60;
+pm=13.45*62.4;
+g=32.1;
+gc=32.174;
+deltaz=2.5;
+deltap=(g/gc)*(pm-p)*(deltaz);
+betaa=((1)/(1+[(2*p*gc)*(deltap)]*(((0.61*S)/w)^2)))^(1/4);
+d2=betaa*d;
+Nre2=(4*w)/(%pi*d2*mu);
+a=(1/30)*4.026;
+b=(1/4)*(2.013-1.21);
+c=(1/8)*(2.42);
+if a<b then
+ if a<c then
+ opt=a;
+ else
+ opt=c;
+ end
+else
+ if b<c then
+ opt=b;
+ else
+ opt=c;
+ end
+end
+printf("\n\n The pertinent orifice details are \n orifice diameter = %f in \n corner taps, square edge\n orifice plate not over %f in thick",d2*12,opt);
+
+
+
diff --git a/914/CH10/EX10.16/ex10_16.sce b/914/CH10/EX10.16/ex10_16.sce
new file mode 100755
index 000000000..27064c9b4
--- /dev/null
+++ b/914/CH10/EX10.16/ex10_16.sce
@@ -0,0 +1,27 @@
+clc;
+warning("off");
+printf("\n\n example10.16 - pg470");
+// given
+Q=400; //[gpm]
+p=1.1*62.4; //[lbm/ft^3]
+mu=2*(6.72*10^-4); //[lb/ft*sec]
+e=1.5*10^4;
+// 4 inch schedule pipe
+d=0.3355;
+S=(%pi*(d^2))/4;
+U4=Q/39.6;
+ebyd=e/d;
+w=3671/60;
+pm=13.45*62.4;
+g=32.1;
+gc=32.174;
+Nre=(d*U4*p)/mu;
+if Nre>10^4 then
+ c=0.98;
+end
+deltaz=2.5;
+deltap=(g/gc)*(pm-p)*(deltaz);
+betaa=((1)/(1+[(2*p*gc)*(deltap)]*(((c*S)/w)^2)))^(1/4);
+d2=betaa*d;
+printf("\n\n The pertinentr details of the venturi design are\n Throat diameter = %f inch\n Approach angle = 25\n Divergence angle = 7",d2*12);
+
diff --git a/914/CH10/EX10.17/ex10_17.sce b/914/CH10/EX10.17/ex10_17.sce
new file mode 100755
index 000000000..ed2e8cc98
--- /dev/null
+++ b/914/CH10/EX10.17/ex10_17.sce
@@ -0,0 +1,13 @@
+clc;
+warning("off");
+printf("\n\n example10.17 - pg477");
+// given
+Uzmax=3.455; //[ft/sec]
+m=32;
+a1=-0.3527;
+a2=-0.6473;
+rbyro=0.880;
+UzbyUzmax=1+a1*(rbyro^2)+a2*(rbyro^(2*m));
+Uz=Uzmax*(UzbyUzmax);
+Uzavg=(4/9)*Uzmax+(5/18)*(Uz+Uz);
+printf("\n\n the average velocity is \n Uzavg = %f ft/sec \n\n Thus, in this example there is an inherent error of 5.5 percent, even before any experimental errors are introduced",Uzavg);
diff --git a/914/CH10/EX10.2/ex10_2.sce b/914/CH10/EX10.2/ex10_2.sce
new file mode 100755
index 000000000..d665d2c7f
--- /dev/null
+++ b/914/CH10/EX10.2/ex10_2.sce
@@ -0,0 +1,17 @@
+clc;
+warning("off");
+printf("\n\n example10.2 - pg407");
+Nreold=1214;
+Uold=0.8810;
+Nre=13700;
+U=Uold*(Nre/Nreold);
+Lbyd=744;
+// using the newton raphson method to calculate the value of f from the equation - 1/(f^(1/2))=4*log(Nre*(f^(1/2)))-0.4
+f=0.007119;
+p=(0.88412-(0.92248*10^-3)*T)*10^3; //[kg/m^3] - density
+tauw=(1/2)*p*(U^2)*f;
+deltap=tauw*(4)*(Lbyd);
+d=0.03254/12; //[ft]
+L=Lbyd*d;
+printf("\n\n Pressure drop is \n -deltap=%e N/m^2=%f kpa=130 psi",deltap,deltap*10^-3);
+printf("\n\n A pressure drop of 130 psi on a tube of length of %f ft is high and shows the impracticality of flows at high reynolds number in smaller tubes",L);
diff --git a/914/CH10/EX10.3/ex10_3.sce b/914/CH10/EX10.3/ex10_3.sce
new file mode 100755
index 000000000..19ee26b6c
--- /dev/null
+++ b/914/CH10/EX10.3/ex10_3.sce
@@ -0,0 +1,16 @@
+clc;
+warning("off");
+printf("\n\n example10.3 - pg414");
+// given
+u=1/60; //[m/sec] - velocity
+p=1000; //[kg/m^3] - density
+mu=1*10^-3; //[kg/m*sec] - viscosity
+d=6*10^-2; //[m] - inside diameter of tube
+L=300; //[m] - length of the tube
+Nre=(d*u*p)/(mu);
+disp("therefore the flow is laminar",Nre,"Nre=");
+f=16/Nre;
+disp(f);
+deltap=(4*f)*(L/d)*((p*(u^2))/2);
+printf("\n\n -deltap=%f N/m^2 = %f kPa = %e psi",deltap,deltap*10^-3,deltap*1.453*10^-4);
+
diff --git a/914/CH10/EX10.4/ex10_4.sce b/914/CH10/EX10.4/ex10_4.sce
new file mode 100755
index 000000000..0dcb28a18
--- /dev/null
+++ b/914/CH10/EX10.4/ex10_4.sce
@@ -0,0 +1,43 @@
+clc;
+warning("off");
+printf("\n\n example10.4 - pg415");
+// given
+d=6*10^-2; //[m] - inside diameter of tube
+p=1000; //[kg/m^3] - density
+// for smooth pipe
+Nre=[10^4 10^5];
+f=[0.0076 0.0045];
+mu=10^-3; //[kg/m^2*s]
+U=(Nre*mu)/(d*p);
+L=300; //[m] - length of the tube
+for i=1:2
+deltap(i)=(4*f(i))*(L/d)*((p*(U(i)^2))/2);
+end
+disp("for smooth pipe");
+printf(" Nre -deltap");
+printf("\n %f %f",Nre(1),deltap(1));
+printf("\n %f %f \n",Nre(2),deltap(2));
+// for commercial steel
+Nre=[10^4 10^5];
+f=[0.008 0.0053];
+U=(Nre*mu)/(d*p);
+L=300; //[m] - length of the tube
+for i=1:2
+deltap(i)=(4*f(i))*(L/d)*((p*(U(i)^2))/2);
+end
+disp("for commercial steel pipe");
+printf(" Nre -deltap");
+printf("\n %f %f",Nre(1),deltap(1));
+printf("\n %f %f \n",Nre(2),deltap(2));
+// for cast iron pipe
+Nre=[10^4 10^5];
+f=[0.009 0.0073];
+U=(Nre*mu)/(d*p);
+L=300; //[m] - length of the tube
+for i=1:2
+deltap(i)=(4*f(i))*(L/d)*((p*(U(i)^2))/2);
+end
+disp("for cast iron pipe");
+printf(" Nre -deltap");
+printf("\n %f %f",Nre(1),deltap(1));
+printf("\n %f %f",Nre(2),deltap(2)); \ No newline at end of file
diff --git a/914/CH10/EX10.5/ex10_5.sce b/914/CH10/EX10.5/ex10_5.sce
new file mode 100755
index 000000000..24cd25a5f
--- /dev/null
+++ b/914/CH10/EX10.5/ex10_5.sce
@@ -0,0 +1,29 @@
+clc;
+warning("off");
+printf("\n\n example10.5 - pg417");
+// given
+L=300; //[m] - length of pipe
+d=0.06; //[m] - inside diameter
+deltap=147*10^3; //[Pa] - pressure the pump can supply
+ebyd=0.000762; // relative roughness
+p=1000; //[kg/m^3] - density
+mu=1*10^-3; //[kg/m*sec] - viscosity
+tauw=(d*(deltap))/(4*L);
+// using the hit and trial method for estimation of flow velocity
+// let
+f=0.005;
+U=((2*tauw)/(p*f))^(1/2);
+Nre=(d*U*p)/mu;
+// from the graph value of f at the above calculated reynolds no. and the given relative roughness(e/d)
+f=0.0054;
+U=((2*tauw)/(p*f))^(1/2);
+Nre=(d*U*p)/mu;
+// from the graph value of f at the above calculated reynolds no. and the given relative roughness(e/d)
+f=0.0053;
+U=((2*tauw)/(p*f))^(1/2);
+Nre=(d*U*p)/mu;
+// from the graph value of f at the above calculated reynolds no. and the given relative roughness(e/d)
+f=0.0053;
+// At this point the value of f is deemed unchanged from the last iteration .Hence, the values obtained after the third iteration are the converged values
+printf("\n\n The maximum flow velocity is \n U=%f m/sec",U);
+
diff --git a/914/CH10/EX10.6/ex10_6.sce b/914/CH10/EX10.6/ex10_6.sce
new file mode 100755
index 000000000..a0166f848
--- /dev/null
+++ b/914/CH10/EX10.6/ex10_6.sce
@@ -0,0 +1,19 @@
+clc;
+warning("off");
+printf("\n\n example10.6 - pg419");
+// given
+L=300; //[m] - length of pipe
+d=0.06; //[m] - inside diameter
+deltap=147*10^3; //[Pa] - pressure the pump can supply
+ebyd=0.000762; // relative roughness
+p=1000; //[kg/m^3] - density
+mu=1*10^-3; //[kg/m*sec] - viscosity
+Nvk=((d*p)/mu)*((d*(deltap))/(2*L*p))^(1/2);
+disp(Nvk,"von karman no.-");
+// From the fig at given von karman no and relative roughness the value of f is-
+f=0.0055;
+Nre=Nvk/(f^(1/2))
+U=(Nre*mu)/(d*p);
+printf("\n\n U=%f m/sec",U);
+
+
diff --git a/914/CH10/EX10.7/ex10_7.sce b/914/CH10/EX10.7/ex10_7.sce
new file mode 100755
index 000000000..0bf79aaa2
--- /dev/null
+++ b/914/CH10/EX10.7/ex10_7.sce
@@ -0,0 +1,22 @@
+clc;
+warning("off");
+printf("\n\n example10.7 - pg422");
+// given
+L=300; //[m] - length of pipe
+d=0.06; //[m] - inside diameter
+p=1000; //[kg/m^3] - density
+mu=1*10^-3; //[kg/m*sec] - viscosity
+Nre=[10^4 10^5];
+U=(Nre*mu)/(d*p);
+velocityhead=(U^2)/2;
+N=(L/d)/45; // no of velocity heads
+deltap=p*N*(velocityhead);
+for i=1:2
+ disp(Nre(i),"Nre=");
+ printf("\n\n velocity head =%f m^2/sec^2",velocityhead(i));
+ printf("\n\n -deltap = %f kPa = %f psi",deltap(i)*10^-3,deltap(i)*1.453*10^-4);
+end
+
+
+
+
diff --git a/914/CH10/EX10.8/ex10_8.sce b/914/CH10/EX10.8/ex10_8.sce
new file mode 100755
index 000000000..1c5f73208
--- /dev/null
+++ b/914/CH10/EX10.8/ex10_8.sce
@@ -0,0 +1,41 @@
+clc;
+warning("off");
+printf("\n\n example10.8 - pg439");
+// given
+mu=6.72*10^-4; //[lb/ft*sec] - viscosity
+p=62.4; //[lb/ft^3] - density
+S=0.03322; //[ft^2] - flow area
+d=0.206; //[ft]
+e=1.5*10^-4; // absolute roughness for steel pipe
+ebyd=e/d;
+Nre=10^5;
+// friction factor as read from fig in book for the given reynolds no. and relative roughness is-
+f=0.0053;
+U=(Nre*mu)/(p*d);
+Q=U*S;
+gc=32.174;
+// (a) equivalent length method
+deltapbyL=f*(4/d)*(p*(U^2))*(1/(2*gc))*(6.93*10^-3);
+// using L=Lpipe+Lfittings+Lloss;
+Lfittings=2342.1*d;
+kc=0.50; // due to contraction loss
+ke=1; // due to enlargement loss
+Lloss=(kc+ke)*(1/(4*f))*d;
+Lpipe=137;
+L=Lpipe+Lfittings+Lloss;
+deltap=deltapbyL*L;
+patm=14.696; //[psi] - atmospheric pressure
+p1=patm+deltap;
+printf("\n\n (a)The inlet pressure is\n p1=%f psi",p1);
+// (b) loss coefficient method
+// using the equation deltap/p=-(Fpipe+Ffittings+Floss)
+L=137;
+kfittings=52.39;
+sigmaF=((4*f*(L/d))+kc+ke+kfittings)*((U^2)/(2*gc));
+deltap=(p*sigmaF)/(144);
+p1=patm+deltap;
+printf("\n\n (b)The inlet pressure is \n p1=%f psi",p1);
+printf("\n\n Computation of the pressure drop by the loss coefficient method differs from the equivalent length method by less than 1 psi");
+
+
+
diff --git a/914/CH10/EX10.9/ex10_9.sce b/914/CH10/EX10.9/ex10_9.sce
new file mode 100755
index 000000000..11d9f1e94
--- /dev/null
+++ b/914/CH10/EX10.9/ex10_9.sce
@@ -0,0 +1,37 @@
+clc;
+warning("off");
+printf("\n\n example10.9 - pg443");
+// given
+L1=50; //[m] - length of first pipe
+L2=150; //[m] - length of second pipe
+L3=100; //[m] - length of third pipe
+d1=0.04; //[m] - diameter of first pipe
+d2=0.06; //[m] - diameter of second pipe
+d3=0.08; //[m] - diameter of third pipe
+deltap=-1.47*10^5; //[kg/m*sec] - pressure drop
+mu=1*10^-3; //[kg/m*sec] - viscosity
+p=1000; //[kg/m^3] - density
+// for branch 1
+S=(%pi*(d1^2))/4;
+Nvk=((d1*p)/mu)*(-(d1*deltap)/(2*L1*p))^(1/2);
+f=(1/(4*log10(Nvk)-0.4))^2;
+U=(((-deltap)/p)*(d1/L1)*(2/4)*(1/f))^(1/2);
+w1=p*U*S;
+printf("\n\n For first branch w1=%f kg/sec",w1);
+// for branch 2
+S=(%pi*(d2^2))/4;
+Nvk=((d2*p)/mu)*(-(d2*deltap)/(2*L2*p))^(1/2);
+f=(1/(4*log10(Nvk)-0.4))^2;
+U=(((-deltap)/p)*(d2/L2)*(2/4)*(1/f))^(1/2);
+w2=p*U*S;
+printf("\n\n For second branch w2=%f kg/sec",w2);
+// for branch 3
+S=(%pi*(d3^2))/4;
+Nvk=((d3*p)/mu)*(-(d3*deltap)/(2*L3*p))^(1/2);
+f=(1/(4*log10(Nvk)-0.4))^2;
+U=(((-deltap)/p)*(d3/L3)*(2/4)*(1/f))^(1/2);
+w3=p*U*S;
+printf("\n\n For third branch w3=%f kg/sec",w3);
+// total flow rate w=w1+w2+w3
+w=w1+w2+w3;
+printf("\n\n total flow rate is w=%f kg/sec",w);