summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics_by_John_F._Douglas/Chapter_5.ipynb
blob: b12249f7a1623cddc4d01b2d3c702cfe2334b99a (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:04c1d9ce4358772aaf36727d98b4d1c000b18de791fe80fc4e6e1ac3cabc0050"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5: The Momentum Equation and its Applications"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1, Page 119"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables  \n",
      "\n",
      "l  =  60  ;                                                                #Length  of  pipeline\n",
      "rho  =  1000;                                                          #  Density  of  liquid\n",
      "a  =  0.02;                                                              #Acceleration  of  fluid\n",
      "\n",
      " #Calculations\n",
      "delP  =  rho*l*a;                                                  #Change  in  pressure\n",
      "print \"Increase of pressure difference required (kN/m2):\",delP/1000"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Increase of pressure difference required (kN/m2): 1.2\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables  \n",
      "v  =  5;                                 #Velocity  of  jet          \n",
      "rho  =  1000;                            #density  of  water\n",
      "d  =  0.025;                             #Diameter  of  fixed  nozzle\n",
      "\n",
      " #Calculations\n",
      " #--Part(a)  Variation  of  force  exerted  normal  to  the  plate  with  plate  angle--//\n",
      "header  =  \"Theta\\t vcos(x)\\t pAv\\t Force\"\n",
      "unit  =    \"deg\\t m/s\\t kg/s\\t N\"\n",
      "\n",
      "A  =  math.pi*d**2/4;\n",
      "x  =  range(0,91,15);\n",
      "for c in range(len(x)):\n",
      "    x[c]=1.0*x[c]\n",
      "m  =  round(rho*A*v,2);\n",
      "ma  =  [m,m,m,m,m,m,m];\n",
      "vcomp=[]\n",
      "force=[]\n",
      "for c in x:\n",
      "    vcomp.append(round(v*math.cos(math.radians(c)),2))\n",
      "    force.append(round((rho*A*v**2)*math.cos(math.radians(c)),2))\n",
      "\n",
      "print header\n",
      "print unit\n",
      "for c in range(len(x)):\n",
      "    mm=str(x[c])+' \\t '+str(vcomp[c])+' \\t'+str(ma[c])+' \\t'+str(force[c])\n",
      "    print mm\n",
      "##value  = [x,vcomp,ma,force]\n",
      "##print value,unit, header\n",
      "\n",
      " #--Part(b)  Variation  of  force  exerted  normal  to  the  plate  with  plate  velocity--//        \n",
      "header  =\"Theta\\t v\\t u\\t v-u\\t pA(v-u)\\t Force\\t\"\n",
      "unit    =\"deg\\t m/s\\t m/s\\t m/s\\t kg/s\\t N\\t\"\n",
      "x  =  [0,0,0,0,0]\n",
      "v  =  [5,5,5,5,5]\n",
      "u  =  range(2,-3,-1);\n",
      "D=[]\n",
      "Prod=[]\n",
      "Force=[]\n",
      "for c in range(5):\n",
      "    D.append(v[c]-u[c])\n",
      "    Prod.append(round((rho*A*D[c]),2))\n",
      "    Force.append(round((rho*A*D[c]**2),2))\n",
      "    \n",
      "print '\\n',\"(b)\",\"\\n\",header\n",
      "print unit\n",
      "for c in range(len(x)):\n",
      "    mm=str(x[c])+' \\t '+str(v[c])+' \\t '+str(u[c])+' \\t '+str(D[c])+' \\t '+str(Prod[c])+' \\t '+str(Force[c])\n",
      "    print mm\n",
      "    \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Theta\t vcos(x)\t pAv\t Force\n",
        "deg\t m/s\t kg/s\t N\n",
        "0.0 \t 5.0 \t2.45 \t12.27\n",
        "15.0 \t 4.83 \t2.45 \t11.85\n",
        "30.0 \t 4.33 \t2.45 \t10.63\n",
        "45.0 \t 3.54 \t2.45 \t8.68\n",
        "60.0 \t 2.5 \t2.45 \t6.14\n",
        "75.0 \t 1.29 \t2.45 \t3.18\n",
        "90.0 \t 0.0 \t2.45 \t0.0\n",
        "\n",
        "(b) \n",
        "Theta\t v\t u\t v-u\t pA(v-u)\t Force\t\n",
        "deg\t m/s\t m/s\t m/s\t kg/s\t N\t\n",
        "0 \t 5 \t 2 \t 3 \t 1.47 \t 4.42\n",
        "0 \t 5 \t 1 \t 4 \t 1.96 \t 7.85\n",
        "0 \t 5 \t 0 \t 5 \t 2.45 \t 12.27\n",
        "0 \t 5 \t -1 \t 6 \t 2.95 \t 17.67\n",
        "0 \t 5 \t -2 \t 7 \t 3.44 \t 24.05\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3, Page 123"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "  \n",
      "\n",
      " #Initializing  the  variables  \n",
      "x  =  60;                                                     #Angle  of  deflection theta\n",
      "rho  =  1000;                                                 #  Density  of  liquid\n",
      "V1  =  30;                                                    #Acceleration  of  fluid\n",
      "V2  =  25;\n",
      "m  =  .8;                                                     #Discharge  through  A\n",
      "\n",
      " #Calculations\n",
      "def  Reaction(Vin , Vout):\n",
      "    R  =  m*(Vin  -Vout)  ;\n",
      "    return R\n",
      "Rx  =  Reaction(V1,V2*math.cos(math.radians(x)));\n",
      "Ry  =  -Reaction(0,V2*math.sin(math.radians(x)));\n",
      "print \"Reaction in X-direction (N)                              :\",Rx\n",
      "print \"Reaction in Y-direction (N)                              :\",round(Ry,2)\n",
      "print \"Net Reaction            (N)                              :\",round((Rx**2 +Ry**2)**0.5,2)\n",
      "print \"Inclination of Resultant Force with x-direction (Degrees):\",round(180/math.pi*math.atan(Ry/Rx),2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reaction in X-direction (N)                              : 14.0\n",
        "Reaction in Y-direction (N)                              : 17.32\n",
        "Net Reaction            (N)                              : 22.27\n",
        "Inclination of Resultant Force with x-direction (Degrees): 51.05\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4, Page 125"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      "\n",
      " #Initializing  the  variables  \n",
      "v1  =  36  ;                                                              #Exit  velocity\n",
      "u  =  15;                                                                  #Velocity  of  vane\\\n",
      "x  =  30;                                                                  #  Angle  between  vanes  and  flow\n",
      "rho  =  1000;                                                          #  Density  of  water\n",
      "d  =  .1;                                                                  #  Diameter  of  jet\n",
      "\n",
      " #Calculations\n",
      "alp  =  (180/math.pi)*math.atan((v1*math.sin(math.radians(x))/(v1*math.cos(math.radians(x))-u)));\n",
      "v2  =  0.85*v1*math.sin(math.radians(x));\n",
      "bta  =    (180/math.pi)*math.acos((u*math.sin(math.radians(alp))/v2));\n",
      "m  =  (rho*math.pi*v1*d**2)/4;\n",
      "Vin  =  v1*math.cos(math.radians(x));\n",
      "Vout  =  v2*math.cos(math.radians(90));\n",
      "Rx  =  m*(Vin-Vout);\n",
      "\n",
      "\n",
      "print \"Inlet Angle            (Degrees) :\", round(alp,2)\n",
      "print \"Outlet Angle           (Degrees) :\", round(bta,2)\n",
      "print \"Force exerted by vanes (N)       :\", round(Rx) \n",
      "    "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Inlet Angle            (Degrees) : 48.05\n",
        "Outlet Angle           (Degrees) : 43.18\n",
        "Force exerted by vanes (N)       : 8815.0\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5, Page 127"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      "\n",
      " #Initializing  the  variables  \n",
      "rho  =  850  ;                                                          #  Density  of  liquid\n",
      "a  =  0.02                                                                #Acceleration  of  fluid\n",
      "x  =  45  ;\n",
      "d1  =  .5  ;\n",
      "d2  =  .25;\n",
      "p1  =  40*10**3;\n",
      "p2  =  23*10**3;\n",
      "Q  =  .45;\n",
      "   \n",
      " #Calculations\n",
      "A1  =  (math.pi*d1**2)/4;\n",
      "A2  =  (math.pi*d2**2)/4;\n",
      "v1  =  Q/A1;\n",
      "v2  =  Q/A2;\n",
      "\n",
      "Rx  =  p1*A1  -  p2*A2*math.cos(math.radians(x))  -  rho*Q*(v2*math.cos(math.radians(x))-v1);\n",
      "Ry  =  p2*A2*math.sin(math.radians(x))  +  rho*Q*v2*math.sin(math.radians(x));\n",
      "\n",
      "print \"Resultant force on the bend                     (kN)     :\",round((Rx**2 +Ry**2)**0.5/1000,3)\n",
      "print \"Inclination of Resultant Force with x-direction (Degrees):\",round(math.atan(Ry/Rx)*180/math.pi)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resultant force on the bend                     (kN)     : 6.362\n",
        "Inclination of Resultant Force with x-direction (Degrees): 31.0\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6, Page 129"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      "\n",
      " #Initializing  the  variables  \n",
      "v  =  4.9;                                                                #Velocity  of  Jet\n",
      "rho  =  1000;                                                          #  Density  of  water\n",
      "d  =  0.05;\n",
      "u  =  1.2                                                                  #  Velocity  of  tank\n",
      " #Calculations\n",
      "Vout  =  v;\n",
      "Vin  =  0;\n",
      "m  =  rho*math.pi*d**2*v/4;\n",
      "R  =  m*(Vout-Vin);\n",
      "print \"Reaction of jet on tank (N) :\",round(R,2)\n",
      "print \"Work done per second    (W) :\",round(R*u,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reaction of jet on tank (N) : 47.14\n",
        "Work done per second    (W) : 56.57\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7, Page 130"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "from scipy import integrate\n",
      " \n",
      " \n",
      "\n",
      " #Initializing  the  variables  \n",
      "Vj  =  5*10**6;                               # Velocity  of  Jet\n",
      "Mr  =  150000;                                # Mass  of  Rocket\n",
      "Mf0  =  300000;                               # Mass  of  initial  fuel\n",
      "Vr  =  3000;                                  # Velocity  of  jet  relative  to  rocket\n",
      "g  =  9.81;                                   # Acceleration  due  to  gravity\n",
      "\n",
      " #Calculations\n",
      "m  =  Vj/Vr;                                  #Rate  of  fuel  consumption\n",
      "T  =  Mf0/m;                                  #  Burning  time\n",
      "\n",
      "def f(t,m,Vr,Mr,Mf0,g):\n",
      "    return m*Vr  /(Mr  +  Mf0  -  m*t)  -  g;\n",
      " \n",
      "args = (5000/3,3000,150000,300000,9.81)\n",
      "Vt = integrate.quad(f, 0.0, 180, args)\n",
      "\n",
      "def h(t,Vr,g):\n",
      "    return -g*t - Vr*math.log(1 - t/269.95);\n",
      " \n",
      "args = (3000,9.81)\n",
      "Z1 = integrate.quad(h, 0.0, 180, args)\n",
      "Z2 =  Vt[0]**2/(2*g);\n",
      "\n",
      "print \"(a)Burning time (s)                             :\",T\n",
      "print \"(b)Speed of rocket when all fuel is burned (m/s):\",round(Vt[0],2)\n",
      "print \"(c)Maximum height reached (km)                  :\",round((Z2+Z1[0])/1000,1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Burning time (s)                             : 180.0\n",
        "(b)Speed of rocket when all fuel is burned (m/s): 1530.04\n",
        "(c)Maximum height reached (km)                  : 203.8\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8, Page 134"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      " #Initializing  the  variables  \n",
      "V  =  200;                                                                #Velocity  in  still  air\n",
      "Vr  =  700;                                                              #velocity  of  gas  relative  to  engine\n",
      "mf  =  1.1;                                                              #  Fuel  Consumption\n",
      "r  =  1/40  ;        \n",
      "P1  =0;\n",
      "P2  =  0;\n",
      "\n",
      " #Calculations\n",
      "m1  =    mf/r;\n",
      "T  =  m1*((1+r)*Vr  -V);\n",
      "print \"(a)Thrust               (kN) :\",T/1000\n",
      "\n",
      "W  =  T*V;\n",
      "print \"(b)Work done per second (kW) :\",W/1000\n",
      "\n",
      "Loss  =  0.5*m1*(1+r)*(Vr-V)**2;\n",
      "print \"(c)Efficiency           (%)  :\",round(W/(W+Loss)*100,1) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Thrust               (kN) : 22.77\n",
        "(b)Work done per second (kW) : 4554.0\n",
        "(c)Efficiency           (%)  : 44.7\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10, Page 140"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables  \n",
      "rho  =  1000;                                                          #  Density  of  water\n",
      "Q  =  10;                                                                  #Acceleration  of  fluid\n",
      "r2  =  1.6;\n",
      "r1  =  1.2;\n",
      "V1  =  2.3;\n",
      "V2  =  0.2;\n",
      "rot  =  240;  \n",
      "\n",
      " #Calculations\n",
      "Tf  =  rho*Q*(V2*r2  -  V1*r1);\n",
      "T  =  -Tf;\n",
      "n  =  rot  /  60;\n",
      "P  =  2*round(math.pi,3)*n*T;\n",
      "\n",
      "print \"Torque exerted by fluid  (N.m):\",T\n",
      "print \"Theoretical power output (kW) :\",round(P/1000,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Torque exerted by fluid  (N.m): 24400.0\n",
        "Theoretical power output (kW) : 613.32\n"
       ]
      }
     ],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}