summaryrefslogtreecommitdiff
path: root/3785/CH7/EX7.1/Ex7_1.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3785/CH7/EX7.1/Ex7_1.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
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