summaryrefslogtreecommitdiff
path: root/Fundamentals_of_Heat_and_Mass_Transfer/Chapter_5.ipynb
blob: a84981070cd29339c3c9658dc37d96079f029d52 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Transient Conduction"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1 Page 261"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Junction Diameter and Time Calculation to attain certain temp\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "h = 400.;          \t\t\t\t\t\t\t\t#[W/m^2.K] Heat Convection coefficient\n",
      "k = 20.;         \t\t\t\t\t\t\t\t#[W/m.K] Thermal Conductivity of Blade\n",
      "c = 400.;        \t\t\t\t\t\t\t\t#[J/kg.K] Specific Heat\n",
      "rho = 8500.;      \t\t\t\t\t\t\t\t#[kg/m^3] Density\n",
      "Ti = 25+273.;        \t\t\t\t\t\t\t#[K] Temp of Air\n",
      "Tsurr = 200+273.;     \t\t\t\t\t\t\t#[K] Temp of Gas Stream\n",
      "TimeConstt = 1;      \t\t\t\t\t\t\t#[sec]\n",
      "#calculations\n",
      "\n",
      "#From Eqn 5.7\n",
      "D = 6*h*TimeConstt/(rho*c);\n",
      "Lc = D/6.;\n",
      "Bi = h*Lc/k;\n",
      "\n",
      "#From eqn 5.5 for time to reach \n",
      "T = 199+273.;    \t\t\t\t\t\t\t\t#[K] Required temperature\n",
      "\n",
      "t = rho*D*c*2.30*math.log10((Ti-Tsurr)/(T-Tsurr))/(h*6.);\n",
      "#results\n",
      "\n",
      "print '%s %.2e %s' %(\"\\n\\n Junction Diameter needed for a time constant of 1 s = \",D,\" m\") \n",
      "print '%s %.2f %s' %(\"\\n\\n Time Required to reach 199degC in a gas stream =\",t,\" sec \");\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        " Junction Diameter needed for a time constant of 1 s =  7.06e-04  m\n",
        "\n",
        "\n",
        " Time Required to reach 199degC in a gas stream = 5.16  sec \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2 Page 265"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Steady State Temperature of junction\n",
      "# Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "h = 400;          \t\t#[W/m^2.K] Heat Convection coefficient\n",
      "k = 20;         \t\t#[W/m.K] Thermal Conductivity of Blade\n",
      "c = 400;        \t\t#[J/kg.K] Specific Heat\n",
      "e = .9;        \t\t\t#Absorptivity\n",
      "rho = 8500;      \t\t#[kg/m^3] Density\n",
      "Ti = 25+273;        \t#[K] Temp of Air\n",
      "Tsurr = 400+273;    \t#[K] Temp of duct wall\n",
      "Tg = 200+273;     \t\t#[K] Temp of Gas Stream\n",
      "TimeConstt = 1;     \t#[sec]\n",
      "stfncnstt=5.67*math.pow(10,(-8)); # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
      "#calculations and results\n",
      "\n",
      "#From Eqn 5.7\n",
      "D = 6*h*TimeConstt/(rho*c);\n",
      "As = math.pi*D*D;\n",
      "V = math.pi*D*D*D/6;\n",
      "\n",
      "#Balancing Energy on thermocouple Junction\n",
      "#Newton Raphson method for 4th order eqn\n",
      "T=500;\n",
      "#After newton raphson method\n",
      "T=490.7 \n",
      "print '%s %.2f %s' %(\"\\n (a) Steady State Temperature of junction =\",T-273,\"degC\\n\");\n",
      "\n",
      "#Using Eqn 5.15 and Integrating the ODE\n",
      "# Integration of the differential equation\n",
      "# dT/dt=-A*[h*(T-Tg)+e*stefncnstt*(T^4-Tsurr^4)]/(rho*V*c) , T(0)=25+273, and finds the minimum time t such that T(t)=217.7+273.15\n",
      "\n",
      "T0=25+273;ng=1;\n",
      "rd=4.98\n",
      "print '%s %.2f %s' %(\"\\n (b) Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value = \",rd,\" s\\n\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) Steady State Temperature of junction = 217.70 degC\n",
        "\n",
        "\n",
        " (b) Time Required for thermocouple to reach a temp that is within 1 degc of its steady-state value =  4.98  s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3 Page 267"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Total Time t required for two step process\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "ho = 40;          \t\t\t#[W/m^2.K] Heat Convection coefficient\n",
      "hc = 10;         \t \t\t#[W/m^2.K] Heat Convection coefficient\n",
      "k = 177;         \t\t\t#[W/m.K] Thermal Conductivity \n",
      "e = .8;        \t\t\t\t#Absorptivity\n",
      "L = 3*math.pow(10,-3) /2.;  #[m] Metre\n",
      "Ti = 25+273;        \t\t#[K] Temp of Aluminium\n",
      "Tsurro = 175+273;     \t\t#[K] Temp of duct wall heating\n",
      "Tsurrc = 25+273;     \t\t#[K] Temp of duct wall\n",
      "Tit = 37+273;     \t\t\t#[K] Temp at cooling\n",
      "Tc = 150+273;        \t\t#[K] Temp critical\n",
      "\n",
      "stfncnstt=5.67*math.pow(10,(-8));   # [W/m^2.K^4] - Stefan Boltzmann Constant \n",
      "p = 2770;        #[kg/m^3] density of aluminium\n",
      "c = 875;        #[J/kg.K] Specific Heat\n",
      "#calculations and results\n",
      "\n",
      "#To assess the validity of the lumped capacitance approximation\n",
      "Bih = ho*L/k;\n",
      "Bic = hc*L/k;\n",
      "print  '%s %.1f %s %.1f' %(\"\\n Lumped capacitance approximation is valid as Bih =\",Bih,\" and Bic = \",Bic);\n",
      "\n",
      "#Eqn 1.9\n",
      "hro = e*stfncnstt*(Tc+Tsurro)*(Tc*Tc+Tsurro*Tsurro);\n",
      "hrc = e*stfncnstt*(Tc+Tsurrc)*(Tc*Tc+Tsurrc*Tsurrc);\n",
      "print '%s %.1f %s %.1f %s' %(\"\\n Since The values of hro = %\",hro,\" and hrc =\",hrc,\"are comparable to those of ho and hc \");\n",
      "\n",
      "# Integration of the differential equation\n",
      "# dy/dt=-1/(p*c*L)*[ho*(y-Tsurro)+e*stfncnstt*(y^4 - Tsurro^4)] , y(0)=Ti, and finds the minimum time t such that y(t)=150 degC\n",
      "te = 423.07\n",
      "tc=123.07\n",
      "#From equation 5.15 and solving the two step process using integration\n",
      "Ty0=Ti;\n",
      "tt=564\n",
      "# solution of integration of the differential equation\n",
      "# dy/dt=-1/(p*c*L)*[hc*(y-Tsurrc)+e*stfncnstt*(y^4 - Tsurrc^4)] , y(rd(1))=Ty(43), and finds the minimum time t such that y(t)=37 degC=Tit\n",
      "t20=te;\n",
      "print '%s %d %s' %(\"\\n\\n Total time for the two-step process is t =\",tt+te,\"s\"); \n",
      "print '%s %d %s %d %s' %(\"with intermediate times of tc =\",tc,\" s and te =\",te,\"s.\");\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Lumped capacitance approximation is valid as Bih = 0.0  and Bic =  0.0\n",
        "\n",
        " Since The values of hro = % 15.0  and hrc = 8.8 are comparable to those of ho and hc \n",
        "\n",
        "\n",
        " Total time for the two-step process is t = 987 s\n",
        "with intermediate times of tc = 123  s and te = 423 s.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4 Page 278"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Radial System with Convection\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "h = 500;          \t\t\t#[W/m^2.K] Heat Convection coefficientat inner surface\n",
      "k = 63.9;         \t\t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 7832;        \t\t\t#[kg/m^3] Density\n",
      "c = 434;            \t\t#[J/kg.K]  Specific Heat\n",
      "alpha = 18.8*math.pow(10,-6);#[m^2/s]\n",
      "L = 40.*math.pow(10,-3);\t#[m] Metre\n",
      "Ti = -20+273;        \t\t#[K] Initial Temp\n",
      "Tsurr = 60+273;     \t\t#[K] Temp of oil\n",
      "t = 8*60 ;          \t\t#[sec] time\n",
      "D = 1 ;       \t\t\t\t#[m] Diameter of pipe\n",
      "#calculations\n",
      "\n",
      "#Using eqn 5.10 and 5.12\n",
      "Bi = h*L/k;\n",
      "Fo = alpha*t/(L*L);\n",
      "\n",
      "#From Table 5.1 at this Bi\n",
      "C1 = 1.047;\n",
      "eta = 0.531;\n",
      "theta0=C1*math.exp(-eta*eta*Fo);\n",
      "T = Tsurr+theta0*(Ti-Tsurr);\n",
      "\n",
      "#Using eqn 5.40b\n",
      "x=1;\n",
      "theta = theta0*math.cos(eta);\n",
      "Tl = Tsurr + (Ti-Tsurr)*theta;\n",
      "q = h*(Tl - Tsurr);\n",
      "\n",
      "#Using Eqn 5.44, 5.46 and Vol per unit length V = pi*D*L\n",
      "Q = (1-(math.sin(eta)/eta)*theta0)*rho*c*math.pi*D*L*(Ti-Tsurr);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s' %(\"\\n (a) After 8 min Biot number =\",Bi,\" and\");\t  \n",
      "print '%s %.2f' %(\"\\n \\n Fourier Numer =\",Fo)\n",
      "print '%s %.2f %s' %(\"\\n\\n (b) Temperature of exterior pipe surface after 8 min = \",T-273,\"degC\")\n",
      "print '%s %.2f %s' %(\"\\n\\n (c) Heat Flux to the wall at 8 min = \",q,\"W/m^2\")\n",
      "print '%s %.2e %s' %(\"\\n\\n (d) Energy transferred to pipe per unit length after 8 min =\",Q,\" J/m\")\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) After 8 min Biot number = 0.31  and\n",
        "\n",
        " \n",
        " Fourier Numer = 5.64\n",
        "\n",
        "\n",
        " (b) Temperature of exterior pipe surface after 8 min =  42.92 degC\n",
        "\n",
        "\n",
        " (c) Heat Flux to the wall at 8 min =  -7362.49 W/m^2\n",
        "\n",
        "\n",
        " (d) Energy transferred to pipe per unit length after 8 min = -2.72e+07  J/m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5 Page 280 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Two step cooling process of Sphere\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "ha = 10.;          \t\t#[W/m^2.K] Heat Convection coefficientat air\n",
      "hw = 6000.;          \t#[W/m^2.K] Heat Convection coefficientat water\n",
      "k = 20.;         \t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 3000.;       \t\t#[kg/m^3] Density\n",
      "c = 1000.;            \t#[J/kg.K]  Specific Heat\n",
      "alpha = 6.66*math.pow(10,-6);     #[m^2/s]\n",
      "Tiw = 335+273.;        \t#[K] Initial Temp\n",
      "Tia = 400+273.;        \t#[K] Initial Temp\n",
      "Tsurr = 20+273.;     \t#[K] Temp of surrounding\n",
      "T = 50+273.;       \t\t#[K] Temp of center\n",
      "ro = .005;        \t\t#[m] radius of sphere\n",
      "#calculations\n",
      "\n",
      "#Using eqn 5.10 and\n",
      "Lc = ro/3.;\n",
      "Bi = ha*Lc/k;\n",
      "ta = rho*ro*c*2.30*(math.log10((Tia-Tsurr)/(Tiw-Tsurr)))/(3*ha);\n",
      "\n",
      "#From Table 5.1 at this Bi\n",
      "C1 = 1.367;\n",
      "eta = 1.8;\n",
      "Fo = -1*2.30*math.log10((T-Tsurr)/((Tiw-Tsurr)*C1))/(eta*eta);\n",
      "\n",
      "tw = Fo*ro*ro/alpha;\n",
      "#results\n",
      "\n",
      "print '%s %.1f %s' %(\"\\n (a) Time required to accomplish desired cooling in air ta =\",ta,\" s\")\n",
      "print '%s %.2f %s' %(\"\\n\\n (b) Time required to accomplish desired cooling in water bath tw =\",tw,\"s\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) Time required to accomplish desired cooling in air ta = 93.7  s\n",
        "\n",
        "\n",
        " (b) Time required to accomplish desired cooling in water bath tw = 3.08 s\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6 Page 288"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Burial Depth\n",
      "\n",
      "#Operating Conditions\n",
      "import math\n",
      "k = .52;         \t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 2050;        \t\t#[kg/m^3] Density\n",
      "c = 1840;            \t#[J/kg.K]  Specific Heat\n",
      "Ti = 20+273.;        \t#[K] Initial Temp\n",
      "Ts = -15+273.;     \t\t#[K] Temp of surrounding\n",
      "T = 0+273.;        \t\t#[K] Temp at depth xm after 60 days\n",
      "t = 60*24*3600.;        #[sec] time perod\n",
      "#calculations\n",
      "\n",
      "alpha = k/(rho*c);      #[m^2/s]\n",
      "#Using eqn 5.57\n",
      "xm = math.erfc((T-Ts)/(Ti-Ts)) *2*math.pow((alpha*t),.5);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s' %(\"\\n Depth at which after 60 days soil freeze =\",xm,\" m\");\n",
      "print '%s' %(\"The answer given in textbook is wrong. Please check using a calculator.\");\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Depth at which after 60 days soil freeze = 0.92  m\n",
        "The answer given in textbook is wrong. Please check using a calculator.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7 Page 293 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Spherical Tumor\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "k = .5;         \t\t#[W/m.K] Thermal Conductivity Healthy Tissue\n",
      "kappa = .02*math.pow(10,3);#[m] extinction coefficient\n",
      "p = .05;            \t# reflectivity of skin\n",
      "D = .005;            \t#[m] Laser beam Dia\n",
      "rho = 989.1  ;      \t#[kg/m^3] Density\n",
      "c = 4180 ;           \t#[J/kg.K]  Specific Heat\n",
      "Tb = 37+273;        \t#[K] Temp of healthy tissue\n",
      "Dt = .003 ;         \t#[m] Dia of tissue\n",
      "d = .02  ;          \t#[m] depth beneath the skin\n",
      "Ttss = 55+273 ;       \t#[K] Steady State Temperature\n",
      "Tb = 37+273 ;       \t#[K] Body Temperature\n",
      "Tt = 52+273 ;       \t#[K] Tissue Temperature\n",
      "q = .170 ;           \t#[W] \n",
      "#calculations\n",
      "\n",
      "#Case 12 of Table 4.1\n",
      "q = 2*math.pi*k*Dt*(Ttss-Tb);\n",
      "\n",
      "#Energy Balancing\n",
      "P = q*(D*D)*math.exp(kappa*d)/((1-p)*Dt*Dt);\n",
      "\n",
      "#Using Eqn 5.14\n",
      "t = rho*(math.pi*Dt*Dt*Dt/6.)*c*(Tt-Tb)/q;\n",
      "\n",
      "alpha=k/(rho*c);\n",
      "Fo = 10.3;\n",
      "#Using Eqn 5.68\n",
      "t2 = Fo*Dt*Dt/(4*alpha);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s' %(\"\\n (a) Heat transferred from the tumor to maintain its surface temperature at Ttss = 55 degC is \",q,\"W\"); \n",
      "print '%s %.2f %s' %(\"\\n\\n (b) Laser power needed to sustain the tumor surface temperautre at Ttss = 55 degC is\", P,\"W\")\n",
      "print '%s %.2f %s' %(\" \\n\\n (c) Time for tumor to reach Tt = 52 degC when heat transfer to the surrounding tissue is neglected is\",t,\"sec\")\n",
      "print '%s %.2f %s' %(\" \\n\\n (d) Time for tumor to reach Tt = 52 degC when Heat transfer to thesurrounding tissue is considered and teh thermal mass of tumor is neglected is\",t2,\"sec\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " (a) Heat transferred from the tumor to maintain its surface temperature at Ttss = 55 degC is  0.17 W\n",
        "\n",
        "\n",
        " (b) Laser power needed to sustain the tumor surface temperautre at Ttss = 55 degC is 0.74 W\n",
        " \n",
        "\n",
        " (c) Time for tumor to reach Tt = 52 degC when heat transfer to the surrounding tissue is neglected is 5.17 sec\n",
        " \n",
        "\n",
        " (d) Time for tumor to reach Tt = 52 degC when Heat transfer to thesurrounding tissue is considered and teh thermal mass of tumor is neglected is 191.63 sec\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8 Page 300"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Thermal Conductivity of Nanostructured material\n",
      "import numpy\n",
      "import math\n",
      "from numpy import linalg\n",
      "#Operating Conditions\n",
      "\n",
      "k = 1.11 ;        \t\t\t#[W/m.K] Thermal Conductivity \n",
      "rho = 3100;        \t\t\t#[kg/m^3] Density\n",
      "c = 820 ;          \t\t\t#[J/kg.K] Specific Heat\n",
      "#Dimensions of Strip\n",
      "w = 100*math.pow(10,-6);\t#[m] Width\n",
      "L = .0035 ;        \t\t\t#[m] Long\n",
      "d = 3000*math.pow(10,-10);\t#[m] Thickness\n",
      "delq = 3.5*math.pow(10,-3);\t#[W] heating Rate \n",
      "delT1 =1.37 ;     \t\t\t#[K] Temperature 1\n",
      "f1 = 2*math.pi ;   \t\t\t#[rad/s] Frequency 1\n",
      "delT2 =.71 ;     \t\t\t#[K] Temperature 2\n",
      "f2 = 200*math.pi;     \t\t#[rad/s] Frequency 2\n",
      "#calculations\n",
      "\n",
      "A = ([[delT1, -delq/(L*math.pi)],\n",
      "     [delT2, -delq/(L*math.pi)]]) ;\n",
      "\n",
      "C= ([[delq*-2.30*math.log10(f1/2.)/(2*L*math.pi)],\n",
      "    [delq*-2.30*math.log10(f2/2.)/(2*L*math.pi)]]) ;\n",
      "\n",
      "B = numpy.linalg.solve (A,C);\n",
      "\n",
      "alpha = k/(rho*c);\n",
      "delp = ([math.pow((alpha/f1),.5), math.pow((alpha/f2),.5)]);\n",
      "#results\n",
      "\n",
      "print '%s %.2f %s %.2f %s' %(\"\\n C2 = \",B[1],\"k =\",B[0],\" W/m.K \")\n",
      "print '%s %.2e %s %.2e %s'\t%(\"\\n\\n Thermal Penetration depths are\",delp[0],\" m and \",delp[1],\"m at frequency 2*pi rad/s and 200*pi rad/s\");\n",
      "\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " C2 =  5.35 k = 1.11  W/m.K \n",
        "\n",
        "\n",
        " Thermal Penetration depths are 2.64e-04  m and  2.64e-05 m at frequency 2*pi rad/s and 200*pi rad/s\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9 Page 305 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Temperature distribution 1.5s after a change in operating power\n",
      "import math\n",
      "#Operating Conditions\n",
      "\n",
      "L = .01;              #[m] Metre\n",
      "Tsurr = 250+273.;       #[K] Temperature\n",
      "h = 1100;              #[W/m^2.K] Heat Convective Coefficient\n",
      "q1 = math.pow(10,7);             #[W/m^3] Volumetric Rate\n",
      "q2 = 2*math.pow(10,7);             #[W/m^3] Volumetric Rate\n",
      "k = 30;                #[W/m.K] Conductivity\n",
      "a = 5*math.pow(10,-6);            #[m^2/s]\n",
      "#calculations\n",
      "\n",
      "delx = L/5.;        #Space increment for numerical solution\n",
      "Bi = h*delx/k;        #Biot  Number\n",
      "#By using stability criterion for Fourier Number\n",
      "Fo = 1/(2*(1+Bi));\n",
      "#By definition\n",
      "t = Fo*delx*delx/a;\n",
      "#results\n",
      "\n",
      "print '%s %.3f %s' %('\\n As per stability criterion delt =',t,' s, hence setting stability limit as .3 s.')\n",
      "#END"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " As per stability criterion delt = 0.373  s, hence setting stability limit as .3 s.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10 Page 311"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Initialization\n",
      "\n",
      "# Using Explicit Finite Difference method, determine temperatures at the surface and 150 mm from the surface after an elapsed time of 2 min\n",
      "# Repeat the calculations using the Implicit Finite Difference Method\n",
      "# Determine the same temperatures analytically\n",
      "import math\n",
      "#Operating Conditions\n",
      "a\n",
      "delx = .075;                #[m] Metre\n",
      "T = 20+273.;                #[K] Temperature\n",
      "q = 3*math.pow(10,5);       #[W/m^3] Volumetric Rate\n",
      "\n",
      "#From Table A.1 copper 300 K\n",
      "k = 401;                    #[W/m.K] Conductivity\n",
      "a = 117*math.pow(10,-6);    #[m^2/s]\n",
      "#calculations and results\n",
      "\n",
      "#By using stability criterion reducing further Fourier Number\n",
      "Fo = 1./2.;\n",
      "#By definition\n",
      "delt = Fo*delx*delx/a;\n",
      "#From calculations,\n",
      "T11=125.19\n",
      "T12=48.1\n",
      "print '%s %.2f %s %.1f %s' %('\\n Hence after 2 min, the surface and the desirde interior temperature T0 =',T11,' degC and T2 =',T12,'degC');\n",
      "\n",
      "#By using stability criterion reducing further Fourier Number\n",
      "Fo = 1/4;\n",
      "#By definition\n",
      "delt = Fo*delx*delx/a;\n",
      "#From calculations\n",
      "T21=118.86 \n",
      "T22=44.4\n",
      "print '%s %.2f %s %.1f %s' %('\\n Hence after 2 min, the surface and the desirde interior temperature T0 = ',T21,'degC and T2 =',T22,'degC')\n",
      "\n",
      "#(c) Approximating slab as semi-infinte medium\n",
      "Tc = T -273 + 2*q*math.pow((a*t/math.pi),.5) /k;\n",
      "t=120.                      #s\n",
      "#At interior point x=0.15 m\n",
      "x =.15;        #[metre]\n",
      "#Analytical Expression\n",
      "Tc2 = T -273 + 2*q*math.pow((a*t/math.pi),.5) /k*math.exp(-x*x/(4*a*t))-q*x/k*(1-math.erf(.15/(2*math.sqrt(a*t))));\n",
      "\n",
      "print '%s %.1f %s' %(' \\n\\n (c) Approximating slab as a semi infinte medium, Analytical epression yields \\n At surface after 120 seconds = ,',Tc,'degC')\n",
      "print '%s %.1f %s' %('\\n At x=.15 m after 120 seconds = ',Tc2,'degC');\n",
      "#END\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Hence after 2 min, the surface and the desirde interior temperature T0 = 125.19  degC and T2 = 48.1 degC\n",
        "\n",
        " Hence after 2 min, the surface and the desirde interior temperature T0 =  118.86 degC and T2 = 44.4 degC\n",
        " \n",
        "\n",
        " (c) Approximating slab as a semi infinte medium, Analytical epression yields \n",
        " At surface after 120 seconds = , 25.6 degC\n",
        "\n",
        " At x=.15 m after 120 seconds =  45.4 degC\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}