diff options
Diffstat (limited to '3720/CH8')
-rw-r--r-- | 3720/CH8/EX8.1/Ex8_1.sce | 38 | ||||
-rw-r--r-- | 3720/CH8/EX8.10/Ex8_10.sce | 22 | ||||
-rw-r--r-- | 3720/CH8/EX8.2/Ex8_2.sce | 26 | ||||
-rw-r--r-- | 3720/CH8/EX8.3/Ex8_3.sce | 32 | ||||
-rw-r--r-- | 3720/CH8/EX8.4/Ex8_4.sce | 33 | ||||
-rw-r--r-- | 3720/CH8/EX8.5/Ex8_5.sce | 29 | ||||
-rw-r--r-- | 3720/CH8/EX8.6/Ex8_6.sce | 23 | ||||
-rw-r--r-- | 3720/CH8/EX8.7/Ex8_7.sce | 40 | ||||
-rw-r--r-- | 3720/CH8/EX8.8/Ex8_8.sce | 33 | ||||
-rw-r--r-- | 3720/CH8/EX8.9/Ex8_9.sce | 55 |
10 files changed, 331 insertions, 0 deletions
diff --git a/3720/CH8/EX8.1/Ex8_1.sce b/3720/CH8/EX8.1/Ex8_1.sce new file mode 100644 index 000000000..6c8c4d2cb --- /dev/null +++ b/3720/CH8/EX8.1/Ex8_1.sce @@ -0,0 +1,38 @@ +//Example 8_1
+clc;clear;funcprot(0);
+// Given values
+P_i=745;
+P_o=97;//The pressure at the pipe inlet and outlet in kPa
+D=0.05;// m
+L=40;// m
+//Properties
+rho=888;//kg/m^3
+mu=0.800;// kg/m.s
+g=9.81;// m/s^2
+
+//Calculation
+gradP=P_i-P_o;//kPa
+A_c=(%pi*D^2)/4;// m^2
+//(a)
+//For the horizontal case, theta=0
+theta=0;// degree
+V=((((gradP*1000)-(rho*g*L*sind(theta)))*(%pi*D^4))/(128*mu*L));// m^3/s
+V_horiz=V;// m^3/s
+printf('(a)The flow rate for the horizontal case,theta=0,V_horiz=%0.5f m^3/s\n',V_horiz);
+
+//(b)
+// For uphill flow with an inclination of 15°, we have theta=+15°,
+theta_1=+15;// degree
+V=((((gradP*1000)-(rho*g*L*sind(theta_1)))*(%pi*D^4))/(128*mu*L));
+V_uphill=V;//m^3/s
+printf('(b)The flow rate for uphill flow with an inclination of 15°,V_uphill=%0.5f m^3/s\n',V_uphill);
+
+//(c)
+//For downhill flow with an inclination of 15°,we have theta=-15°,
+theta_2=-15;//degree
+V=((((gradP*1000)-(rho*g*L*sind(theta_2)))*(%pi*D^4))/(128*mu*L));
+V_downhill=V;//m^3/s
+printf('(c)The flow rate for downhill flow with an inclination of 15°,V_downhill=%0.5f m^3/s\n',V_downhill);
+V_avg=(V_downhill/A_c);
+Re=(rho*V_avg*D)/mu;
+disp("Re=100.Re<2300.Therefore, the flow is laminar for all three cases and the analysis is valid.");
diff --git a/3720/CH8/EX8.10/Ex8_10.sce b/3720/CH8/EX8.10/Ex8_10.sce new file mode 100644 index 000000000..fba448fa2 --- /dev/null +++ b/3720/CH8/EX8.10/Ex8_10.sce @@ -0,0 +1,22 @@ +//Example 8_10
+clc;clear;funcprot(0);
+// Given values
+rho_m=788.4;// kg/m^3
+mu=5.857*10^-4;// The dynamic viscosity of methanol in kg/m.s
+d=0.03;// Diameter of orifice in m
+D=0.04;// Diameter of pipe in m
+rho_Hg=13600;// kg/m^3
+g=9.81;// m/s^2
+h=0.11;// m
+//Assumptions
+C_d=0.61;
+
+//Calculation
+beta=(d/D);// The diameter ratio
+A_0=(%pi*d^2)/4;// The throat area of the orifice in m^2
+gradP=(rho_Hg-rho_m)*g*h;
+v=A_0*C_d*sqrt((2*((rho_Hg/rho_m)-1)*g*h)/(1-beta^4));// m^3/s
+printf('The flow rate of methanol through the pipe,v=%0.2e m^3/s\n',v);
+A_1=(%pi*D^2)/4;// m^2
+V=v/A_1;// m/s
+printf('The average flow velocity,V_1=%0.2f m/s\n',V)
diff --git a/3720/CH8/EX8.2/Ex8_2.sce b/3720/CH8/EX8.2/Ex8_2.sce new file mode 100644 index 000000000..e4db34edc --- /dev/null +++ b/3720/CH8/EX8.2/Ex8_2.sce @@ -0,0 +1,26 @@ +//Example 8_2
+clc;clear;funcprot(0);
+// Given values
+rho=62.42;//lbm/ft^3
+mu=1.038*10^-3;// lbm/ft.s
+D=0.01;// ft
+L=30;// ft
+V_avg=3;// ft/s
+g=32.2;// Ft/s^2
+
+//Calculation
+//(a)
+Re=(rho*V_avg*D)/mu;// Reynolds number
+f=64/Re;// Friction factor
+h_l=f*(L/D)*((V_avg^2)/(2*g));// ft
+printf('(a)The head loss,h_l =%0.1f ft\n',h_l);
+//(b)
+gradP_l=(f*(L/D)*rho*(V_avg^2/2))/32.2;// lbf/ft^2
+gradP_1=(gradP_l/144);// psi
+printf('(b)The pressure drop,gradP_l=%0.0f lbf/ft^2=%0.2f psi\n',gradP_1*144,gradP_1);
+//(c)
+A_c=(%pi*D^2)/4;// ft^2
+v=V_avg*A_c;// ft^3/s
+W_pump=v*gradP_l/0.737;// W
+printf('(c)The pumping power requirements,W_pump=%0.2f W\n',W_pump);
+// The answer vary due to round off error
diff --git a/3720/CH8/EX8.3/Ex8_3.sce b/3720/CH8/EX8.3/Ex8_3.sce new file mode 100644 index 000000000..1de3686d0 --- /dev/null +++ b/3720/CH8/EX8.3/Ex8_3.sce @@ -0,0 +1,32 @@ +//Example 8_3
+clc;clear;funcprot(0);
+// Given values
+rho=62.36;// lbm/ft^3
+mu=7.536*10^-4;// lbm/ft.s
+D=2/12;// ft
+v=0.2;// ft^3/s
+L=200;// ft
+g=32.2;// ft/s^2
+
+//Calculation
+A_c=(%pi*D^2)/4;// ft^2
+V=v/A_c;// Average velocity in ft/s
+Re=(rho*V*D)/(mu);// Reynolds number
+// Re is greater than 4000. Therefore, the flow is turbulent. The relative roughness of the pipe is calculated using Table 8–2, (epsilon/D)=e
+E=0.000007;
+e=E/(D);
+//To avoid any reading error, we determine f from the Colebrook equation:(1/sqrt)=-2.0*log10*((e/3.7)+(2.51/(Re*sqrt(f)))
+// f=y(1)
+function[X]=frictionfactor (y)
+ X(1)=(-2.0*log10((0.000042/3.7)+(2.51/(126400*sqrt(y(1))))))-(1/sqrt(y(1)));
+endfunction
+y=[0.001];
+z=fsolve(y,frictionfactor);// Friction factor
+gradP_L1=(z*(L/D)*(rho*(V^2)/2))*(1/32.2);// lbm/ft^2
+gradP_L=gradP_L1/144;// psi
+printf('The pressure drop,gradP_L=%0.0f lbf/ft^2=%0.1f psi \n',gradP_L*144,gradP_L);
+h_L=(z*(L/D)*(V^2/(2*g)));// ft
+printf('The head loss,h_L=%0.1f ft\n',h_L);
+W_p=(v*gradP_L1)/0.737;// W
+printf('The required power input,W_pump=%0.0f W \n',W_p);
+// The answer vary due to round off error
diff --git a/3720/CH8/EX8.4/Ex8_4.sce b/3720/CH8/EX8.4/Ex8_4.sce new file mode 100644 index 000000000..5721e7a99 --- /dev/null +++ b/3720/CH8/EX8.4/Ex8_4.sce @@ -0,0 +1,33 @@ +//Example 8_4
+clc;clear;funcprot(0);
+// Given values
+P=1;// atm
+T=35;// degree celsius
+L=150;// m
+h_L=20;// m
+v=0.35;// m^3/s
+g=9.81;// m/s^2
+//Properties
+rho=1.145;// kg/m^3
+mu=1.895*10^-5;// kg/m.s
+nu=1.655*10^-5;// m^2/s
+
+//Calculation
+// V=y(1); Re=y(2); f=y(3);D=y(4)
+function[X] = Diameter(y)
+ X(1)=(v/(%pi*(y(4)^2)/4))-y(1);
+ X(2)=((y(1)*y(4))/(nu))-y(2);
+ X(3)=(-2.0*log10(2.51/(y(2)*sqrt(y(3)))))-(1/sqrt(y(3)));
+ X(4)=(y(3)*(L/(y(4))*((y(1)^2)/(2*g))))-h_L;
+endfunction
+y=[1 100000 0.01 0.1];
+z=fsolve(y,Diameter);
+V=z(1);// m/s
+Re=z(2);// Reynolds number
+f=z(3);
+D=z(4);// m
+printf('The minimum diameter of the duct,D=%0.3f m\n',D);
+//The diameter can also be determined directly from the third Swamee–Jain formula to be
+y=0;
+D=0.66*(((y^1.25*((L*v^2)/(g*h_L))^4.75))+(nu*v^9.4*(L/(g*h_L))^5.2))^0.04;
+printf('The diameter can also be determined directly from the third Swamee–Jain formula to be D=%0.3f m\n',D);
diff --git a/3720/CH8/EX8.5/Ex8_5.sce b/3720/CH8/EX8.5/Ex8_5.sce new file mode 100644 index 000000000..b92bf469a --- /dev/null +++ b/3720/CH8/EX8.5/Ex8_5.sce @@ -0,0 +1,29 @@ +//Example 8_5
+clc;clear;funcprot(0);
+//From Example 8_4
+// Given values
+P=1;// atm
+T=35;// degree celsius
+L=300;// m
+D=0.267;// m
+h_L=20;// m
+v_old=0.35;// m^3/s
+g=9.81;// m/s^2
+//Properties
+rho=1.145;// kg/m^3
+mu=1.895*10^-5;// kg/m.s
+nu=1.655*10^-5;// m^2/s
+
+//Calculation
+//V=y(1); Re=y(2); f=y(3);v=y(4)
+function[X]=flowrate(y);
+ X(1)=real((y(4)/(%pi*D^2/4))-y(1));
+ X(2)=real(((y(1)*D)/(nu))-y(2));
+ X(3)=real((-2.0*log10(2.51/(y(2)*sqrt(y(3)))))-(1/sqrt(y(3))));
+ X(4)=real(((y(3)*L*y(1)^2)/(D*2*9.81))-20);
+endfunction
+y=[1 10000 0.01 0.1];
+z= fsolve(y,flowrate);
+v_new=z(4);// m^3/s
+v_drop=v_old-v_new;//The drop in the flow rate
+printf('The drop in the flow rate through the duct.v_drop=%0.2f m^3/s\n',v_drop);
diff --git a/3720/CH8/EX8.6/Ex8_6.sce b/3720/CH8/EX8.6/Ex8_6.sce new file mode 100644 index 000000000..d3cef8d4d --- /dev/null +++ b/3720/CH8/EX8.6/Ex8_6.sce @@ -0,0 +1,23 @@ +//Example 8_6
+clc;clear;funcprot(0);
+//Given values
+V_1=7;// m/s
+P_1=150// kPa
+D_1=0.06;// m
+D_2=0.09;// m
+// Assumptions
+//alpha_1=alpha_2=1.06
+alpha_1=1.06;
+alpha_2=1.06;
+g=9.81;// m/s^2
+//Properties
+rho=1000;//The density of water in kg/m^3
+K_L=0.07;// The loss coefficient for gradual expansion
+theta=60;// Total included angle in degree
+
+//Calculation
+V_2=(D_1^2/D_2^2)*V_1;// The downstream velocity of water in m/s
+h_L=K_L*(V_1^2/(2*g));// m
+printf('The irreversible head loss in the expansion section,h_L=%0.3f m\n',h_L);
+P_2=P_1+(rho*(((alpha_1*V_1^2)-(alpha_2*V_2^2))/2-(g*h_L)))/1000;// kPa
+printf('The pressure in the larger-diameter pipe,P_2=%0.0f kPa\n',P_2);
diff --git a/3720/CH8/EX8.7/Ex8_7.sce b/3720/CH8/EX8.7/Ex8_7.sce new file mode 100644 index 000000000..4900e986e --- /dev/null +++ b/3720/CH8/EX8.7/Ex8_7.sce @@ -0,0 +1,40 @@ +//Example 8_7
+clc;clear;funcprot(0);
+//Given values
+Z_a=5;// m
+Z_b=13;// m
+D_1=0.04;
+D_2=0.08;// The diameters of the two pipes m
+L_1=36;// m
+L_2=36;// m
+W_elect=8000;// W
+n_pump=0.70;
+g=9.81;// m/s^2
+//Properties
+rho=998;// kg/m^3
+mu=1.002*10^-3;// kg/m.s
+eps=0.000045;// m
+
+//Calculation
+// V1=y(1); V2=y(2); Re1=y(3); Re2=y(4); f1=y(5);f2=y(6);h_L1=y(7);h_L2=y(8); h_pump=y(9);v1=y(10);v2=y(11);v=y(12);h_L=y(13)
+function[X]=flowrate(y);
+ X(1)=real(((rho*y(12)*g*y(9))/n_pump)-W_elect);
+ X(2)=real(((y(10)*4)/(%pi*D_1^2))-y(1));
+ X(3)=real(((y(11)*4)/(%pi*D_2^2))-y(2));
+ X(4)=real(((rho*y(1)*D_1)/(mu))-y(3));
+ X(5)=real(((rho*y(2)*D_2)/(mu))-y(4));
+ X(6)=real((-2.0*log10(((eps)/(3.7*D_1)))+(2.51/(y(3)*sqrt(y(5)))))-(1/sqrt(y(5))));
+ X(7)=real((-2.0*log10(((eps)/(3.7*D_2)))+(2.51/(y(4)*sqrt(y(6)))))-(1/sqrt(y(6))));
+ X(8)=real(((y(5)*L_1*(y(1)^2))/(D_1*g*2))-(y(7)));
+ X(9)=real(((y(6)*L_2*(y(2)^2))/(D_2*g*2))-(y(8)));
+ X(10)=real((y(10)+y(11))-y(12));
+ X(11)=real(((Z_b-Z_a)+y(13))-y(9));
+ X(12)=real(y(7)-y(13));
+ X(13)=real(y(8)-y(13));
+endfunction
+y=[1 1 100000 100000 0.01 0.01 10 10 10 0.01 0.001 0.01 10];
+fr=fsolve(y,flowrate);
+printf('The total flow rate between the reservoirs ,v=%0.4f m^3/s\n',fr(12));
+printf('The flow rate through pipe 1,v_1=%0.5f m^3/s\n',fr(10));
+printf('The flow rate through pipe 2,v_2=%0.4f m^3/s\n',fr(11));
+// The answer vary due to round off error
diff --git a/3720/CH8/EX8.8/Ex8_8.sce b/3720/CH8/EX8.8/Ex8_8.sce new file mode 100644 index 000000000..6641e1a69 --- /dev/null +++ b/3720/CH8/EX8.8/Ex8_8.sce @@ -0,0 +1,33 @@ +//Example 8_8
+clc;clear;funcprot(0);
+D=0.05;//m
+v=0.006;// m^3/s
+K_Lentrance=0.5;
+K_Lelbow=0.3;
+K_Lvalve=0.2;
+K_Lexit=1.06;// The loss coefficients
+L=89;// m
+z_2=4;// m
+//Properties
+rho=999.7;// kg/m^3
+mu=1.307*10^-3;// kg/m.s
+epsilon=0.00026; // m
+g=9.81;// m/s^2
+
+//Calculation
+A_c=(%pi*D^2)/4;//m^2
+V=v/A_c;// m/s
+Re=(rho*V*D)/mu;
+e=epsilon/D;
+// f=y(1)
+function[X]=frictionfactor(y);
+ X(1)=(-2.0*log10((e/3.7)+(2.51/(Re*sqrt(y(1))))))-(1/sqrt(y(1)));
+endfunction
+y=[0.01];
+z=fsolve(y,frictionfactor);
+f=z;//friction factor
+SigmaK_L=K_Lentrance+(2*K_Lelbow)+K_Lvalve+K_Lexit;
+h_l=((f*(L/D))+(SigmaK_L))*(V^2/(2*g));// The total head loss in m
+z_1=z_2+h_l;// m
+printf('The elevation of the source,z_1=%0.1f m\n',z_1);
+// The answer vary due to round off error
diff --git a/3720/CH8/EX8.9/Ex8_9.sce b/3720/CH8/EX8.9/Ex8_9.sce new file mode 100644 index 000000000..4a2ac653e --- /dev/null +++ b/3720/CH8/EX8.9/Ex8_9.sce @@ -0,0 +1,55 @@ +//Example 8_9 +clc;clear;funcprot(0); +//Given values +P_g=2*10^5;// N/m^2 +D=0.015;// m + +//Properties +rho=998;// kg/m^3 +mu=1.002*10^-3;// kg/m.s +nu=1.004*10^-6;// m^2/s +epsilon=1.5*10^-6;//The roughness of copper pipes in m +g=9.81;// m/s^2 + +//Calculation +//(a) +SigmaK_l=0.9+(2*0.9)+10+12; +h_l=(P_g/(rho*g))-2;// m +// h_l=((f*L/D)+SigmaK_l)*(V^2/(2*g)) +// V=(v/A_c) +// Re=(V*D)/nu +// (1/sqrt(f))=-2.0*log*(((e/D)/3.7)+(2.51/(Re*sqrt(f)))) +// f = y(1) ; V = y(2); Vdot = y(3); Re= y(4); +function[X] = flowrate(y) + + X(1)=(((y(1)*(11/D))+SigmaK_l)*y(2)^2/(2*g))-h_l; + X(2)=(y(3)*4)/(%pi*D^2)-y(2); + X(3)=((y(2)*D)/(nu))-y(4); + X(4)=-2.0*log10(((epsilon)/(3.7*D))+((2.51)/(y(4)*sqrt(y(1)))))-1/sqrt(y(1)); +endfunction +y=[0.001 1 0.0001 10000]; //Initial conditions for all four variables +z = fsolve(y,flowrate); // Solver Initilisation +y(3)=z(3)*1000// The flow rate of water through the shower head in L/s +printf('(a)The flow rate of water through the shower head,v=%0.02f L/s\n',y(3)); + +//(b) +h_l3=P_g/(rho*g); +SigmaK_l3=2+10+0.9+14; +// f1=y(1) ; V1=y(2); V2=y(3); V3=y(4) ;Vdot1=y(5); Vdot2=y(6);Vdot3=y(7);Re1=y(8);Re2=y(9);Re3=y(10); f2=y(11); f3=y(12) +function[X]=flowrate(y) + X(1)=real(((y(1)*(5*y(2)^2)/(D*2*g)))+(((y(11)*6/D)+24.7)*(y(3)^2)/(2*g))-h_l); + X(2)=real(((y(1)*(5*y(2)^2)/(D*2*g)))+((((y(12)*1/D))+SigmaK_l)*(y(4)^2/(2*g)))-h_l3); + X(3)=real(((y(5)*4)/(%pi*D^2))-y(2)); + X(4)=real(((y(6)*4)/(%pi*D^2))-y(3)); + X(5)=real(((y(7)*4)/(%pi*D^2))-y(4)); + X(6)=real((y(2)*(D)/(nu))-y(8)); + X(7)=real((y(3)*(D)/(nu))-y(9)); + X(8)=real((y(4)*(D)/(nu))-y(10)); + X(9)=real((-2.0*log10(((epsilon)/(3.7*D))+((2.51)/(y(8)*sqrt(y(1))))))-1/sqrt(y(1))); + X(10)=real((-2.0*log10(((epsilon)/(3.7*D))+((2.51)/(y(9)*sqrt(y(11))))))-1/sqrt(y(11))); + X(11)=real((-2.0*log10(((epsilon)/(3.7*D))+((2.51)/(y(10)*sqrt(y(12))))))-1/sqrt(y(12))); + X(12)=real(y(6)+y(7)-y(5)); +endfunction +y=[0.001 1 1 1 0.0001 0.0001 0.0001 10000 10000 10000 0.001 0.001]; +z=fsolve(y,flowrate); +printf('(b)reduces the flow rate of cold water through the shower by 21 percent\n') |