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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
|
{
"metadata": {
"name": "",
"signature": "sha256:0059190c3ee26fe93a1d293531a49cd3a6e92d5339c0638feafb8d9d1d250c2e"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 1 : Pipe Flow of Liquids"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"\n",
"example 1.1 page no : 1"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math \n",
"\n",
"# Initialization of Variable\n",
"mu = 6.3/100; #viscosity\n",
"rho = 1170.; #density\n",
"d = .3; #diameter of pipe\n",
"b = 0.142; #conversion factor\n",
"pi=3.14;\n",
"\n",
"#calculation\n",
"Q = 150000.*b/24./3600 #flow rate\n",
"u = Q/pi/d**2.*4 #flow speed\n",
"Re = rho*u*d/mu\n",
"if Re>4000:\n",
" print \"the system is in turbulent motion as reynolds no is greater than 4000: %.3f\"%Re\n",
"elif Re<2100 :\n",
" print \"the system is in laminar motion\" ,Re\n",
"else:\n",
" print \"the system is in transition motion\",Re\n",
"\n",
"mu = 5.29/1000;\n",
"d = 0.06;\n",
"G = 0.32; #mass flow rate\n",
"Re = 4*G/pi/d/mu;\n",
"\n",
"if Re>4000 :\n",
" print \"the system is in turbulent motion as reynolds no is greater than 4000: \",Re\n",
"elif Re<2100 :\n",
" print \"the system is in laminar motion as Re is less than 2100 : %.3f\" %Re\n",
"else:\n",
" print \"the system is in transition motion\",Re\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the system is in turbulent motion as reynolds no is greater than 4000: 19441.074\n",
"the system is in laminar motion as Re is less than 2100 : 1284.320\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"\n",
"example 1.2 page no : 2"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math \n",
"\n",
"\n",
"# Initialization of Variable\n",
"G=21.2; #mass flow rate\n",
"rho=1120; #density\n",
"d=0.075; #diameter\n",
"l=50.;\n",
"g=9.81;\n",
"pi=3.14;\n",
"delz=24./100; #head difference\n",
"\n",
"#calculation\n",
"delP=delz*rho*g; #differece of pressure\n",
"u=4*G/pi/d**2/rho;\n",
"phi=delP/rho*d/l/u**2./4*50;\n",
"print \"The Stanton-Pannel friction factor per unit of length: %f\"%phi\n",
"R=phi*rho*u**2;\n",
"print \"shear stress exerted by liquid on the pipe wall in (N/m**2) : %.3f\"% R\n",
"F=pi*d*l*R;\n",
"print \"Total shear force exerted on the pipe in (N): %.3f\"%F\n",
"Re=(.0396/phi)**4;#reynold's no.\n",
"mu=rho*u*d/Re;\n",
"print \"viscosity of liquid in (kg/m/s):%f\" %mu\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Stanton-Pannel friction factor per unit of length: 0.002402\n",
"shear stress exerted by liquid on the pipe wall in (N/m**2) : 49.442\n",
"Total shear force exerted on the pipe in (N): 582.184\n",
"viscosity of liquid in (kg/m/s):0.004877\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.3 page no : 4"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"# Initialization of Variable\n",
"pi=3.14;\n",
"g=9.81;\n",
"d=0.00125;\n",
"Re=2100;\n",
"l=0.035;\n",
"rhoc=779. #density of cyclohexane\n",
"rhow=999. #density of water\n",
"muc=1.02/1000; #viscosity of cyclo hexane\n",
"\n",
"#calculation\n",
"u=Re*muc/rhoc/d; #speed\n",
"Q=pi*d**2*u/4; #volumetric flow rate\n",
"delP=32*muc*u*l/d**2;#pressure difference\n",
"delz=delP/(rhow-rhoc)/g;\n",
"print \"the difference between the rise levels of manometer in (cm): %.4f\"%(delz*100 )\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the difference between the rise levels of manometer in (cm): 74.5210\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"\n",
"example 1.4 page no : 6"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math \n",
"\n",
"# Initialization of Variable\n",
"d=0.05;\n",
"l=12.;\n",
"per=100.-2;\n",
"pi=3.1428\n",
"\n",
"#calculation\n",
"s=math.sqrt(per/100/4*d**2);#radius of core of pure material\n",
"V=pi*d**2./4.*l/(2.*(1-(2.*s)**2/d**2));\n",
"print \"The volume of pure material so that 2%% technical material appears at the end in (m**3): %.3f\"%V\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The volume of pure material so that 2% technical material appears at the end in (m**3): 0.589\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.5 page no : 7"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"\n",
"# Initialization of Variable\n",
"\n",
"a=1./2*(1-1/math.sqrt(2.));\n",
"print \"The percent value of d for which where pitot tube is kept show average velocity \\\n",
"in streamline flow in (%%) : %.4f\"%(a*100)\n",
"\n",
"a=(49./60)**7/2.\n",
"print \"The percent value of d for which where pitot tube is kept show average velocity in \\\n",
"turbulent flow in (%%) : %.4f\"%(a*100)\n",
"\n",
"#on equating coefficient of r\n",
"y=a*2; #y=a/100*2*r\n",
"s=1-y; #s=r-y\n",
"\n",
"#on equating coeff. of 1/4/mu*del(P)/del(l)\n",
"E=(1-s**2-.5)/.5;\n",
"print \"The error shown by pitot tube at new position if value of streamlined flow flow was\\\n",
"to be obtained in (%%) : %.4f\"%E\n",
"print \"The - sign indicates that it will print lay reduced velocity than what actually is\"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The percent value of d for which where pitot tube is kept show average velocity in streamline flow in (%) : 14.6447\n",
"The percent value of d for which where pitot tube is kept show average velocity in turbulent flow in (%) : 12.1139\n",
"The error shown by pitot tube at new position if value of streamlined flow flow wasto be obtained in (%) : -0.1483\n",
"The - sign indicates that it will print lay reduced velocity than what actually is\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"\n",
"example 1.6 page no : 9"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"# Initialization of Variable\n",
"rhon = 1068. #density of nitric acid\n",
"mun = 1.06/1000. #viscosity of nitric acid\n",
"g = 9.81\n",
"l = 278.\n",
"d = 0.032\n",
"alpha = 1.\n",
"h2 = 57.4 #height to be raised\n",
"h1 = 5. #height from which to be raised\n",
"e = .0035/1000. #roughness\n",
"G = 2.35 #mass flow rate\n",
"pi = 3.14\n",
"#calculations\n",
"#part 1\n",
"u = 4.*G/rhon/pi/d**2\n",
"Re = rhon*d*u/mun\n",
"rr = e/d #relative roughness\n",
"\n",
"#Reading's from Moody's Chart\n",
"phi = .00225 #friction coeff.\n",
"W = u**2/2.+g*(h2-h1)+4*phi*l*u**2/d #The work done/kg of fluid flow in J/kg\n",
"V = abs(W)*G\n",
"print \"The Power required to pump acid in kW : %.4f\"%(abs(V)/1000)\n",
"\n",
"#part 2\n",
"P2 = -u**2*rhon/2.+g*(h1)*rhon+abs(W+2)*rhon\n",
"print \"The gauge pressure at pump outlet when piping is new in (kPa) : %.4f\"%(P2/1000)\n",
"\n",
"#part 3\n",
"e = .05/1000\n",
"Re = rhon*d*u/mun\n",
"rr = e/d\n",
"\n",
"#Reading's from Moody's Chart\n",
"phi = 0.0029\n",
"W = u**2/2+g*(h2-h1)+4*phi*l*u**2/d\n",
"Vnew = abs(W)*G\n",
"Pi = (Vnew-V)/V*100.\n",
"print \"The increase in power required to transfer in old pipe in (%%): %.4f\"%Pi\n",
"\n",
"#part 4\n",
"P2 = -u**2*rhon/2+g*(h1)*rhon+abs(W+2)*rhon\n",
"print \"The gauge pressure at pump outlet when piping is old in (kPa) :%.4f\"%(P2/1000)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Power required to pump acid in kW : 2.5936\n",
"The gauge pressure at pump outlet when piping is new in (kPa) : 1229.2152\n",
"The increase in power required to transfer in old pipe in (%): 15.3353\n",
"The gauge pressure at pump outlet when piping is old in (kPa) :1409.9715\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.7 page no : 12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math \n",
"\n",
"# Initialization of Variable\n",
"rho=990.;\n",
"mu=5.88/10000;\n",
"g=9.81;\n",
"pi=3.14;\n",
"temp=46.+273\n",
"e=1.8/10000 #absolute roughness\n",
"Q=4800./1000./3600;\n",
"l=155.;\n",
"h=10.5;\n",
"d=0.038;\n",
"delh=1.54 #head loss at heat exchanger\n",
"effi=0.6 #efficiency\n",
"\n",
"#calculations\n",
"\n",
"u=Q*4./pi/d**2;\n",
"Re=rho*d*u/mu;\n",
"rr=e/d #relative roughness\n",
"\n",
"#from moody's diagram\n",
"phi=0.0038 #friction factor\n",
"alpha=1. #constant\n",
"leff=l+h+200*d+90*d;\n",
"Phe=g*delh #pressure head lost at heat exchanger\n",
"W=u**2/2/alpha+Phe+g*h+4*phi*leff*u**2/d; #work done by pump\n",
"G=Q*rho; #mass flow rate\n",
"P=W*G; #power required by pump\n",
"Pd=P/effi #power required to drive pump\n",
"print \"power required to drive pump in (kW) : %.4f\"%(Pd/1000)\n",
"\n",
"P2=(-u**2/2/alpha+W)*rho;\n",
"print \"The gauge pressure in (kPa): %.4f\"%(P2/1000)\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"power required to drive pump in (kW) : 0.4763\n",
"The gauge pressure in (kPa): 213.6461\n"
]
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.8 page no : 15"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math \n",
"\n",
"# Initialization of Variable\n",
"rho=908.;\n",
"mu=3.9/100;\n",
"g=9.81;\n",
"pi=3.14;\n",
"d=0.105;\n",
"l=87.;\n",
"h=16.8;\n",
"e=0.046/1000; #absolute roughness\n",
"\n",
"#calculations\n",
"\n",
"#part1\n",
"P=-rho*g*h; #change in pressure\n",
"a=-P*rho*d**3/4/l/mu**2 #a=phi*Re**2\n",
"\n",
"#using graph given in book(appendix)\n",
"Re=8000.\n",
"u=mu*Re/rho/d\n",
"Q=u*pi*d**2/4.\n",
"print \"Volumetric flow rate initial (m**3/s): %.4f\"%Q\n",
"\n",
"#part 2\n",
"W=320.;\n",
"Pd=W*rho; #pressure drop by pump\n",
"P=P-Pd;\n",
"a=-P*rho*d**3./4./l/mu**2 #a=phi*Re**2\n",
"\n",
"#using graph given in book(appendix)\n",
"Re=15000.;\n",
"u=mu*Re/rho/d;\n",
"Q=u*pi*d**2./4;\n",
"print \"Volumetric flow rate final(part 2) (m**3/s) : %.4f\"%Q\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Volumetric flow rate initial (m**3/s): 0.0283\n",
"Volumetric flow rate final(part 2) (m**3/s) : 0.0531\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.9 pageno : 17"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"from numpy import linspace\n",
"# Initialization of Variable\n",
"rho=1000.;\n",
"mu=1.25/1000;\n",
"g=9.81;\n",
"pi=3.14\n",
"d = 0.105\n",
"d1=0.28; #diameter of tank\n",
"d2=0.0042; #diameter of pipe\n",
"l=0.52; #length of pipe\n",
"rr=1.2/1000./d; #relative roughness\n",
"phid=0.00475;\n",
"print \"It is derived from tyhe graph giben in appedix and can be seen \\\n",
"is arying b/w 0.0047 & 0.0048 dependent on D which varies from 0.25 to 0.45 : %f\"%phid\n",
"\n",
"#calculations\n",
"def intregrate():\n",
" s=0\n",
" for i in range(0,1000):\n",
" D=linspace(0.25,0.45,1000);\n",
" y=math.sqrt(((pi*d1**2./pi/d2**2)**2-1)/2/9.81+(4*phid*l*(pi*d1**2/pi \\\n",
" /d2**2)**2)/d2/9.81)*((0.52+D[i])**-0.5)*2/10000;\n",
" s=s+y;\n",
" a=s;\n",
" return a\n",
"\n",
"b=intregrate();\n",
"print \"Time required to water level to fall in the tank in (s): %.4f\"%b\n",
"\n",
" \n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"It is derived from tyhe graph giben in appedix and can be seen is arying b/w 0.0047 & 0.0048 dependent on D which varies from 0.25 to 0.45 : 0.004750\n",
"Time required to water level to fall in the tank in (s): 514.7299\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.10 pageno : 21"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"# Initialization of Variable\n",
"rho=1000.;\n",
"mu=1.42/1000;\n",
"g=9.81;\n",
"pi=3.14;\n",
"l=485.;\n",
"h=4.5\n",
"e=8.2/100000;\n",
"Q=1500.*4.545/1000/3600;\n",
"\n",
"print \"assume d as 6cm\"\n",
"d=0.06;\n",
"u=4*Q/pi/d**2;\n",
"Re=rho*d*u/mu;\n",
"rr=e/d; #relative roughness\n",
"\n",
"#using moody's chart\n",
"phi=0.0033 #friction coeff.\n",
"d=(64*phi*l*Q**2/pi**2/g/h)**0.2;\n",
"print \"The calculated d after (1st iteration which is close to what we\\\n",
" assume so we do not do any more iteration) in(cm) %d \"%(d*100)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"assume d as 6cm\n",
"The calculated d after (1st iteration which is close to what we assume so we do not do any more iteration) in(cm) 6 \n"
]
}
],
"prompt_number": 17
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|