summaryrefslogtreecommitdiff
path: root/Basic_Fluid_Mechanics_by_Peerless/ch7.ipynb
blob: 3818de1b9687d2649d37563b1d1c480b7d6f7ec8 (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
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
{
 "metadata": {
  "name": "",
  "signature": "sha256:fb647d6d0a9fd1fab503f1e20b9cd4c1b8f196f963f97a28e2375980e25dde26"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 : Steady, One-Dimensional, Irreversible Flow"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1 Page No : 213"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\n",
      "#initialisation of variables\n",
      "r= 1.5\n",
      "f= 0.025   # friction factor\n",
      "\t\n",
      "#CALCULATIONS\n",
      "r1= (2/f)*(r**2-1)\n",
      "\t\n",
      "#RESULTS\n",
      "print  'ratio L/D2 = %.f'%(r1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "ratio L/D2 = 100\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2 Page No : 214"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\t\n",
      "#initialisation of variables\n",
      "a= 6.    \t#degrees angle\n",
      "r= 1.5\n",
      "l= 100.  \t#ft\n",
      "f= 0.025\n",
      "K= 0.15\n",
      "\t\n",
      "#CALCULATIONS\n",
      "R= r**4-1\n",
      "R1= 1/math.tan(math.radians(a/2))*(1-(1./r))\n",
      "p1= f*l\n",
      "p2= 2.5*(l-p1)/l\n",
      "p3= (1-r**2)**2\n",
      "p4= K*p3\n",
      "pt= p4+p2\n",
      "\t\n",
      "#RESULTS\n",
      "print  ' lowest ratio = %.2f'%(R)\n",
      "print  ' contribtuion of friction in pipe = %.3f lbf/ft**2'%(p1)\n",
      "print  ' contribtuion of diffuser in pipe = %.3f lbf/ft**2'%(p2)\n",
      "print  ' stagnant pressure drop = %.3f lbf/ft**2'%(p3)\n",
      "print  ' contribtuion of friction in pipe after reduction = %.3f lbf/ft**2'%(pt)\n",
      "\n",
      "# note : rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " lowest ratio = 4.06\n",
        " contribtuion of friction in pipe = 2.500 lbf/ft**2\n",
        " contribtuion of diffuser in pipe = 2.438 lbf/ft**2\n",
        " stagnant pressure drop = 1.562 lbf/ft**2\n",
        " contribtuion of friction in pipe after reduction = 2.672 lbf/ft**2\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3 Page No : 219"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\n",
      "#initialisation of variables\n",
      "d= 4. \t    #in galvanised iron pipe diameter\n",
      "q= 0.5 \t    #ft**3/sec  flow rate\n",
      "w= 62.4 \t#lb/ft**3 density\n",
      "u= 2.7*10**-5 \t#lbf sec/ft**2 viscosity\n",
      "e= 0.0005 \t#ft\n",
      "g= 32.1 \t#ft/sec**2 acceleration\n",
      "f= 0.0235\n",
      "lt= 400. \t#ft long\n",
      "\t\n",
      "#CALCULATIONS\n",
      "V= 4*q/(math.pi*(d/12)**2)\n",
      "Re= w*V*(d/12)/(u*g)\n",
      "r= e/(d/12)\n",
      "dz= (V**2/(2*g))*(1.7+f*lt/(d/12))\n",
      "\t\n",
      "#RESULTS\n",
      "print  ' mean flow velocity = %.2f ft/sec'%(V)\n",
      "print  ' Reynolds number = %.2e'%(Re)\n",
      "print  ' Relative roughness = %.4f'%(r)\n",
      "print  ' difference in the levels of water = %.1f ft'%(dz)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " mean flow velocity = 5.73 ft/sec\n",
        " Reynolds number = 1.38e+05\n",
        " Relative roughness = 0.0015\n",
        " difference in the levels of water = 15.3 ft\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4 Page No : 220"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\n",
      "#initialisation of variables\n",
      "d= 4.    \t#in\n",
      "v= 6.64 \t#ft/sec\n",
      "\t\n",
      "#CALCULATIONS\n",
      "Q= math.pi*0.25*(d/12)**2*v\n",
      "\t\n",
      "#RESULTS\n",
      "print  'Flow rate= %.3f ft**3/sec'%(Q)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flow rate= 0.579 ft**3/sec\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5 Page No : 221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\n",
      "#initialisation of variables\n",
      "d= 0.366 \t#ft\n",
      "i= 12\n",
      "\t\n",
      "#CALCULATIONS\n",
      "pd= d*i\n",
      "\t\n",
      "#RESULTS\n",
      "print  'Required pipe diameter = %.2f in'%(pd)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Required pipe diameter = 4.39 in\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.6 Page No : 222"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\n",
      "#initialisation of variables\n",
      "Ps1= 1050. \t#lbf/ft**2\n",
      "fr= 10.7\n",
      "p= 36.6 \t#lbf/ft**2\n",
      "p1= 195. \t#lbf/ft**2\n",
      "fr1= 16.\n",
      "fr2= 1.8\n",
      "\t\n",
      "#CALCULATIONS\n",
      "deltap = (p+957+p1+Ps1)\n",
      "p2= round(fr*p)\n",
      "dp= Ps1-p2\n",
      "lc= round(dp/p)\n",
      "sp= Ps1+p1-p*(fr1+fr2)\n",
      "lc1= sp/p\n",
      "\n",
      "#RESULTS\n",
      "print  ' Pressure = %.f lbf/ft**2'%(round(deltap,-1))\n",
      "print  ' pressure difference = %.f lbf/ft**2'%(dp)\n",
      "print  ' Loss coefficient = %.f '%(lc)\n",
      "print  ' Loss coefficient = %.1f '%(lc1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Pressure = 2240 lbf/ft**2\n",
        " pressure difference = 658 lbf/ft**2\n",
        " Loss coefficient = 18 \n",
        " Loss coefficient = 16.2 \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.7 Page No : 232"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\n",
      "#initialisation of variables\n",
      "p1= 50. \t#lbf/in**2 pressure\n",
      "R= 96.3 \t#ft lbf/lbm R\n",
      "T= 80. \t    #F temperature\n",
      "p2= 20. \t#lbf/in**2 pressure\n",
      "r= 1.31\n",
      "u= 2.34*10**-7 \t#lbf sec/ft**2\n",
      "e= 0.00005 \t    #ft\n",
      "m= 5.*10**4 \t#lbm/sec\n",
      "d= 1.5 \t        #ft\n",
      "g= 32.2 \t    #ft/sec**2\n",
      "f= 0.113\n",
      "\t\n",
      "#CALCULATIONS\n",
      "w1= p1*144/(R*(460+T))\n",
      "V1= 4*(m/3600)/(math.pi*w1*d**2)\n",
      "Ma1= V1/(r*R*g*(460+T))**0.5\n",
      "Re= w1*V1*d/(u*g)\n",
      "dx= (((1/(r*Ma1**2))*10*(1-(p2/p1)**2))+math.log(p2/p1))*d/f\n",
      "\t\n",
      "#RESULTS\n",
      "print  ' density = %.3f lbm/ft**3'%(w1)\n",
      "print  ' mean flow velocity = %.1f ft/sec'%(V1)\n",
      "print  ' Match number = %.4f '%(Ma1)\n",
      "print  ' Reynolds number = %.2e '%(Re)\n",
      "print  ' Length of pipe = %.2e ft'%(dx)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " density = 0.138 lbm/ft**3\n",
        " mean flow velocity = 56.8 ft/sec\n",
        " Match number = 0.0383 \n",
        " Reynolds number = 1.56e+06 \n",
        " Length of pipe = 5.79e+04 ft\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.9 Page No : 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\n",
      "#initialisation of variables\n",
      "r= 1.4\n",
      "R= 53.3 \t#ft lbf/lbm R\n",
      "g= 32.2 \t#ft/sec**2\n",
      "T1= 410. \t#R temperature\n",
      "v= 2500. \t#ft/sec steadility\n",
      "P1= 628. \t#lbf/in**2 pressure\n",
      "\t\n",
      "#CALCULATIONS\n",
      "v1= int(math.sqrt(r*g*R*T1))\n",
      "Ma1= round(v/v1,2)\n",
      "Ts1= int(T1*(1+0.5*(r-1)*Ma1**2))\n",
      "Ps1= P1*(1+0.5*(r-1)*Ma1**2)**(r/(r-1))\n",
      "Ps2= Ps1*((r+1)/(2*r*Ma1**2-r+1))**(1/(r-1))*(0.5*(r+1)*Ma1**2/(1+0.5*(r-1)*Ma1**2))**(r/(r-1))\n",
      "\n",
      "#RESULTS\n",
      "print  ' acoustic velocity = %.f ft/sec'%(v1)\n",
      "print  ' Match number = %.2f '%(Ma1)\n",
      "print  ' Stagnition temperature = %.f R'%(Ts1)\n",
      "print  ' Stagnition pressure = %.f lbf/ft**2'%(Ps1)\n",
      "print  ' Stagnition pressure = %.f lbf/ft**2'%(Ps2)\n",
      "\n",
      "# note : answer in book is wrong. Please check manually.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " acoustic velocity = 992 ft/sec\n",
        " Match number = 2.52 \n",
        " Stagnition temperature = 930 R\n",
        " Stagnition pressure = 11069 lbf/ft**2\n",
        " Stagnition pressure = 5435 lbf/ft**2\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.10 Page No : 245"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "p2= 67.2 \t#lbf/in**2 pressure\n",
      "p1= 63. \t#lbf/in62 pressure\n",
      "r= 1.4\n",
      "n= 0.6      # efficiency\n",
      "T1= 870. \t#R temperature\n",
      "ma1= 0.8 \t#ft/sec mach number\n",
      "\n",
      "#CALCULATIONS\n",
      "dt= (p2/p1)**((r-1)/r)-1\n",
      "dt1= dt/n\n",
      "T2= T1*(1+dt1)\n",
      "Ts1= T1*(1+0.5*(r-1)*ma1**2)\n",
      "ps1= p1*(1+0.5*(r-1)*ma1**2)**(r/(r-1))\n",
      "ps2= p2*(Ts1/T2)**(r/(r-1))\n",
      "dp= ps1-ps2\n",
      "\n",
      "#RESULTS\n",
      "print  ' dT = %.5f '%(dt)\n",
      "print  ' dT1 = %.5f '%(dt1)\n",
      "print  ' Temperature = %.f R'%(T2)\n",
      "print  ' Temperature = %.1f R'%(Ts1)\n",
      "print  ' Pressure = %.1f lbf/in**2'%(ps1)\n",
      "print  ' Pressure = %.1f lbf/in**2'%(ps2)\n",
      "print  ' pressure difference = %.1f lbf/in**2'%(dp)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " dT = 0.01861 \n",
        " dT1 = 0.03102 \n",
        " Temperature = 897 R\n",
        " Temperature = 981.4 R\n",
        " Pressure = 96.0 lbf/in**2\n",
        " Pressure = 92.0 lbf/in**2\n",
        " pressure difference = 4.0 lbf/in**2\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.11 Page No : 246"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "r= 1.4\n",
      "ma3= 3. \t#ft/sec mach number\n",
      "ps= 80. \t#lbf/ft**2 pressure\n",
      "Ts= 840. \t#R temperature\n",
      "r1= 53.3 \t#ft lbm/ft**3\n",
      "A3= 2.   \t#in**2 flow area\n",
      "g= 32.2 \t#ft/sec**2\n",
      "ma1= 1.6\n",
      "\n",
      "#CALCULATIONS\n",
      "R= (1+(r-1)*0.5*ma3**2)**(r/(r-1))\n",
      "p3= ps/R\n",
      "R1= 1+0.5*(r-1)*ma3**2\n",
      "T3= Ts/R1\n",
      "w3= p3*144/(r1*T3)\n",
      "V3= ma3*math.sqrt(r*r1*g*T3)\n",
      "m= w3*V3*A3/144\n",
      "ra= ((r+1)/(2*r*ma1**2-(r-1)))**(1/(r-1))*(0.5*(r+1)*ma1**2/(1+0.5*(r-1)*ma1**2))**(r/(r-1))\n",
      "ps2= ps*ra\n",
      "dp= ps-ps2\n",
      "\n",
      "#RESULTS\n",
      "print  ' outlet pressure = %.2f lbf/in**2'%(p3)\n",
      "print  ' outlet temperature = %.f R'%(T3)\n",
      "print  ' mass flow rate = %.3f lbm/sec'%(m)\n",
      "print  ' ps2 = %.1f lbf/in**2'%(ps2)\n",
      "print  ' Stagnation pressure loss = %.1f lbf/in**2'%(dp)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " outlet pressure = 2.18 lbf/in**2\n",
        " outlet temperature = 300 R\n",
        " mass flow rate = 0.694 lbm/sec\n",
        " ps2 = 71.6 lbf/in**2\n",
        " Stagnation pressure loss = 8.4 lbf/in**2\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}