summaryrefslogtreecommitdiff
path: root/Transport_Phenomena:_A_Unified_Approach/ch11.ipynb
blob: 9c17f43d4bb571b5ed07811c3ef33c0de191d3bc (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
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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11 : Heat and mass transfer in duct flow"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.1 - Page No :497\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "# Variables\n",
      "# given\n",
      "K_drywall = 0.28;  \t\t\t #[Btu/ft*degF] - thermal conductivity of dry wall\n",
      "K_fibreglass = 0.024;  \t\t #[Btu/ft*degF] - thermal conductivity of fibre glass\n",
      "K_concrete = 0.5;  \t\t\t #[Btu/ft*degF] - thermal conductivity of concrete\n",
      "T4 = 0.;              \t\t #[degF]\n",
      "T1 = 65.;  \t\t\t         #[degF]\n",
      "deltaT = T4-T1;  \t    \t #[degF]\n",
      "a = 1.;               \t\t #[ft**2] - assuming area of 1 ft**2\n",
      "deltax1 = 0.5/12;  \t\t\t #[ft]\n",
      "deltax2 = 3.625/12;  \t\t #[ft]\n",
      "deltax3 = 6./12;  \t\t\t #[ft]\n",
      "\n",
      "# Calculations\n",
      "R1 = deltax1/(K_drywall*a);      \t\t\t #[h*degF/Btu]\n",
      "R2 = deltax2/(K_fibreglass*a);  \t\t\t #[h*degF/Btu]\n",
      "R3 = deltax3/(K_concrete*a);  \t    \t\t #[h*degF/Btu]\n",
      "qx = deltaT/(R1+R2+R3);\n",
      "q12 = -qx;\n",
      "q23 = -qx;\n",
      "q34 = -qx;\n",
      "deltaT1 = (-q12)*deltax1*(1./(K_drywall*a));\n",
      "T2 = T1+deltaT1;\n",
      "deltaT2 = (-q23)*deltax2*(1./(K_fibreglass*a));\n",
      "T3 = T2+deltaT2;\n",
      "deltaT3 = (-q34)*deltax3*(1./(K_concrete*a));\n",
      "T4 = T3+deltaT3;\n",
      "\n",
      "# Results\n",
      "print \" T1  =  %.0f F \\\n",
      "\\n T2  =  %.1f F \\\n",
      "\\n delta T2 = %.2f deg F \\\n",
      "\\n T3  = %.2f F \\\n",
      "\\n delta T3 = %.2f deg F \\\n",
      "\\n T4  =  %.0f F\"%(T1,T2,deltaT2,T3,deltaT3,T4);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " T1  =  65 F \n",
        " T2  =  64.3 F \n",
        " delta T2 = -59.56 deg F \n",
        " T3  = 4.73 F \n",
        " delta T3 = -4.73 deg F \n",
        " T4  =  0 F\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.2 - Page No :501\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "r1 = (2.067/2.)/(12);  \t\t #[ft]\n",
      "r2 = r1+0.154/12;  \t\t\t #[ft]\n",
      "r3 = r2+3/12.;  \t\t\t #[ft]\n",
      "L = 1.;  \t\t\t #[ft]\n",
      "Ka = 26.;  \t\t\t #[Btu/h*ft*degF]\n",
      "Kb = 0.04;  \t\t #[Btu/h*ft*degF]\n",
      "T1 = 50.;  \t\t\t #[degF]\n",
      "\n",
      "# Calculations\n",
      "Ra = (math.log(r2/r1))/(2*math.pi*L*Ka);\n",
      "Rb = (math.log(r3/r2))/(2*math.pi*L*Kb);\n",
      "R = Ra+Rb;\n",
      "deltaT = -18;  \t\t\t #[degF] - driving force\n",
      "Qr = -(deltaT/(R));\n",
      "deltaT1 = (-Qr)*(Ra);\n",
      "T2 = T1+deltaT1;\n",
      "\n",
      "# Results\n",
      "print \" Qr = %.3f\"%Qr;\n",
      "print \" The interface temperature is  T2  =  %.3f degF\"%(T2);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Qr = 3.589\n",
        " The interface temperature is  T2  =  49.997 degF\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.3 - Page No :502\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Ra = 8.502*10**-4;  \t\t\t #[h*degF*Btu**-1]\n",
      "Rb = 5.014;  \t\t        \t #[h*degF*Btu**-1]\n",
      "r1 = (2.067/2)/(12.);  \t\t\t #[ft]\n",
      "r2 = r1+0.154/12.;  \t\t\t #[ft]\n",
      "r3 = r2+3/12.;  \t\t\t     #[ft]\n",
      "d1 = 2.*r1;\n",
      "d0 = 2.*r3;\n",
      "h0 = 25.;  \t    \t\t #[Btu/h*ft**2*degF]\n",
      "h1 = 840.;  \t\t\t #[Btu/h*ft**2*degF]\n",
      "L = 1.;       \t\t\t #[ft] - considering 1 feet length\n",
      "\n",
      "# Calculations\n",
      "R0 = 1./(h0*math.pi*d0*L);\n",
      "R1 = 1./(h1*math.pi*d1*L);\n",
      "R = R0+R1+Ra+Rb;\n",
      "deltaT = -400;  \t\t\t #[degF]\n",
      "Qr = -(deltaT)/R;\n",
      "# the heat loss calculated above is the heat loss per foot.therefore for 500 ft\n",
      "L = 500.;\n",
      "Qr = Qr*L;\n",
      "\n",
      "# Results\n",
      "print \" the heat loss for a 500 feet pipe is  qr  =  %.2e Btu/h\"%(Qr);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " the heat loss for a 500 feet pipe is  qr  =  3.97e+04 Btu/h\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.5 - Page No :521\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Nre = 50000.;\n",
      "d = 0.04;  \t\t\t #[m] - diameter of pipe\n",
      "\n",
      "# physical properties of water\n",
      "T1 = 293.15;  \t\t\t #[K]\n",
      "T2 = 303.15;  \t\t\t #[K]\n",
      "T3 = 313.15;  \t\t\t #[K]\n",
      "p1 = 999.;  \t\t\t #[kg/m**3] - density of water at temperature T1\n",
      "p2 = 996.0;  \t\t\t #[kg/m**3] - density of water at temperature T2\n",
      "p3 = 992.1;  \t\t\t #[kg/m**3] - density of water at temperature T3\n",
      "mu1 = 1.001;  \t\t\t #[cP] - viscosity of water at temperature T1\n",
      "mu2 = 0.800;  \t\t\t #[cP] - viscosity of water at temperature T2\n",
      "mu3 = 0.654;  \t\t\t #[cP] - viscosity of water at temperature T3\n",
      "k1 = 0.63;  \t\t\t #[W/m*K] - thermal conductivity of water at temperature T1\n",
      "k2 = 0.618;  \t\t\t #[W/m*K] - thermal conductivity of water at temperature T2\n",
      "k3 = 0.632;  \t\t\t #[W/m*K] - thermal conductivity of water at temperature T3\n",
      "cp1 = 4182.;  \t\t\t #[J/kg*K] - heat capacity of water at temperature T1\n",
      "cp2 = 4178.;  \t\t\t #[J/kg*K] - heat capacity of water at temperature T2\n",
      "cp3 = 4179.;  \t\t\t #[J/kg*K] - heat capacity of water at temperature T3\n",
      "Npr1 = 6.94;  \t\t\t # prandtl no. at temperature T1\n",
      "Npr2 = 5.41;  \t\t\t # prandtl no. at temperature T2\n",
      "Npr3 = 4.32;  \t\t\t # prandtl no. at temperature T3\n",
      "\n",
      "\n",
      "# Calculations\n",
      "# (a)  Dittus -Boelter-this correction evalutes all properties at the mean bulk temperature,which is T1\n",
      "kmb = 0.603\n",
      "h = (kmb/d)*0.023*((Nre)**(0.8))*((Npr1)**0.4);\n",
      "\n",
      "\n",
      "# Results\n",
      "print \" a) Dittus -Boelter the heat transfer coefficient is  \\nh  =  %.0f W/m**2*K \\\n",
      "  =  %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
      "\n",
      "# (b) Seid_er Tate-this correlation evaluates all the properties save muw at the mean bulk temperature \n",
      "h = (kmb/d)*(0.027)*((Nre)**0.8)*((Npr1)**(1./3))*((mu1/mu3)**0.14);\n",
      "print \" b) Seid_er Tate the heat transfer coefficient is  \\nh  =  %.0f W/m**2*K \\\n",
      "  =  %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
      "\n",
      "# (c) Sleicher-Rouse equation\n",
      "a = 0.88-(0.24/(4+Npr3));\n",
      "b = (1./3)+0.5*math.exp((-0.6)*Npr3);\n",
      "Nref = Nre*(mu1/mu2)*(p2/p1);\n",
      "Nnu = 5+0.015*((Nref)**a)*((Npr3)**b);\n",
      "h = Nnu*(kmb/d);\n",
      "print \" c) Sleicher-Rouse equation the heat transfer coefficient is  \\nh  =  %.0f W/m**2*K \\\n",
      "  =  %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
      "\n",
      "# (d) Colbum Analogy- the j factor for heat transfer is calculated\n",
      "jh = 0.023*((Nref)**(-0.2));\n",
      "Nst = jh*((Npr2)**(-2./3));\n",
      "U = (Nre*mu1*10**-3)/(d*p1);\n",
      "h = Nst*(p1*cp1*U);\n",
      "print \" d) Colbum Analogy the heat transfer coefficient is  \\nh \\\n",
      " =  %.0f W/m**2*K  =  %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
      "\n",
      "# (e) Friend-Metzner\n",
      "f = 0.005227;\n",
      "Nnu = ((Nre)*(Npr1)*(f/2.)*((mu1/mu3)**0.14))/(1.20+((11.8)*((f/2)**(1./2))*(Npr1-1)*((Npr1)**(-1./3))));\n",
      "h = Nnu*(kmb/d);\n",
      "print \" e) Friend-Metzner the heat transfer coefficient is  \\nh  =  %.0f W/m**2*K \\\n",
      " =  %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n",
      "\n",
      "# (f) Numerical analysis\n",
      "Nnu = 320.;\n",
      "h = Nnu*(kmb/d);\n",
      "print \" f) Numerical analysis the heat transfer coefficient is  \\nh  =  %.0f W/m**2*K \\\n",
      "  =  %.0f Btu/ft**2*h**-1*degF\"%(h,h*0.17611);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " a) Dittus -Boelter the heat transfer coefficient is  \n",
        "h  =  4322 W/m**2*K   =  761 Btu/ft**2*h**-1*degF\n",
        " b) Seid_er Tate the heat transfer coefficient is  \n",
        "h  =  4733 W/m**2*K   =  834 Btu/ft**2*h**-1*degF\n",
        " c) Sleicher-Rouse equation the heat transfer coefficient is  \n",
        "h  =  4766 W/m**2*K   =  839 Btu/ft**2*h**-1*degF\n",
        " d) Colbum Analogy the heat transfer coefficient is  \n",
        "h  =  4292 W/m**2*K  =  756 Btu/ft**2*h**-1*degF\n",
        " e) Friend-Metzner the heat transfer coefficient is  \n",
        "h  =  4713 W/m**2*K  =  830 Btu/ft**2*h**-1*degF\n",
        " f) Numerical analysis the heat transfer coefficient is  \n",
        "h  =  4824 W/m**2*K   =  850 Btu/ft**2*h**-1*degF\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.6 - Page No :525\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "# given\n",
      "Tw = 680.;  \t\t\t #[K] - temperature at the wall\n",
      "Tb = 640.;  \t\t\t #[K] - temperature at the bulk\n",
      "Tf = (Tw+Tb)/2;  \t\t\t #[K]\n",
      "Nre = 50000.;\n",
      "vmb = 2.88*10.**-7;\n",
      "vf = 2.84*10.**-7;\n",
      "Nref = Nre*(vmb/vf);\n",
      "k = 27.48;\n",
      "d = 0.04;\n",
      "\n",
      "# Calculation and Results\n",
      "# from table 11.3 the prandtl no. is\n",
      "Npr = 8.74*10**-3\n",
      "\n",
      "# consmath.tant heat flow\n",
      "Nnu = 6.3+(0.0167)*((Nref)**0.85)*((Npr)**0.93);\n",
      "h = Nnu*(k/d);\n",
      "print \" constant heat flow h  =  %.0f W/m**2*K  =  %.0f Btu/ft**2*h*degF\"%(h,round(h*0.17611,-1));\n",
      "\n",
      "# constant wall temperature\n",
      "Nnu = 4.8+0.0156*((Nref)**0.85)*((Npr)**0.93);\n",
      "h = Nnu*(k/d);\n",
      "print \" constant wall temperature h  =  %d W/m**2*K  =  %d Btu/ft**2*h*degF\"%(h,h*0.17611);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " constant heat flow h  =  5723 W/m**2*K  =  1010 Btu/ft**2*h*degF\n",
        " constant wall temperature h  =  4600 W/m**2*K  =  810 Btu/ft**2*h*degF\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.7 - Page No :536\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "di = 0.620;  \t\t\t #[inch] - internal diameter\n",
      "d0 = 0.750;  \t\t\t #[inch] - outer diameter\n",
      "Ai = 0.1623;  \t\t\t #[ft**2/ft]\n",
      "Ao = 0.1963;  \t\t\t #[ft**2/ft]\n",
      "wc = 12*(471.3/0.9425);  #[lb/h]\n",
      "cp = 1.;  \t\t\t #[Btu/lbm*degF] - heat capacity of water\n",
      "Tco = 110.;\n",
      "Tci = 50.;\n",
      "\n",
      "# Calculations\n",
      "qtotal = wc*cp*(Tco-Tci);\n",
      "deltaH_coldwater = 3.6*10**5;\n",
      "deltaH_vapourization = 1179.7-269.59;\n",
      "wh = deltaH_coldwater/deltaH_vapourization;\n",
      "hi = 80.;  \t\t\t #[Btu/h*ft**2*degF]\n",
      "ho = 500.;  \t\t\t #[Btu/h*ft**2*degF]\n",
      "km = 26.;  \t\t\t #[Btu/h*ft*degF]\n",
      "Ui = 1./((1./hi)+((Ai*math.log(d0/di))/(2*math.pi*km))+(Ai/(Ao*ho)));\n",
      "deltaT1 = 300-50.;\n",
      "deltaT2 = 300-110.;\n",
      "LMTD = (deltaT1-deltaT2)/(math.log(deltaT1/deltaT2));\n",
      "A = qtotal/(Ui*LMTD);\n",
      "L = A/Ai;\n",
      "\n",
      "# Results\n",
      "print \"the length of the heat exchanger is  L  =  %.2f ft\"%(L);\n",
      "\n",
      "# Answer is slightly different becasue of rounding error."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the length of the heat exchanger is  L  =  145.53 ft\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.8 - Page No :537\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "L = 30.;  \t\t\t     #[ft] - length\n",
      "Ai = 0.1623*L;\n",
      "di = 0.620;  \t\t\t #[inch] - internal diameter\n",
      "d0 = 0.750;  \t\t\t #[inch] - outer diameter\n",
      "Ao = 0.1963*L;  \t\t #[ft**2/ft]\n",
      "wc = 12.*(471.3/0.9425);\n",
      "cp = 1.;  \t\t\t #[Btu/lbm*degF] - heat capacity of water\n",
      "\n",
      "# Calculations\n",
      "deltaH_coldwater = 3.6*10**5;\n",
      "deltaH_vapourization = 1179.7-269.59;\n",
      "wh = deltaH_coldwater/deltaH_vapourization;\n",
      "hi = 80.;  \t\t\t #[Btu/h*ft**2*degF]\n",
      "ho = 500.;  \t\t #[Btu/h*ft**2*degF]\n",
      "km = 26.;  \t\t\t #[Btu/h*ft*degF]\n",
      "Ui = 1./((1./hi)+(((Ai/L)*math.log(d0/di))/(2*math.pi*km))+(Ai/(Ao*ho)));\n",
      "deltaT1 = 300-50.;\n",
      "deltaT = deltaT1/(math.exp((Ui*Ai)/(wc*cp)));\n",
      "Tsat = 300.;\n",
      "Tc2 = Tsat-deltaT;\n",
      "\n",
      "# Results\n",
      "print \" Therefore, the outlet temperature of the cold fluid_ is  Tc2  =  %.2f degF\"%(Tc2);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Therefore, the outlet temperature of the cold fluid_ is  Tc2  =  63.75 degF\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.9 - Page No :538\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Ai = 4.869;\n",
      "wc = 6000.;\n",
      "cp = 1.;\n",
      "Rf = 0.002;\n",
      "Uclean = 69.685;\n",
      "\n",
      "# Calculations\n",
      "Udirty = 1./(Rf+(1./Uclean));\n",
      "deltaT1 = 300.-50;\n",
      "deltaT2 = deltaT1/(math.exp((Udirty*Ai)/(wc*cp)));\n",
      "Th2 = 300.;\n",
      "Tc2 = Th2-deltaT2;\n",
      "\n",
      "# Results\n",
      "print \" the outlet temperature is  Tc2  =  %.1f degF\"%(Tc2);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " the outlet temperature is  Tc2  =  62.1 degF\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 11.10 - Page No :544\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "Ui = 325.;  \t\t\t #[W/m**2*K] - overall heat transfer coefficient\n",
      "Thi = 120.;  \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
      "Tho = 65.;  \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
      "Tci = 15.;  \t\t\t #[degC] - inlet temperature of water\n",
      "Tco = 50.;  \t\t\t #[degC] - outlet temperture of water\n",
      "cp = 4184.;  \t\t\t #[J/kg*K] - heat capacity of water\n",
      "ch = 4184.*0.45\t\t\t #[J/kg*K] - heat capacity of hydrocarbon\n",
      "wc = 1.2;    \t\t\t #[kg/sec] - mass flow rate of water\n",
      "\n",
      "# Calculation and Results\n",
      "wh = ((wc*cp)*(Tco-Tci))/((ch)*(Thi-Tho));\n",
      "qtotal = wc*cp*(Tco-Tci);\n",
      "\n",
      "# (a) - parallel double pipe\n",
      "F = 1.;\n",
      "Thi = 120.;  \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
      "Tho = 65.;  \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
      "Tci = 15.;  \t\t\t #[degC] - inlet temperature of water\n",
      "Tco = 50.;  \t\t\t #[degC] - outlet temperture of water\n",
      "deltaT1 = Thi-Tci;\n",
      "deltaT2 = Tho-Tco;\n",
      "LMTD = (deltaT2-deltaT1)/(math.log(deltaT2/deltaT1));\n",
      "Ai = qtotal/((Ui*LMTD));\n",
      "print \" a) parallel double pipe  Ai  =  %.2f m**2\"%(Ai);\n",
      "\n",
      "# (b) - counter flow\n",
      "F = 1.;\n",
      "Thi = 120.;  \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
      "Tho = 65.;  \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
      "Tco = 15.;  \t\t\t #[degC] - inlet temperature of water\n",
      "Tci = 50.;  \t\t\t #[degC] - outlet temperture of water\n",
      "deltaT1 = Thi-Tci;\n",
      "deltaT2 = Tho-Tco;\n",
      "LMTD = (deltaT2-deltaT1)/(math.log(deltaT2/deltaT1));\n",
      "Ai = qtotal/((Ui*LMTD));\n",
      "print \" b) counter flow   Ai  =  %.2f m**2\"%(Ai);\n",
      "\n",
      "# (c) - 1-2 shell and tube \n",
      "Thi = 120.;  \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
      "Tho = 65.;  \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
      "Tci = 15.;  \t\t\t #[degC] - inlet temperature of water\n",
      "Tco = 50.;  \t\t\t #[degC] - outlet temperture of water\n",
      "Z = (Thi-Tho)/(Tco-Tci);\n",
      "nh = (Tco-Tci)/(Thi-Tci);\n",
      "deltaT1 = Thi-Tco;\n",
      "deltaT2 = Tho-Tci;\n",
      "F = 0.92;\n",
      "LMTD = (F*(deltaT2-deltaT1))/(math.log(deltaT2/deltaT1));\n",
      "Ai = qtotal/((Ui*LMTD));\n",
      "print \" c) 1-2 shell and tube   Ai  =  %.2f m**2\"%(Ai);\n",
      "\n",
      "# (d) - 2-4 shell and tube\n",
      "Thi = 120.;  \t\t\t #[degC] - inlet temperature of hydrocarbon\n",
      "Tho = 65.;  \t\t\t #[degC] - outlet temperature of hydrocarbon\n",
      "Tci = 15.;  \t\t\t #[degC] - inlet temperature of water\n",
      "Tco = 50.;  \t\t\t #[degC] - outlet temperture of water\n",
      "Z = (Thi-Tho)/(Tco-Tci);\n",
      "nh = (Tco-Tci)/(Thi-Tci);\n",
      "F = 0.975;\n",
      "LMTD = (F*(deltaT2-deltaT1))/(math.log(deltaT2/deltaT1));\n",
      "Ai = qtotal/((Ui*LMTD));\n",
      "print \" d) 2-4 shell and tube   Ai  =  %.2f m**2\"%(Ai);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " a) parallel double pipe  Ai  =  11.69 m**2\n",
        " b) counter flow   Ai  =  9.10 m**2\n",
        " c) 1-2 shell and tube   Ai  =  9.89 m**2\n",
        " d) 2-4 shell and tube   Ai  =  9.33 m**2\n"
       ]
      }
     ],
     "prompt_number": 19
    }
   ],
   "metadata": {}
  }
 ]
}