summaryrefslogtreecommitdiff
path: root/3785/CH7/EX7.1/Ex7_1.sce
diff options
context:
space:
mode:
Diffstat (limited to '3785/CH7/EX7.1/Ex7_1.sce')
-rw-r--r--3785/CH7/EX7.1/Ex7_1.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/3785/CH7/EX7.1/Ex7_1.sce b/3785/CH7/EX7.1/Ex7_1.sce
new file mode 100644
index 000000000..d65b2e7a8
--- /dev/null
+++ b/3785/CH7/EX7.1/Ex7_1.sce
@@ -0,0 +1,27 @@
+// Example 7_1
+clc;funcprot(0);
+// Given data
+D=6;// The diameter of a steel pipe in inch
+Q=2000;// Volume flow rate in gpm
+L=1.0;// Length in km
+nu=1.0*10^-6;// Kinematic viscosity in m^2/s
+rho=1*10^3;// The density of water in kg/m^3
+
+// Calculation
+// (a)
+D=D*2.54*10^-2;// m
+Q=(Q*3.782*10^-3)/60;// m^3/s
+Vbar=(4*Q)/(%pi*D^2);// m/s
+Re_D=(Vbar*D)/nu;// Reynolds number
+// (b)
+epsilon=5*10^-5;// physical height in m
+function[X]=frictionfactor(y)
+ X(1)=-(2.0*log10(((epsilon/D)/3.7)+(2.51/(Re_D*sqrt(y(1))))))-(1/sqrt(y(1)));
+endfunction
+// Guessing a value of f=1*10^-2;
+y=[1*10^-2];
+f=fsolve(y,frictionfactor);
+dp=f*((1/2)*rho*Vbar^2)*((L*10^3)/D);// The pressure drop in Pa
+P=dp*Q;// The power required to maintain the flow in W
+printf("\n(a)Re_D=%1.3e.The How is turbulent since the Reynolds number exceeds the transition value of 2300. \n(b)The pressure drop,deltap=%1.3e Pa \n(c)The power required to maintain the flow,P=%1.3e W",Re_D,dp,P);
+// The answer is varied due to round off error