summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics-Fundamentals_&_Applications/Chapter08_1.ipynb
blob: e70edd0378f0b9060222c9261ce1ef094743b32b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
{
 "metadata": {
  "name": "",
  "signature": "sha256:11a32dcbb7adff422edff329d33e29629cd83e2f8ab7cf7ac7803e8cbd9385ca"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 08:Internal Flow"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-1, Page No:349"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "u_max=6 #Maximum Velocity in m/s\n",
      "R=0.02 #Radius of the Pipe in m\n",
      "L=70 #Length of the pipe in m\n",
      "rho=1252 #Density of glycerin in kg/m^3\n",
      "u=0.3073 #Viscosity of glycerin in kg/m.s\n",
      "g=9.81 #Acceleration due to gravity in m/s^2\n",
      "C=10**-3 #Conversion factor\n",
      "\n",
      "#Calculations\n",
      "D=R*2 #Diameter of the pipe in m\n",
      "V=u_max/2 #Average Velocity in m/s\n",
      "V_dot=V*(pi*R**2) #Volumertic Flow rate in m^3/s\n",
      "Re=(rho*V*D)/u #Reynolds Number \n",
      "f=64/Re #Friction Factor\n",
      "h_L=(f*L*V**2)/(2*g*D) #Head loss in m\n",
      "theta=(pi*15)/180 #Angle in radians\n",
      "\n",
      "#Applying the energy balance equation\n",
      "#As z2=z1 z2-z1=0 hence we do not consider it in the computation\n",
      "delta_P=rho*g*(h_L)*C #Pressure difference in kPa\n",
      "W_dot=V_dot*delta_P #Useful pumping Power in kW\n",
      "\n",
      "#Inclined Case\n",
      "delta_z=L*sin(theta) #elevation difference in m\n",
      "delta_P_up=(rho*g*delta_z*C)+(rho*g*h_L*C) #Pressure difference up in kPa\n",
      "V_dot_upward=W_dot/delta_P_up #Flow rate through the upward pipe in m^3/s\n",
      "\n",
      "#Percentage Calculations\n",
      "per_V=((V_dot-V_dot_upward)/V_dot)*100 #Percentage change in the flow rate\n",
      "\n",
      "#Result\n",
      "print \"The velocity of the flow is\",round(V),\"m/s\"\n",
      "print \"The pressure difference across 70m long pipe is\",round(delta_P),\"kPa\"\n",
      "print \"The power required to maintain the flow is\",round(W_dot,2),\"kW\"\n",
      "print \"The percentage change in the flow rate is\",round(per_V,1),\"%\"\n",
      "#Answer for percentage change and flow rate through the pipe upward direction are incorrect"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity of the flow is 3.0 m/s\n",
        "The pressure difference across 70m long pipe is 1291.0 kPa\n",
        "The power required to maintain the flow is 4.87 kW\n",
        "The percentage change in the flow rate is 14.7 %\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-2, Page No:350"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "rho=1000 #Density of water in kg/m^3\n",
      "u=1.519*10**-3 #Viscosity of water in kg/m.s\n",
      "L=9 #Length of the pipe in m\n",
      "D=0.003 #Diameter of the pipe in m\n",
      "V=0.9 #Average velocity inside the pipe of water in m/s\n",
      "g=9.81 #Acceleration due to gravity in m/s^2\n",
      "\n",
      "#Calculations\n",
      "#Part(a)\n",
      "\n",
      "Re=(rho*V*D)/u #Reynolds Number\n",
      "f=64/Re #Friction Factor\n",
      "h_L=(f*L*V**2)/(2*g*D) #Head Loss in m\n",
      "\n",
      "#Part(b)\n",
      "delta_P=(f*L*V**2)/(2*D) #Pressure difference in kPa\n",
      "\n",
      "#Part(c)\n",
      "V_dot=(V*pi*D**2)/4 #Volumetric Flow rate in m^3/s\n",
      "W_dot=V_dot*delta_P*1000 #Pumping power required in W\n",
      "\n",
      "#Result\n",
      "print \"The Head Loss is\",round(h_L,2),\"m\"\n",
      "print \"The pressure drop is\",round(delta_P,1),\"kPa\"\n",
      "print \"The pumping power required is\",round(W_dot,2),\"W\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Head Loss is 4.46 m\n",
        "The pressure drop is 43.7 kPa\n",
        "The pumping power required is 0.28 W\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-3, Page No:360"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "rho=999 #Density of water in kg/m^3\n",
      "u=1.138*10**-3 #Viscosity in kg/m.s\n",
      "D=0.05 #Diameter of the pipe in m\n",
      "V_dot= 0.006 #Volumetric Flow rate in m^3/s\n",
      "L=60 #Length of the pipe in m\n",
      "e=0.002 #Relative roughness value from table\n",
      "f=0.0172 #Value from Moody Chart\n",
      "g=9.81 #Acceleration due to gravity in m/s^2\n",
      "\n",
      "#Calculations\n",
      "V=round((V_dot*4)/(pi*D**2),2) #Velocity of the flow in the pipe in m/s\n",
      "Re=(rho*V*D)/u #Reynolds Number\n",
      "e_D=e/(D*1000) #Relative roughness\n",
      "\n",
      "#Taking the value for root f from Moody Chart as f=0.0172\n",
      "delta_P=(f*L*rho*V**2)/(D*2) #Pressure Drop in N/m^2\n",
      "h_L=delta_P/(rho*g) #Head Loss in m\n",
      "W_pump=V_dot*delta_P #Required Power in W\n",
      "\n",
      "#Result\n",
      "print \"The Pressure Drop is\",round(delta_P),\"N/m^2\"\n",
      "print \"The head loss is\",round(h_L,2),\"m\"\n",
      "print \"The Power required is\",round(W_pump),\"W\" \n",
      "\n",
      "#The answer for delta_P is off by 4 due to decimal accuracy in the formula\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Pressure Drop is 96536.0 N/m^2\n",
        "The head loss is 9.85 m\n",
        "The Power required is 579.0 W\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-4, Page No:361"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "V_dot=0.35 #Volumertic flow rate in m^3/s\n",
      "L=150 #Length of the pipe in m\n",
      "rho=1.145 #Density of the fluid in kg/m^3\n",
      "u=1.895*10**-5 #Dynamic viscosity of the fluid in kg/m.s\n",
      "v=1.655*10**-5 #Kinematic Viscosity of the fluid in m^2/s\n",
      "h_l=20 #Allowable head loss in m\n",
      "g= 9.81 #Acceleration due to gravity in m/s^2\n",
      "\n",
      "#The following three equations are solved using EES hence we will be taking the values directly here\n",
      "D=0.267 #Diameter of the pipe in m\n",
      "f=0.0180\n",
      "V=6.24 #Velocity of low in m/s\n",
      "Re=100800 #Reynolds Number\n",
      "\n",
      "#Calculations\n",
      "#Simplfying the calculations\n",
      "c=V_dot**9.4\n",
      "d=L/(g*h_l)\n",
      "f=d**5.2\n",
      "#Using Swamee-Jain Formula\n",
      "D=0.66*((v*c*f)**0.04) #Diameter of the pipe in m\n",
      "\n",
      "#Result\n",
      "print \"The diameter of the pipe is\",round(D,3),\"m\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The diameter of the pipe is 0.271 m\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-5, Page No:362"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Deceleration\n",
      "#Using the computationally simple method given in the discussion\n",
      "\n",
      "g=9.81 #Acceleration due to gravity in m/s^2\n",
      "D=0.267 #Diameter in m\n",
      "h_l=20 #Head loss in m\n",
      "L=300 #Length of the pipe in m\n",
      "v=1.655*10**-5 #Kinematic Voscosity in m^2/s\n",
      "V_dot_old=0.35 #Volumetric Flow rate in m^3/s\n",
      "\n",
      "#Calculations\n",
      "a=((3.17*v**2*L)/(g*D**3*h_l))**0.5\n",
      "b=log(a)\n",
      "c=((g*D**5*h_l)/L)**0.5\n",
      "\n",
      "V_dot_new=-0.965*b*c #Volumetric Flow rate in m^3/s\n",
      "V_dot=V_dot_old-V_dot_new #Drop in the flow rate in m^/s\n",
      "\n",
      "print \"The drop in the flow rate is\",round(V_dot,2),\"m^3/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drop in the flow rate is 0.11 m^3/s\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-6, Page No:370"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "D1=0.06 #Diameter of the pipe at section 1 in m\n",
      "D2=0.09 #Diameter of the pipe at section 2 in m\n",
      "V1=7 #Average Velocity at section 1 in m/s\n",
      "K_l=0.133 # interpolating from table\n",
      "g=9.81 #Acceleration due to gravity in m/s^2\n",
      "P1=150 #Pressure head at section one in kPa\n",
      "rho=1000 #Density of the fluid in kg/m^3\n",
      "alpha1=1.06 #momentum correction factor\n",
      "alpha2=alpha1 #momentum correction factor\n",
      "C=10**-3 #Conversion factor\n",
      "\n",
      "#Calculations\n",
      "#Applying the one dimensional continuity equation\n",
      "V2=(D1**2/D2**2)*V1 #Velocity of the fluid at section 2 in m/s\n",
      "\n",
      "#Irreversible head loss\n",
      "h_l=K_l*(V1**2/(2*g)) #Irreversible head loss in m\n",
      "\n",
      "#Using the energy equation\n",
      "P2=P1+rho*(((alpha1*V1**2-alpha2*V2**2)*0.5)-g*h_l)*C #Pressure head at section 2 in kPa\n",
      "\n",
      "#Result\n",
      "print \"The head loss is\",round(h_l,4),\"m\"\n",
      "print \"The pressure head at section two is\",round(P2),\"kPa\"\n",
      "#The answer differs due to decimal point accuracy\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The head loss is 0.3322 m\n",
        "The pressure head at section two is 168.0 kPa\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-8, Page No:377"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable decleration\n",
      "rho=999.7 #Density of the fluid in kg/m^3\n",
      "u=1.307*10**-3 # Dynamic Viscosity in kg/m.s \n",
      "e=0.00026 #Roughness of cast iron in m\n",
      "V_dot=0.006 #Volumetric Flow rate in m^3/s\n",
      "z2=4 #static head at section 2 in m\n",
      "D=0.05 #Diameter of the pipe in m\n",
      "#Kl declerations\n",
      "Kl_entrance=0.5\n",
      "Kl_elbow=0.3\n",
      "Kl_valve=0.2\n",
      "Kl_exit=1.06\n",
      "f=0.0315 #Using Moody Chart and Colebrook Equation friction factor\n",
      "L=89 #Length of the pipe in m                                \n",
      "g=9.81 #Acceleration due to gravity in m/s^2\n",
      "\n",
      "#Calculations\n",
      "V=(V_dot*4)/(pi*D**2)  #Average Velocity in the pipe in m/s\n",
      "Re=(rho*V*D)/u #Reynolds Number\n",
      "e_D=e/D\n",
      "sum_Kl=Kl_entrance+2*Kl_elbow+Kl_valve+Kl_exit #Summation of all Kl\n",
      "#Total Head Loss\n",
      "h_l=(((f*L)/D)+sum_Kl)*(V**2/(2*g)) #Total head loss in m\n",
      "\n",
      "#Using Energy equation\n",
      "z1=z2+h_l #Free surface of the first reservoir in m\n",
      "\n",
      "#Result\n",
      "print \"The elevation of the free surface of the first reservoir is\",round(z1,1),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The elevation of the free surface of the first reservoir is 31.8 m\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8-10, Page No:385"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "rho_met=788.4 #Density of the fluid in kg/m^3\n",
      "u=5.857*10**-4 #Dynamic Viscosity in kg/m.s\n",
      "rho_hg=13600 #Density of mercury in kg/m^3\n",
      "d=0.03 #diameter of the orifice meter in m\n",
      "D=0.04 #Diameter of the pipe in m\n",
      "h=0.11 #differential height of the manometer in m\n",
      "g=9.81 #Acceleration due to gravity in m/s^2\n",
      "Cd=0.61 #Coefficient of discharge\n",
      "\n",
      "#Calculations\n",
      "beta=d/D #Diameter ratio\n",
      "Ao=(pi*d**2)/4 #Area of throat in m^2\n",
      "\n",
      "#Pressure Drop\n",
      "delta_P=(rho_hg-rho_met)*g*h #Pressure drop in m\n",
      "\n",
      "#Flow rate\n",
      "V_dot=Ao*Cd*(((2*delta_P)/(rho_met*(1-beta**4)))**0.5) #Volumetric Flow rate in m^3/s\n",
      "V=(V_dot*4)/(pi*D**2) #Average Velocity in m/s\n",
      "\n",
      "#Reynolds Number\n",
      "Re=(rho_met*V*D)/u #Reynolds Number\n",
      "\n",
      "#Coefficient of Discharge\n",
      "Cd_calculations=0.5959+0.0312*beta**2.1-0.184*beta**8+((91.71*beta**2.50)/Re**0.75)\n",
      "\n",
      "#Result\n",
      "print \"The flow rate of methanol in the pipe is\",round(V_dot,5),\"m^3/s\"\n",
      "print \"The average velocity of low in the pipe is\",round(V,2),\"m/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The flow rate of methanol in the pipe is 0.00309 m^3/s\n",
        "The average velocity of low in the pipe is 2.46 m/s\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}