summaryrefslogtreecommitdiff
path: root/Heat_Transfer_in_SI_units_by_Holman/Chapter6.ipynb
blob: 92b1940b61744634557c1fd9bde9853e77bdff43 (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
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 6 Empirical and Practical Relations for Forced Convection Heat Transfer"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reynolds number is 14749.0\n",
      "so that the flow is turbulent\n",
      "Heat transfer per unit length is 103.5  W/m\n",
      "Bulk temperature increase over the length of 3 m on tube is 40.04  degree C\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.1\n",
    "# turbulent heat transfer in a tube  \n",
    "# Variable declaration\n",
    "\n",
    "p = 2*101325 \t\t\t# [Pa] pressure of air\n",
    "Ta = 200+273.15\t\t\t# [K] temperature of air \n",
    "d = 0.0254 \t\t\t# [m] diameter of tube \n",
    "R = 287 \t\t\t# [] gas constant\n",
    "u = 10 \t\t\t\t# [m/s] velocity of air\n",
    "dT = 20 \t\t\t# [deg C] temperature difference between wall and air \n",
    "\n",
    "\t# we first calculate the reynolds number to determine if the flow is laminar \t\tor turbulent, and then select the appropriate empirical correlation to \t\t\tcalculate the heat transfer \n",
    "\n",
    "\t# the properties of air at a bulk temperature of 473 K are\n",
    "\n",
    "#Calculaiton\n",
    "\n",
    "rho = p/(R*Ta) \t\t\t# [kg/cubic meter] density of gas\n",
    "mu = 2.57*10**(-5)\t\t# [kg/m s] viscosity  \n",
    "k = 0.0386 \t\t\t# [W/m degree celsius]\n",
    "Cp = 1025 \t\t\t# [J/kg K]\n",
    "Pr = 0.681 \t\t\t# prandtl no.\n",
    "Re_d = rho*u*d/mu \t\t# reynolds number\n",
    "\n",
    "print \"Reynolds number is\",round(Re_d) \n",
    "print\"so that the flow is turbulent\"\n",
    " \n",
    "\t# we therefore use equation (6-4a) to calculate the heat transfer coefficient\n",
    "\n",
    "Nu_d = 0.023*Re_d**(0.8)*Pr**(0.4) \t# nusselt no.\n",
    "h = Nu_d*k/d \t\t\t\t# [W/m**2 deg C] heat transfer coefficient\n",
    "\n",
    "\t# the heat transfer per unit length is then\n",
    "\n",
    "import math\n",
    "q_by_L = h*math.pi*d*(dT) \t\t# [W/m]\n",
    "L = 3 \t\t\t\t\t# [m] \n",
    "\t# we can now make an energy balance to calculate the increase in bulk \t\ttemperature in a 3 m length of tube :\n",
    "\t# q = m_dot*Cp*dT_b = L*(q_byL)\n",
    "m_dot = rho*u*math.pi*d**(2)/4 \t\t# [kg/s] gas flow rate\n",
    "\t# so that we insert the numerical values in the energy balance to obtain \n",
    "dT_b = L*q_by_L/(m_dot*Cp) \t\t# [degree celsius]\n",
    "\n",
    "#Result\n",
    "\n",
    "print\"Heat transfer per unit length is\",round(q_by_L,1),\" W/m\"\n",
    "print\"Bulk temperature increase over the length of 3 m on tube is\",round(dT_b,2),\" degree C\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reynolds number is 823.0\n",
      "so that the flow is laminar\n",
      "\n",
      "Total heat transfer is 3.49 W\n",
      "\n",
      "Exit wall temperature is 161.0  degree celsius\n",
      "\n",
      "Heat transfer coefficient is 26.45  W/sq meter degree C\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.3\n",
    "# heating of air in laminar tube flow for constant heat flux\n",
    "\n",
    "#Variable declaration\n",
    "\n",
    "import math\n",
    "p = 101325 \t\t\t# [Pa] pressure of air\n",
    "Ta = 27 \t\t\t# [degree celsius] temperature of air \n",
    "d = 0.005 \t\t\t# [m] diameter of tube \n",
    "R = 287 \t\t\t# [] gas constant\n",
    "u = 3 \t\t\t\t# [m/s] velocity of air\n",
    "L = 0.1 \t\t\t# [m] length of tube\n",
    "Tb = 77 \t\t\t# [degree celsius] exit bulk temperature \n",
    "\t# we first must evaluate the flow regime and do so by taking properties at the \taverage bulk temperature  \n",
    "Tb_bar = (Ta+Tb)/2 \t\t# [degree celsius]\n",
    "v = 18.22*10**(-6) \t\t# [square meter/s] kinematic viscosity\n",
    "k = 0.02814 \t\t\t# [W/m degree celsius]\n",
    "Cp = 1006 \t\t\t# [J/kg K]\n",
    "Pr = 0.703 \t\t\t# prandtl no.\n",
    "Re_d = u*d/v \t\t\t# reynolds number\n",
    "print \"Reynolds number is\",round(Re_d) \n",
    "print\"so that the flow is laminar\\n\" \n",
    "\t\n",
    "\t#the tube length is short, so we expect a thermal entrance effect and shall \t\tconsult figure(6-5)\n",
    "\t# the inverse Graetz number is computed as \n",
    "Gz_inverse = L/(Re_d*Pr*d) \n",
    "\t# therefore, for qw = constant, we obtain the nusselt number at exit from \t\tfigure (6-5) as\n",
    "Nu = 4.7 \n",
    "\t# the total heat transfer is obtained in terms of the overall energy balance \n",
    "\t# at entrance \n",
    "rho = 1.1774 \t\t\t # [kg/cubic meter] density\n",
    "\t# mass flow is\n",
    "m_dot = rho*math.pi*d**(2)*u/4 \t # [kg/s]\n",
    "q = m_dot*Cp*(Tb-Ta) \t\t # [W]\n",
    "\t# thus we may find the heat transfer without the actually determining wall \t\ttemperatures or values of h. However, to determine Tw we must compute qw for \t\tinsertion in equation(b). we have\n",
    "qw = q/(math.pi*d*L) \t\t # [W]\n",
    "\t# now\n",
    "Tw = Tb+(qw*d/(Nu*k)) \t\t # [degree celsius]\n",
    "\t# and the heat transfer coefficient is\n",
    "h = qw/(Tw-Tb) \t\t\t # [W/square meter degree celsius]\n",
    "print \"Total heat transfer is\",round(q,2),\"W\"\n",
    "print \"\\nExit wall temperature is\",round(Tw),\" degree celsius\" \n",
    "print \"\\nHeat transfer coefficient is\",round(h,2),\" W/sq meter degree C\" "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reynolds number is 823.0\n",
      "so that the flow is laminar\n",
      "Exit wall temperature is 128.66 degree celsius\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.4\n",
    "# heating of air with isothermal tube wall\n",
    "\n",
    "# Variable declaration\n",
    "\n",
    "p = 101325 \t\t\t# [Pa] pressure of air\n",
    "Ta = 27\t\t\t\t# [degree celsius] temperature of air \n",
    "d = 0.005 \t\t\t# [m] diameter of tube \n",
    "R = 287 \t\t\t# [] gas constant\n",
    "u = 3 \t\t\t\t# [m/s] velocity of air\n",
    "L = 0.1 \t\t\t# [m] length of tube\n",
    "Tb = 77 \t\t\t# [degree celsius] exit bulk temperature \n",
    "\n",
    "\t# we first must evaluate the flow regime and do so by taking properties at the \taverage bulk temperature  \n",
    "\n",
    "Tb_bar = (Ta+Tb)/2 \t\t# [degree celsius]\n",
    "v = 18.22*10**(-6) \t\t# [square meter/s] kinematic viscosity\n",
    "k = 0.02814 \t\t\t# [W/m degree celsius]\n",
    "Cp = 1006 \t\t\t# [J/kg K]\n",
    "Pr = 0.703 \t\t\t# prandtl no.\n",
    "Re_d = u*d/v \t\t\t# reynolds number\n",
    "print \"Reynolds number is\",round(Re_d) \n",
    "print \"so that the flow is laminar\" \n",
    "\t# so that the flow is laminar\n",
    "\t# now we determine Nu_d_bar for Tw = constant. for Gz_inverse = 0.0346 we read \n",
    "Nu_d = 5.15 \n",
    "\t# we thus calculate the average heat transfer coefficient as \n",
    "\n",
    "h_bar = Nu_d*k/d \t\t# [W/square meter degree celsius]\n",
    "\t# we base the heat transfer on a mean bulk temperature of Tb_bar, so that\n",
    "import math\n",
    "Tw = 3.49/(h_bar*math.pi*d*L)+Tb_bar \t# [degree celsius]\n",
    "\n",
    "\n",
    "print \"Exit wall temperature is\",round(Tw,2),\"degree celsius\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The length of tube necessary to accomplish the heating is 1.4 m\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.5\n",
    "# heat transfer in a rough tube \n",
    "\n",
    "# Variable declaration\n",
    "\n",
    "Tw = 90 \t\t\t# [degree celsius] temperature of tube wall \n",
    "d = 0.02 \t\t\t# [m] diameter of tube \n",
    "u = 3 \t\t\t\t# [m/s] velocity of air\n",
    "Tw_i = 40 \t\t\t# [degree celsius] entering water temperature \n",
    "Tw_f = 60 \t\t\t# [degree celsius] leaving water temperature\n",
    "Cp = 4.174*10**3 \t\t# [J/kg K]\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Tb_bar = (Tw_i+Tw_f)/2 \t\t# [degree celsius]\n",
    "\n",
    "\t#we first calculate the heat transfer from q = m_dot*Cp*dTb\n",
    "\t\n",
    "import math\n",
    "q = 989*3*math.pi*0.01**(2)*4174*(Tw_f-Tw_i) \t# [W]\n",
    "\n",
    "\t# for the rough tube condition, we may employ the Petukhov relation, equation \t\t  (6-7) The mean film temperaturee is \n",
    "\n",
    "Tf = (Tw+Tb_bar)/2 \t\t# [degree celsius]\n",
    "\n",
    "\t# and the fluid properties are \n",
    "\n",
    "rho = 978 \t\t\t# [kg/cubic meter] density of gas\n",
    "mu = 4.0*10**(-4) \t\t# [kg/m s] viscosity  \n",
    "k = 0.664 \t\t\t# [W/m degree celsius]\n",
    "Pr = 2.54 \t\t\t# prandtl no.\n",
    "\n",
    "\t# also\n",
    "\n",
    "mu_b = 5.55*10**(-4) \t\t# [kg/m s] viscosity  \n",
    "mu_w = 2.81*10**(-4) \t\t# [kg/m s] viscosity  \n",
    "\n",
    "\t# the reynolds number is thus \n",
    "\n",
    "Re_d = rho*u*d/mu \n",
    "\n",
    "\t# consulting figure(6-14), we find the friction factor as \n",
    "\n",
    "f_f = 0.0218 \n",
    "\n",
    "\t# because Tw>Tb, we take \n",
    "\n",
    "n = 0.11 \n",
    "\n",
    "\t# and obtain\n",
    "\n",
    "Nu_d=((f_f*Re_d*2.54)/((1.07+12.7*(f_f/8)**(0.5)*(2.54**(2.0/3.0)-1))*8))*(mu_b/mu_w)**(n) \n",
    "h = Nu_d*k/d \t\t\t# [W/square meter degree celsius]\n",
    "\n",
    "\t# the tube length is obtained from energy balance \n",
    "\n",
    "L = q/(h*math.pi*d*(Tw-Tb_bar))  # [m]\n",
    "\n",
    "print \"The length of tube necessary to accomplish the heating is\",round(L,2),\"m\" "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reynolds number is 50988.0\n",
      "so the flow is turbulent\n",
      "The constant heat flux that must be applied at the tube surface to result in an air temperature rise of 5 degree celsius is 11870.8  W/square meter\n",
      "average wall temperature is 370.0 K\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.6\n",
    "# turbulent heat transfer in a short tube \n",
    "\n",
    "#Variable declaration\n",
    "\n",
    "p = 101325\t\t\t # [Pa] pressure of air\n",
    "Ta = 300 \t\t\t # [K] temperature of air \n",
    "d = 0.02 \t\t\t # [m] diameter of tube \n",
    "u = 40 \t\t\t\t # [m/s] velocity of air\n",
    "L = 0.1\t\t\t\t # [m] length of tube\n",
    "dT = 5.0 \t\t\t\t # [degree celsius] rise in temperature \n",
    "#\t we first must evaluate the air properties at 300 K  \n",
    "v = 15.69*10**(-6) \t\t # [square meter/s] kinematic viscosity\n",
    "k = 0.02624 \t\t\t # [W/m degree celsius]\n",
    "Cp = 1006.0\t\t\t # [J/kg K]\n",
    "Pr = 0.70 \t\t\t# prandtl no.\n",
    "rho = 1.18 \t\t\t# [kg/cubic meter]\n",
    "Re_d = u*d/v \t\t\t# reynolds number\n",
    "\n",
    "print \"Reynolds number is\",round(Re_d)\n",
    "print\"so the flow is turbulent\"\n",
    "\n",
    "\t# consulting figure (6-6) for this value of Re_d and L/d = 5 we find\n",
    "Nu_x_by_Nu_inf = 1.15 \n",
    "\t# or the heat transfer coefficient is about 15 percent higher that it would be \tfor thermally developed flow.\n",
    "\t# we calculate heat-transfer for developed flow using \n",
    "Nu_d = 0.023*Re_d**(0.8)*Pr**(0.4) \n",
    "\t# and  \n",
    "h = k*Nu_d/d \t\t\t # [W/square meter degree celsius]\n",
    "\t# increasing this value by 15 percent\n",
    "h = 1.15*h \t\t\t # [W/square meter degree celsius]\n",
    "\t# the mass flow is\n",
    "import math\n",
    "Ac = math.pi*d**(2)/4 \t\t # [square meter] \n",
    "m_dot = rho*u*Ac \t\t # [kg/s]\n",
    "\t# so the total heat transfer is\n",
    "A = math.pi*d*L\t\t\t # [square meter] \n",
    "q_by_A = m_dot*Cp*dT/A\t\t # [W/square meter]\n",
    "print \"The constant heat flux that must be applied at the tube surface to result in an air temperature rise of 5 degree celsius is\",q_by_A,\" W/square meter\"\n",
    "Tb_bar = (Ta+(Ta+dT))/2 \t # [K]\n",
    "Tw_bar = Tb_bar+q_by_A/h \t # [K] \n",
    "print \"average wall temperature is\",round(Tw_bar),\"K\" "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Heat loss per unit length of cylinder is 3100.0 W/m\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.7\n",
    "# airflow across isothermal cylinder\n",
    "\n",
    "# Variable declaration\n",
    "\n",
    "p = 101325 \t\t\t# [Pa] pressure of air\n",
    "Ta = 35+273.15 \t\t\t# [K] temperature of air \n",
    "d = 0.05 \t\t\t# [m] diameter of tube \n",
    "R = 287 \t\t\t# [] gas constant\n",
    "u = 50 \t\t\t\t# [m/s] velocity of air\n",
    "Tc = 150+273.15 \t\t# [degree celsius] cylinder temperature\n",
    "\n",
    "\t# we first find the reynolds number and then find the applicable constants \tfrom table(6-2) for use with equation (6-17) \n",
    "\t# the properties of air are evaluated at the film temperature:\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Tf = (Ta+Tc)/2 \t\t\t# [K]\n",
    "rho_f = p/(R*Tf) \t\t# [kg/cubic meter]\n",
    "mu_f = 2.14*10**(-5) \t\t# [kg/m s]\n",
    "k_f = 0.0312 \t\t\t# [W/m degree celsius]\n",
    "Pr_f = 0.695 \t\t\t# prandtl number\n",
    "Re_f = rho_f*u*d/mu_f \t\t# reynolds number\n",
    "\n",
    "\t# from table (6-2) table\n",
    "\n",
    "C = 0.0266 \n",
    "n = 0.805 \n",
    "\n",
    "\t# so from equation (6-17)\n",
    "\n",
    "h = C*(Re_f)**(n)*(Pr_f)**(1.0/3.0)*k_f/d   # [W/sq m deg C] heat transfer coefficient\n",
    "\n",
    "\t# the heat transfer per unit length is \n",
    "import math\n",
    "\n",
    "q_by_L = h*math.pi*d*(Tc-Ta) \t\t# [W/m]\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Heat loss per unit length of cylinder is\",round(q_by_L),\"W/m\" "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Heat lost per unit length by the wire is 11.88 W/m\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.8\n",
    "# heat transfer from electrically heated\n",
    "\n",
    "# Variable declaration\n",
    "\n",
    "p = 101325 \t\t\t# [Pa] pressure of air\n",
    "Tw = 25+273.15 \t\t\t# [K] temperature of air \n",
    "d = 3.94*10**(-5) \t\t# [m] diameter of wire\n",
    "R = 287 \t\t\t# [] gas constant\n",
    "u = 50 \t\t\t\t# [m/s] velocity of air perpendicular to the air\n",
    "Tr = 50+273.15 \t\t\t# [degree celsius] rise in surface temperature\n",
    "\t# we first obtain the properties at the film temperature :\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Tf = (Tw+Tr)/2 \t\t\t# [K]\n",
    "v_f = 16.7*10**(-6) \t\t# [square meter/s]\n",
    "k = 0.02704 \t\t\t# [W/m degree celsius]\n",
    "Pr_f = 0.706 \t\t\t# prandtl number\n",
    "Re_d = u*d/v_f \t\t\t# reynolds number\n",
    "\t# the Peclet number is \n",
    "Pe = Re_d*Pr_f \n",
    "\t# and we find that equations (6-17),(6-21), or (6-19) apply.\n",
    "\t# let us make the calculation with both the simplest expression, (6-17),and \t\tthe most complex,(6-21), and compare results.\n",
    "\t# using equation (6-17) with \n",
    "C = 0.683 \n",
    "n = 0.466 \n",
    "\t# we have\n",
    "Nu_d = 0.683*Re_d**(n)*Pr_f**(1/3) \n",
    "\t# the value of heat transfer coefficient is\n",
    "h = Nu_d*k/d \t\t\t # [W/square meter degree celsius]\n",
    "\t# the heat transfer per unit length is then \n",
    "import math\n",
    "q_by_L = math.pi*d*h*(Tr-Tw)\t # [W/m]\n",
    "\t# using equation (6-21), we calculate the nusselt no as \n",
    "Nu_d1=0.3+((0.62*Re_d**(1.0/2.0)*Pr_f**(1.0/3.0))/((1+(0.4/Pr_f)**(2.0/3.0))**(1.0/4.0))*((1+(Re_d/282000)**(5.0/8.0))**(4.0/5.0))) \n",
    "h1 = Nu_d1*k/d \t\t\t # [W/square meter degree celsius]\n",
    "\t# and\n",
    "q_by_L1 = h1*math.pi*d*(Tr-Tw) \t  # [W/m]\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Heat lost per unit length by the wire is\",round(q_by_L1,2),\"W/m\" "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Heat lost by the sphere is 1.554 W\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.9\n",
    "# heat transfer from sphere \n",
    "\n",
    "# Variable declaration\n",
    "\n",
    "p = 101325 \t\t\t# [Pa] pressure of air\n",
    "Ta = 27+273.15 \t\t\t# [K] temperature of air \n",
    "d = 0.012 \t\t\t# [m] diameter of sphere\n",
    "u = 4 \t\t\t\t# [m/s] velocity of air \n",
    "Ts = 77+273.15 \t\t\t# [degree celsius] surface temperature of sphere\n",
    "\t# consulting equation (6-30) we find that the reynolds number is evaluated at \t\tthe free-stream temperature.\n",
    "\t# we therefore need the following properties at Ta = 300.15K\n",
    "v = 15.69*10**(-6) \t\t# [square meter/s]\n",
    "k = 0.02624 \t\t\t# [W/m degree celsius]\n",
    "Pr = 0.708 \t\t\t# prandtl number\n",
    "mu_inf = 1.8462*10**(-5) \t# [kg/m s]\n",
    "\t# at Ts = 350K\n",
    "mu_w = 2.075*10**(-5) \t\t# [kg/m s]\n",
    "Re_d = u*d/v \t\t\t# reynolds number\n",
    "\n",
    "#Calculation\n",
    "\t# from equation (6-30),\n",
    "Nu_bar=2+((0.4)*(Re_d)**(1.0/2.0)+0.06*(Re_d)**(2.0/3.0))*(Pr**(0.4))*((mu_inf/mu_w)**(1.0/4.0)) \n",
    "\n",
    "\n",
    "\t# and\n",
    "\n",
    "h_bar = Nu_bar*k/d \t\t# [W/sq m degree celsius] heat transfer coefficient\n",
    "\n",
    "\t# the heat transfer is then \n",
    "\n",
    "import math\n",
    "\n",
    "A = (4*math.pi*d**(2))/4 \t# [square meter] area of sphere\n",
    "\n",
    "q = h_bar*A*(Ts-Ta) \t\t# [W]\n",
    "\n",
    "\n",
    "\t# for comparison purposes let us also calculate the heat-transfer coefficient \t\t using equation(6-25). the film temperature is \n",
    "Tf = (Ta+Ts)/2 \t\t\t# [K]\n",
    "v_f = 18.23*10**(-6) \t\t# [square meter/s]\n",
    "k_f = 0.02814 \t\t\t# [W/m degree celsius] \n",
    "\t# reynolds number is \n",
    "Re_d1 = u*d/v_f \n",
    "\t# from equation (6-25)\n",
    "Nu_f = 0.37*(u*d/v_f)**(0.6) \n",
    "\t# and h_bar is calculated as\n",
    "\n",
    "h_bar = Nu_f*k_f/d \t\t# [W/sq m degree celsius]\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Heat lost by the sphere is\",round(q,3),\"W\" "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Heat transfer coefficient is 185.6 W/square meter degree celsius\n",
      "Heat transfer coefficient for previous problem is 163.5 W/sq meter degree C\n",
      "Percentage increase in value of h is 14.0\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.11\n",
    "# alternate calculation method \n",
    "\n",
    "# Variable declaration\n",
    "\n",
    "\t# data for this example is taken from previous example (6-10)\n",
    "\t# properties for use in equation (6-34) are evaluated at free-atream \tconditions of 10 degree celsius\n",
    "v = 14.2*10**(-6)\t\t\t # [square meter/s]\n",
    "k = 0.0249 \t\t\t\t # [W/m degree celsius]\n",
    "Pr = 0.712 \t\t\t\t # prandtl number\n",
    "Pr_w = 0.70 \t\t\t\t# prandtl number\n",
    "u = 7 \t\t\t\t\t# [m/s] velocity of air \n",
    "Sp = 0.0381 \t\t\t\t# [m] spacing between normal and parallel \t\t\t\t\t\tdirection to the flow\n",
    "Sn = 0.0381 \t\t\t\t# spacing between normal and parallel \t\t\t\t\t direction to the flow\n",
    "d = 0.0254 \t\t\t\t# [m] diameter of tube\n",
    "\t#maximum velocity is \n",
    "u_max = u*(Sn/(Sn-d)) \t\t\t# [m/s]\n",
    "\t# the reynolds number is \n",
    "Re_d_max = u_max*d/v \n",
    "\t# so that the constants for equation (6-34) are\n",
    "C = 0.27 \n",
    "n = 0.63 \n",
    "\t# inserting values we obtain\n",
    "h = C*Re_d_max**(n)*(Pr/Pr_w)**(1/4)*k/d \t# [W/sq m degree C] heat transfer \t\t\t\t\t\t\tcoefficient\n",
    "\t# multiplying by 0.92 from table 6-7 (page no.-300) to correct for only five \ttube rows gives\n",
    "h = 0.92*h \t\t\t\t\t# [W/square meter degree celsius]\n",
    "print \"Heat transfer coefficient is\",round(h,1),\"W/square meter degree celsius\"\n",
    "\n",
    "h_in = 163.46432 \t\t\t# [W/sq m deg C] from previous example\n",
    "\n",
    "print \"Heat transfer coefficient for previous problem is\",round(h_in,1),\"W/sq meter degree C\" \n",
    "P = (h-h_in)*100/h_in \n",
    "print \"Percentage increase in value of h is\",round(P)  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 6.12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Length of tube required to effect the heat transfer is 1.56 m\n"
     ]
    }
   ],
   "source": [
    "#Example Number 6.12\n",
    "# heating of liquid bismuth in tube \n",
    "\n",
    "# variable declaration\n",
    "\n",
    "m_dot = 4.5 \t\t\t# [Kg/s] flow rate of bismuth\n",
    "d = 0.05 \t\t\t# [m] diameter of steel tube\n",
    "\n",
    "Ti = 415 \t\t\t# [degree celsius] initial temperature of bismuth\n",
    "Tf = 440 \t\t\t# [degree celsius] final temperature of bismuth\n",
    "\t# because a constant heat flux is maintained, we may use equation 6-47 to \t\tcalculate the heat transfer coefficient.\n",
    "\t# the properties of bismuth are evaluated at the average bulk temperature of \n",
    "#Calculation\n",
    "\n",
    "Ta = (Ti+Tf)/2 \t\t\t# [degree celsius]\n",
    "mu = 1.34*10**(-3) \t\t# [Kg/m s] viscosity\n",
    "Cp = 149 \t\t\t# [J/Kg degree celsius] heat \n",
    "k = 15.6 \t\t\t# [W/m degree celsius]\n",
    "Pr = 0.013 \t\t\t# prandtl number\n",
    "\t# the total transfer is calculated from\n",
    "q = m_dot*Cp*(Tf-Ti) \t\t# [W]\n",
    "\t# we calculate reynolds and peclet number as \n",
    "\n",
    "import math\n",
    "G = m_dot/(math.pi*d**(2)/4) \n",
    "Re_d = d*G/mu \n",
    "Pe = Re_d*Pr \n",
    "\t# the heat transfer coefficient is calculated from equation 6-47\n",
    "Nu_d = 4.82+0.0185*Pe**(0.827) \n",
    "h = Nu_d*k/d \t\t\t\t# [W/square meter degree celsius]\n",
    "\t# the total required surface area of the tube may now be computed from q=h*A*DT\n",
    "\t# where we use the temperature difference of\n",
    "DT = 20 \t\t\t# [degree celsius] \n",
    "A = q/(h*DT) \t\t\t# [square meter] \n",
    "\t# the area in turn can be expressed in terms of tube length \n",
    "L = A/(math.pi*d) \t\t# [m]\n",
    "\n",
    "#Result\n",
    "print\"Length of tube required to effect the heat transfer is\",round(L,2),\"m\" "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}