summaryrefslogtreecommitdiff
path: root/797/CH8/EX8.10.s/8_10_solution.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /797/CH8/EX8.10.s/8_10_solution.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 '797/CH8/EX8.10.s/8_10_solution.sce')
-rw-r--r--797/CH8/EX8.10.s/8_10_solution.sce25
1 files changed, 25 insertions, 0 deletions
diff --git a/797/CH8/EX8.10.s/8_10_solution.sce b/797/CH8/EX8.10.s/8_10_solution.sce
new file mode 100644
index 000000000..caefd729d
--- /dev/null
+++ b/797/CH8/EX8.10.s/8_10_solution.sce
@@ -0,0 +1,25 @@
+//Solution 8-10
+WD=get_absolute_file_path('8_10_solution.sce');
+datafile=WD+filesep()+'8_10_example.sci';
+clc;
+exec(datafile)
+//unit conversions
+D = D / 100; //from [cm] to [m]
+d = d / 100; //from [cm] to [m]
+h = h / 100; //from [cm] to [m]
+beta1 = d / D; //diameter ratio
+A_0 = %pi / 4 * d**2; //area of orifice
+deltaP = (rho_Hg - rho_met) * g * h;
+C_d = 0.5; //guess value for discharge coefficient of orifice
+C_dold =1.0;
+//iterative scheme to find correct value of coefficient of discharge
+while abs(C_dold - C_d) > 0.0001
+ C_dold = C_d;
+ Vdot = A_0 * C_dold * sqrt(2 * deltaP / rho_met / (1 - beta1**4));
+ V_avg = Vdot / (%pi / 4 * D**2);
+ Re = rho_met * V_avg * D / mu;
+ C_d = 0.5959 + 0.0312*beta1**2.1 - 0.184*beta1**8 + 91.71 * beta1**2.5 / Re**0.75;
+end
+printf("Flow rate of methanol is %1.2f L/s", Vdot * 10**3);
+printf("\nAverage velocity of methanol is %1.2f m/s", V_avg);
+printf("\nReynolds number of flow is %1.2e", Re); \ No newline at end of file