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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 6 : Fluid friction in steady on dimentional flow"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.1 page no : 180\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the drop in pressure per unit length in a pipe\n",
"import math\n",
"\n",
"# Variables \n",
"q=50.0 #gal/min flow rate\n",
"d=3.068 #in inner diameter\n",
"\n",
"# Calculation \n",
"a=(math.pi)*(3.068/12.0)**2/4.0 #ft^2\n",
"#1 ft^3 = 7.48 gal\n",
"#1 min = 60 sec\n",
"v_avg=q/a/60.0/7.48 #ft/s\n",
"mew=50.0 #cP\n",
"#1 cP = 0.000672 lbm/ft/s\n",
"rho=62.3 #lbm/ft^3\n",
"\n",
"# Result\n",
"R=(d/12)*v_avg*rho/(mew*0.000672) #dimentionless reynold's no.\n",
"if (R<2000):\n",
" print \"Laminar flow\"\n",
"else:\n",
" print \"Turbulent flow\"\n",
"\n",
"dx=3000.0 #ft length of pipe\n",
"#1 gal = 231 in^3\n",
"#1 cP.ft^3 = 0.0000209 lbf.s\n",
"dp=(q/60)*(128/math.pi)*(mew/d**4)*dx*231*0.0000209/12 #lbf/in^2 or psi\n",
"#let D represent d/dx\n",
"Dp=(dp/dx)*100 #psi/ft\n",
"print \"The pressure gradient in the pipe is %f psi/100ft\"%Dp"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Laminar flow\n",
"The pressure gradient in the pipe is 0.770911 psi/100ft\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.2 page no : 182\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate viscosity of fluid using a viscometer\n",
"import math\n",
"\n",
"# Variables \n",
"rho=1050. #Kg/m^3\n",
"g=9.81 #m/s^2\n",
"dz=0.12 #m change in height\n",
"d=0.001 #m inner diameter of capillary of viscometer\n",
"q=10**(-8) #m^3/s\n",
"dx=0.1 #m length of capillary\n",
"\n",
"# Calculation \n",
"mew=(rho*g*dz*(math.pi)*d**4)*1000/128./(q*dx) #cP\n",
"\n",
"# Result\n",
"print \"The viscosity of the fluid is %f cP\"%mew"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The viscosity of the fluid is 30.337477 cP\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.3 page no : 187\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the fanning friction factor\n",
"\n",
"# Variables \n",
"R=10**5. #dimentionless reynold's no.\n",
"ratio_ED=0.0002 #dimentionless\n",
"\n",
"# Calculation \n",
"f=0.001375*(1+(20000*ratio_ED+10**6/R)**(1./3)) #dimentionless\n",
"\n",
"# Result\n",
"print \"The fanning friction factor is %f\"%f"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The fanning friction factor is 0.004689\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.4 page no : 188\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the gauge pressure in the tank\n",
"import math\n",
"\n",
"# Variables \n",
"q=300. #gal/min flow rate\n",
"d=3.068 #in inner diameter\n",
"\n",
"# Calculation \n",
"a=(math.pi)*(3.068/12.0)**2/4.0 #ft^2\n",
"\n",
"#1 ft^3 = 7.48 gal\n",
"#1 min = 60 sec\n",
"v_avg=13. #q/a/60.0/7.48#ft/s\n",
"f=0.0091 #dimentionless fanning friction factor\n",
"dx=3000. #ft\n",
"rho=62.3 #lbm/ft^3\n",
"dp=4*f*(dx/(d/12.0))*rho*(v_avg**2/2.0)/32.2/144.0 #lbf/in^2 or psi\n",
"\n",
"# Result\n",
"print \"The gauge pressure in the tank is %d psi\"%dp"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The gauge pressure in the tank is 484 psi\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.5 page no : 190\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate volumetric flow rate of gasoline through a pipe\n",
"import math\n",
"\n",
"# Variables \n",
"d=0.1 #m internal diameter of pipe\n",
"A=math.pi*d**2/4.0 #m^2\n",
"dx=100.0 #m length of pipe\n",
"f=0.005 #dimentionless fanning friction factor\n",
"dz=10.0 #m difference in water level\n",
"g=9.81 #m/s^2\n",
"\n",
"# Calculation \n",
"v=((2*g*dz/4/f)*(0.1/100))**0.5 #4.0/f)*d/dx)**0.5#m/s\n",
"\n",
"# Result\n",
"print \"The velocity of gasoline through pipe is %f m/s\"%v\n",
"q=A*v#m^3/s\n",
"print \"The volumteric flow arte od gasoline through the pipe is %f m^3/s\"%q"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The velocity of gasoline through pipe is 3.132092 m/s\n",
"The volumteric flow arte od gasoline through the pipe is 0.024599 m^3/s\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.6 page no : 192\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate pressure difference across the duct\n",
"import math\n",
"\n",
"# Variables \n",
"p=14.75 #lbf/in^2\n",
"M=29. #lbm/lbmol\n",
"R=10.73 #lbf.ft^3/(in^2.lbmol.R)\n",
"T=500. #R Rankine temperature scale\n",
"rho=p*M/(R*T) #lbm/ft^3\n",
"q=500. #ft^3/min\n",
"d=1. #ft\n",
"A=(math.pi)*d**2/4 #ft^2\n",
"v=(q/60.0)/A #ft/s\n",
"mew=0.017 #cP\n",
"\n",
"#1cP = 0.000672 lbm/ft/s\n",
"R=d*v*rho/(mew*0.000672) #dimentionless reynold's no.\n",
"f=0.00465 #fanning friction factor\n",
"dx=800. #ft lenght of duct\n",
"#1 ft = 12 in\n",
"#1 lbf.s^2 = 32.2 lbm.ft\n",
"\n",
"# Calculation \n",
"dP=rho*(4*f*(dx/d)*(v**2/2))/32.2/144. #lbf/in^2\n",
"\n",
"# Result\n",
"print \"The pressure drop across the duct is %f lbf/in^2\"%dP"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The pressure drop across the duct is 0.014402 lbf/in^2\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.8 page no : 197\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the pump power required\n",
"\n",
"# Variables \n",
"q=200. #gal/min\n",
"rho=62.3 #lbm/ft^3\n",
"#1 ft^3 = 7.48 gal\n",
"\n",
"# Calculation \n",
"m=(q/60)*rho/7.48 #lbm/s\n",
"dx=2000. #ft\n",
"dp=3.87 #psi/100ft\n",
"F=(dp/100)*dx/rho*32.2*144 #ft\n",
"#1 hp = 550 lbf.ft/s\n",
"Po=F*m/550. #hp\n",
"\n",
"# Result\n",
"print \"The pump power required is %f hp\"%Po"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The pump power required is 290.786193 hp\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.9 page no : 198\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the drop in pressure per unit length in a pipe\n",
"\n",
"# Variables \n",
"dp=0.1 #psi\n",
"dx=800. #ft\n",
"\n",
"#let D represent d/dx\n",
"#1 psi = 6895 Pa\n",
"#1 m = 3.28 ft\n",
"\n",
"# Calculation \n",
"Dp=(dp/dx)*6895*3.28 #Pa/m\n",
"\n",
"# Result\n",
"print \"The drop in pressure per unit length in the pipe is %f Pa/m\"%Dp\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The drop in pressure per unit length in the pipe is 2.826950 Pa/m\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.10 page no : 201\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the pressure difference created due to expansion and contraction\n",
"\n",
"# Variables \n",
"rho=62.3 #lbm/ft^3\n",
"K=1.5 #dimentionless\n",
"v=13. #ft/s\n",
"\n",
"#1 ft = 12 in\n",
"#1 lbf.s^2 = 32.2 lbm.ft\n",
"\n",
"# Calculation \n",
"dp=rho*K*(v**2/2)/32.2/144 #lbf/in^2\n",
"\n",
"# Result\n",
"print \"The pressure drop due to expansion and contraction is %f lbf/in^2\"%dp"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The pressure drop due to expansion and contraction is 1.703012 lbf/in^2\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.11 page no : 203\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the pressure drop in the pipe due to fittings\n",
"\n",
"# Variables \n",
"dx=3000.0 #ft actual length of pipe\n",
"dx1=281. #ft equivalent length of fittings\n",
"p=484. #psi\n",
"\n",
"# Calculation \n",
"dx_total=dx+dx1 #ft\n",
"dp_total=p*(dx_total/dx) #psi\n",
"dp_vnf=dp_total-p #psi pressure drop fue to valves and fittings\n",
"\n",
"# Result\n",
"print \"The pressure drop due to valves and fittings is %d psi\"%dp_vnf"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The pressure drop due to valves and fittings is 45 psi\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.12 page no : 203\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate pressure drop due to valves and fittings\n",
"\n",
"# Variables \n",
"K=27.56 #deimentionless\n",
"rho=62.3 #lbm/ft^3\n",
"v=13. #ft/s\n",
"\n",
"# Calculation \n",
"#1 ft = 12 in\n",
"#1 lbf.s^2 = 32.2 lbm.ft\n",
"dp=rho*K*(v**2/2)/32.2/144. #psi\n",
"\n",
"# Result\n",
"print \"THe pressure drop due to valves and fittings is %d psi\"%dp"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"THe pressure drop due to valves and fittings is 31 psi\n"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.13 page no : 207\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the gasoline leakage rate through a seal\n",
"import math\n",
"\n",
"# Variables \n",
"p=100.0 #lbf/in^2\n",
"l=1. #in length od seal in direction of leak\n",
"mew=0.6 #cP\n",
"d=0.25 #in diameter of valve stem\n",
"t=0.0001 #in thickness of valva stem\n",
"\n",
"# Calculation \n",
"#1 cP = 0.0000209 lbf.s/ft^2\n",
"#1 ft = 12 in\n",
"q=(p/l)*(1/12.0/mew)*(math.pi)*d*t**3/0.0000209*144*3600. #in^3/hr\n",
"\n",
"# Result\n",
"print \"The volumetric leakage rate of gasoline is %f in^3/hr\"%q\n",
"rho=0.026 #lbm/in^3\n",
"m=q*rho #lbm/hr\n",
"print \"The mass leakage rate of gasoline is %f lbm/hr\"%m"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The volumetric leakage rate of gasoline is 0.270568 in^3/hr\n",
"The mass leakage rate of gasoline is 0.007035 lbm/hr\n"
]
}
],
"prompt_number": 16
}
],
"metadata": {}
}
]
}
|