summaryrefslogtreecommitdiff
path: root/Introduction_to_Heat_Transfer_by_S._K._Som/Chapter8.ipynb
blob: a6c237e40fc15fd8424f4b580ac3ac2c1e26f018 (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
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Chapter 08:Principles of free convection"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.1:pg-355"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 1\n",
      "Grashoff number is\n",
      "GrL= 2175146201.53\n",
      "Rayleigh number is\n",
      "RaL= 9440134514.65\n",
      "Therefore the flow is turbulent\n",
      "Now we use [(hbarL*L)/k]=0.10*(GrL*Pr)**(1/3)\n",
      "The average heat transfer coefficient in W/(m**2*K) is\n",
      "hbarL= 0.314\n",
      "The rate of heat transfer in W is\n",
      "q= 0.5024\n"
     ]
    }
   ],
   "source": [
    "import math \n",
    " \n",
    "print\"Introduction to heat transfer by S.K.Som, Chapter 8, Example 1\"\n",
    "#Water is heated by a vertical flat plate  length(L=200mm or .2m )by breadth(B=200mm) which is maintained at temprature,Tw=60°C\n",
    "Tw=60;\n",
    "L=.2;\n",
    "B=.2;# in metre\n",
    "#Area(A) is L*B \n",
    "A=L*B;\n",
    "#Water is at temprature,Tinf=20°C\n",
    "Tinf=20;\n",
    "#At mean film temprature 40°C The physical properties parameters can be taken as \n",
    "#conductivity(k=0.0628W/(m*K)),Prandtl number(Pr=4.34),density(rho=994.59kg/m**3),kinematic viscosity(nu=0.658*10**-6m**2/s),volume expnasion coefficient(Beta=3*10**-4K**-1))\n",
    "k=0.628;\n",
    "Pr=4.34;\n",
    "rho=994.59;\n",
    "nu=0.658*10**-6;\n",
    "Beta=3*10**-4;\n",
    "#g is acceleration due to gravity =9.81m/s**2\n",
    "g=9.81;\n",
    "#Grashoff number is given by GrL=(g*beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"Grashoff number is\"\n",
    "GrL=(g*Beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"GrL=\",GrL\n",
    "#Rayleigh number is defined as RaL=GrL*Pr\n",
    "print\"Rayleigh number is\"\n",
    "RaL=GrL*Pr\n",
    "print\"RaL=\",RaL\n",
    "print\"Therefore the flow is turbulent\"\n",
    "print\"Now we use [(hbarL*L)/k]=0.10*(GrL*Pr)**(1/3)\"\n",
    "#hbarL is the average heat transfer coefficient\n",
    "print\"The average heat transfer coefficient in W/(m**2*K) is\"\n",
    "hbarL=(0.10*(GrL*Pr)**(1/3)*k)/L\n",
    "print\"hbarL=\",hbarL\n",
    "#The rate of heat transfer is given by q=hbarL*A*(Tw-Tinf)\n",
    "print\"The rate of heat transfer in W is\"\n",
    "q=hbarL*A*(Tw-Tinf)\n",
    "print\"q=\",q\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.2:pg-357"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 2\n",
      "The minimum spacing between the plates will be twice the thickness of the boundary layer at the trailing edge where x=0.09\n",
      "Grashoff number is\n",
      "GrL= 198210197.615\n",
      "Rayleigh number is\n",
      "RaL= 860232257.647\n",
      "Since Ra<10**9,Therefore the flow is laminar\n",
      "The thickness of the boundary layer in metre is\n",
      "delta= 4.11168026839e-10\n",
      "The minimum spacing in metre is\n",
      "spac= 8.22336053678e-10\n"
     ]
    }
   ],
   "source": [
    " \n",
    "import math \n",
    " \n",
    "print\"Introduction to heat transfer by S.K.Som, Chapter 8, Example 2\"\n",
    "#The thin plates are kept at temprature(Tw)=60°C while the temprature of water bath(Tinf)=20°C\n",
    "Tw=60;\n",
    "Tinf=20;\n",
    "#The plates have length(L)=90mm or .09m\n",
    "L=.09;\n",
    "#The minimum spacing between the plates will be twice the thickness of the boundary layer at the trailing edge where x=0.09.\n",
    "print\"The minimum spacing between the plates will be twice the thickness of the boundary layer at the trailing edge where x=0.09\"\n",
    "x=.09;\n",
    "#At mean film temprature 40°C The physical properties parameters can be taken as\n",
    "# conducivity(k=0.0628W/(m*K)),Prandtl number(Pr=4.34),Density(rho=994.59kg/m**3),kinematic viscosity(nu=0.658*10**-6m**2/s),Volume expansion coefficient(Beta=3*10**-4K**-1)\n",
    "k=0.628;\n",
    "Pr=4.34;\n",
    "rho=994.59;\n",
    "nu=0.658*10**-6;\n",
    "Beta=3*10**-4;\n",
    "#g is acceleration due to gravity =9.81m/s**2\n",
    "g=9.81;\n",
    "#Grashoff number is given by GrL=(g*beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"Grashoff number is\"\n",
    "GrL=(g*Beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"GrL=\",GrL\n",
    "#Rayleigh number is defined as RaL=GrL*Pr\n",
    "print\"Rayleigh number is\"\n",
    "RaL=GrL*Pr\n",
    "print\"RaL=\",RaL\n",
    "print\"Since Ra<10**9,Therefore the flow is laminar\"\n",
    "#delta is the thickness of the boundary layer\n",
    "print\"The thickness of the boundary layer in metre is\"\n",
    "delta=x*3.93*Pr**(-1/2)*(0.952+Pr)**(1/4)*GrL**(-1/4)\n",
    "print\"delta=\",delta\n",
    "#spac is the minimum spacing \n",
    "print\"The minimum spacing in metre is\"\n",
    "spac=2*delta\n",
    "print\"spac=\",spac\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.3:pg-366"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 3\n",
      "Grashoff number is\n",
      "Grx= 517025.52213\n",
      "The boundary layer thickness in metre is\n",
      "delta= 60304.3038858\n",
      "The velocity at point x is ux in m/s is\n",
      "ux= 3247798354.51\n",
      "For maximum value of velocity,u\n",
      "Maximum velocity in m/s is\n",
      "Umax= 3.57089835848\n",
      "Mass flow rate at x=0.8m,in kG is\n",
      "mdot= 2.36830073295e+16\n"
     ]
    }
   ],
   "source": [
    "\n",
    "from scipy.integrate import quad\n",
    "print \"Introduction to heat transfer by S.K.Som, Chapter 8, Example 3\"\n",
    "#Considering question 5.7\n",
    "#A wall is exposed to nitrogen at one atmospheric pressure and temprature,Tinf=4°C.\n",
    "Tinf=4.0;\n",
    "#The wall is H=2.0m high and 2.5m wide and is maintained at temprature,Tw=56°C\n",
    "Tw=56.0;\n",
    "H=2.0;\n",
    "B=2.5;\n",
    "A=H*B;#Area of wall in m**2\n",
    "#The properties of nitrogen at mean film temprature (56+4)/2=30°C are given as \n",
    "#density(rho=1.142kg/m*3) ,conductivity(k=0.026W/(m*K)),kinematic viscosity(nu=15.630*10-6 m*2/s) ,prandtl number(Pr=0.713)\n",
    "rho=1.142;\n",
    "k=0.026;\n",
    "nu=15.630*10**-6;\n",
    "Pr=0.713;\n",
    "Tf=30.0;#mean film temprature\n",
    "Beta=1/(273.0+Tf);#volume expansion coefficient:unit K**-1\n",
    "#Now Grashoff number is Grx=(g*Beta*(Tw-Tinf)*x*3)/nu*2\n",
    "g=9.81;#acceleration due to gravity\n",
    "print \"Grashoff number is\"\n",
    "x=0.8;#distance from the bottom of wall\n",
    "Grx=(g*Beta*(Tw-Tinf)*x*3)/nu*2\n",
    "print\"Grx=\",Grx\n",
    "#Using equation delta=x*Pr*(-0.5)(0.952+Pr)*(0.25)*Grx*(-0.25)\n",
    "#delta is the boundary layer thickness\n",
    "print \"The boundary layer thickness in metre is\"\n",
    "delta=x*3.93*Pr*(-0.5)*(0.952+Pr)*(0.25)*Grx*(-0.25)\n",
    "print\"delta=\",delta\n",
    "#Now using equation ux=(g*Beta*delta*2(Tw-Tinf))/(4*nu)\n",
    "#ux is the velocity at point x\n",
    "print \"The velocity at point x is ux in m/s is\"\n",
    "ux=(g*Beta*delta*2*(Tw-Tinf))/(4*nu)\n",
    "print\"ux=\",ux\n",
    "# (u/ux)=(y/delta)*(1-y/delta)**2\n",
    "#Putting value of ux we get velovity function,u=465.9*(y-116*y*2+3341*y*3)\n",
    "#For maximum value of u,du/dy=465.9*(1-232*y+10023*y**2)=0...this is a quadratic equation in which coefficients a=10023,b=232,c=1\n",
    "a=10023;\n",
    "b=232;\n",
    "c=1;\n",
    "#Solution for quadratic equation is given by y=(-b+-(b*2-4ac)*0.5)/2*a\n",
    "print \"For maximum value of velocity,u\"\n",
    "y=(b+(b*2-4*a*c)*0.5)/(2*a)#root of the quadratic equation\n",
    "y=(b-(b*2-4*a*c)*0.5)/(2*a)#root of the quadratic equation\n",
    "#The value of 0.0173 is at the edge of boundary layer,where u=0\n",
    "#Therefore the maximum value occurs at y=0.00573m i.e Umax=465.9*y*(1-57.8*y)**2\n",
    "y=0.00573;\n",
    "#Umax is maximum velocity\n",
    "print \"Maximum velocity in m/s is\"\n",
    "Umax=465.9*y*(1-57.8*y)*2#NOTE:The answer given in the book is incorrect,in this expresssion they considered square on y only,however it is on whole expression (1-57.8*y)*2\n",
    "#mdot is mass flow rate\n",
    "print\"Umax=\",Umax\n",
    "print \"Mass flow rate at x=0.8m,in kG is\"\n",
    "I=quad(lambda y:465.9*(y-116*y*2+3341*y*3),0,delta)\n",
    "mdot=rho*B*I[0]\n",
    "print\"mdot=\",mdot\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.4:pg-369"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 4\n",
      "Grashoff number is\n",
      "Rayleigh number is\n",
      "Hence,the flow is laminar\n",
      "The thickness of the boundary layer in metre is\n",
      "The average heat transfer coeficient in W/(m**2*K) is\n",
      "0.101781170483\n"
     ]
    }
   ],
   "source": [
    " \n",
    "import math \n",
    " \n",
    "print\"Introduction to heat transfer by S.K.Som, Chapter 8, Example 4\"\n",
    "#A square plate length,L=0.2m by breadth,B=0.2m is suspended vertically in a quiescent atmospheric air at a temprature(Tinf)=300K\n",
    "L=0.2;\n",
    "B=0.2;\n",
    "Tinf=300;\n",
    "#The Temprature of plate(Tw) is maintained at 400K\n",
    "Tw=400;\n",
    "#The required property value of air at a film temprature(Tf)=350K,kinematic viscosity (nu=20.75*10**-6),Prandtl number(Pr=0.69),conductivity(k=0.03W/(m*K))\n",
    "Tf=350;\n",
    "nu=20.75*10**-6;\n",
    "Pr=0.69;\n",
    "k=0.03;\n",
    "#volume expansion coefficient is Beta\n",
    "Beta=(1/Tf);\n",
    "#g is acceleration due to gravity =9.81m/s**2\n",
    "g=9.81;\n",
    "#Grashoff number is given by GrL=(g*beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"Grashoff number is\"\n",
    "GrL=(g*Beta*(Tw-Tinf)*L**3)/(nu)**2 \n",
    "print\"GrL=\",GrL\n",
    "#Rayleigh number is defined as RaL=GrL*Pr\n",
    "print\"Rayleigh number is\"\n",
    "RaL=GrL*Pr\n",
    "print\"Hence,the flow is laminar\"\n",
    "print\"RaL=\",RaL\n",
    "#delta is the thickness of the boundary layer\n",
    "print\"The thickness of the boundary layer in metre is\"\n",
    "x=0.2;#location of trailing edge of plate\n",
    "delta=(x*3.93*(0.952+Pr)**(1/4))/(Pr**(1/2)*(GrL)**(1/4))#NOTE:The answer in the book is incorrect(calculation mistake)\n",
    "print\"delta=\",delta\n",
    "#hL and hbarL are local and average heat transfer coefficient respectively\n",
    "print\"The average heat transfer coeficient in W/(m**2*K) is\"\n",
    "hL=(2*k)/delta;\n",
    "hbarL=(4.0/3)*(hL)#NOTE:The answer in the book is incorrect(calculation mistake)\n",
    "print\"hL=\",hL\n",
    "print\"hbarL=\",hbarL\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.5:pg-373"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 5\n",
      "Grashoff number is\n",
      "503958851.066\n",
      "Rayleigh number is\n",
      "357810784.257\n",
      "Therefore the flow is laminar\n",
      "Nusselt number is\n",
      "75.3134665126\n",
      "Average heat transfer coefficient(hbarL)in W/(m**2*°C)\n",
      "The rate of heat transfer in W is \n",
      "Now if we use NuL2=0.59*RaL**(1/4) with the value of C=0.59,n=(1/4)\n",
      "Nusselt number is\n",
      "Average heat transfer coefficient(hbarL)in W/(m**2*°C)\n",
      "The rate of heat transfer in W is \n",
      "49.9857347505\n",
      "(b)For the horizontal plate facing up\n",
      "Now RaL2=Gr*Pr*(Lc/L)**3\n",
      "Rayleigh number is\n",
      "Nusselt number is given by NuL3=C*(GrL*Pr)**n\n",
      "Average heat transfer coefficient(hbarL)in W/(m**2*°C)\n",
      "The rate of heat transfer in W is \n",
      "64.6997833306\n",
      "(c)When the hot surface faces is down\n",
      "Nusselt number is given by NuL4=0.27*RaL2**(1/4)\n",
      "13.1290144745\n",
      "Average heat transfer coefficient(hbarL) in W/(m**2)\n",
      "2.9408992423\n",
      "The rate of heat transfer in W is \n",
      "32.3498916653\n"
     ]
    }
   ],
   "source": [
    " \n",
    "import math \n",
    " \n",
    "print\"Introduction to heat transfer by S.K.Som, Chapter 8, Example 5\"\n",
    "#A square plate of length(L)=0.5m by breadth,B=0.5m in a room at temprature,Tinf=30°C\n",
    "#One side of plate is kept a uniform temprature(Tw)=74°C\n",
    "Tw=74;\n",
    "L=0.5;\n",
    "B=0.5;\n",
    "Tinf=30.0;\n",
    "#The required properties at the film temprature(Tf)=52°C are kinematic viscosity(nu=1.815*10**-5),Prandtl number(Pr=0.71),conductivity(k=0.028W/(m*°C))\n",
    "Tf=52.0;\n",
    "Pr=0.71;\n",
    "nu=1.815*10**-5;\n",
    "k=0.028;\n",
    "#Area(A)=L*B m**2\n",
    "A=L*B;\n",
    "#Volume expansion coefficient is Beta\n",
    "Beta=1/(273+Tf);\n",
    "#g is acceleration due to gravity =9.81m/s**2\n",
    "g=9.81;\n",
    "#Grashoff number is given by GrL=(g*beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"Grashoff number is\"\n",
    "GrL=(g*Beta*(Tw-Tinf)*L**3)/(nu)**2 \n",
    "print GrL\n",
    "#Rayleigh number is defined as RaL1=GrL*Pr\n",
    "print\"Rayleigh number is\"\n",
    "RaL1=GrL*Pr\n",
    "print RaL1\n",
    "print\"Therefore the flow is laminar\"\n",
    "#We make use of following equation to find Nusselt number,NuL1=(4/3)*(0.508*Pr**(-1/2)*(0.952+Pr)**(-1/4)*Gr**(1/4))\n",
    "print\"Nusselt number is\"\n",
    "NuL1=(4.0/3)*(0.508*Pr**(1.0/2)*(0.952+Pr)**(-1.0/4)*GrL**(1.0/4))\n",
    "#Average heat transfer coefficient(hbarL) is given by (NuL*k)/L\n",
    "print NuL1\n",
    "print\"Average heat transfer coefficient(hbarL)in W/(m**2*°C)\"\n",
    "hbarL=(NuL1*k)/L\n",
    "#The rate of heat transfer(Q) from the plate by free convection is given by Q=hbarL*A*(Tw-Tinf)\n",
    "print\"The rate of heat transfer in W is \"\n",
    "Q=hbarL*A*(Tw-Tinf)\n",
    "print\"Now if we use NuL2=0.59*RaL**(1/4) with the value of C=0.59,n=(1/4)\"\n",
    "print\"Nusselt number is\"\n",
    "NuL2=0.59*RaL1**(1.0/4)\n",
    "#Average heat transfer coefficient(hbarL) is given by (NuL*k)/L\n",
    "print\"Average heat transfer coefficient(hbarL)in W/(m**2*°C)\"\n",
    "hbarL=(NuL2*k)/L\n",
    "#The rate of heat transfer(Q) from the plate by free convection is given by Q=hbarL*A*(Tw-Tinf)\n",
    "print\"The rate of heat transfer in W is \"\n",
    "Q=hbarL*A*(Tw-Tinf)\n",
    "print Q\n",
    "print\"(b)For the horizontal plate facing up\"\n",
    "#Perimeter(P) for a square plate is P=4*L\n",
    "P=4*L;\n",
    "#Characterstic length(Lc)=A/P\n",
    "Lc=A/P\n",
    "print\"Now RaL2=Gr*Pr*(Lc/L)**3\"\n",
    "print\"Rayleigh number is\"\n",
    "RaL2=GrL*Pr*(Lc/L)**3\n",
    "#The values of constants,C=0.54 and n=(1/4)\n",
    "C=0.54;\n",
    "n=(1.0/4);\n",
    "print\"Nusselt number is given by NuL3=C*(GrL*Pr)**n\"\n",
    "NuL3=C*(RaL2)**n\n",
    "print\"Average heat transfer coefficient(hbarL)in W/(m**2*°C)\"\n",
    "hbarL=(NuL3*k)/Lc\n",
    "print\"The rate of heat transfer in W is \"\n",
    "Q=hbarL*A*(Tw-Tinf)\n",
    "print Q\n",
    "print\"(c)When the hot surface faces is down\"\n",
    "print\"Nusselt number is given by NuL4=0.27*RaL2**(1/4)\"\n",
    "NuL4=0.27*RaL2**(1.0/4)\n",
    "print NuL4\n",
    "print\"Average heat transfer coefficient(hbarL) in W/(m**2)\"\n",
    "hbarL=(NuL4*k)/Lc\n",
    "print hbarL\n",
    "print\"The rate of heat transfer in W is \"\n",
    "Q=hbarL*A*(Tw-Tinf)\n",
    "print Q\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.6:pg-375"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 6\n",
      "Grashoff number is\n",
      "GrL= 813719594.384\n",
      "Rayleigh number is\n",
      "RaL= 569603716.069\n",
      "Therefore the flow is laminar\n",
      "Now we use NuL=0.59*RaL**(1/4.0) with the value of constants C=0.59,n=(1/4.0)\n",
      "Nusselt number is\n",
      "NuL= 91.1475952489\n",
      "Average heat transfer coefficient in W/(m**2*K)\n",
      "hbarL1= 5.46885571493\n",
      "Grashoff number GrD=GrL*(D/L)**3\n",
      "GrD= 0.00650975675508\n",
      "The correction factor is\n",
      "F= 39.485281111\n",
      "The correct value of Average heat transfer coefficient(hbarL2)=hbarL1*F in W/(m**2*K) is\n",
      "hbarL2= 215.939305259\n",
      "The ohmic loss in W is \n",
      "q= 3.39196667512\n",
      "The current flowing in the wire in Ampere is\n",
      "I= 7.51882822777\n"
     ]
    }
   ],
   "source": [
    " \n",
    " \n",
    " \n",
    " \n",
    "import math \n",
    " \n",
    "print\"Introduction to heat transfer by S.K.Som, Chapter 8, Example 6\"\n",
    "#A vertical wire of length(L)=0.5m and  Dimeter(D)=0.1mm is maintained at temprature, Tw=400K\n",
    "#The temprature of quicsent air is Tinf=300K\n",
    "#Resistance(R) per  meter length is 0.12ohm\n",
    "R=0.12;\n",
    "Tw=400.0;\n",
    "L=0.5;\n",
    "D=0.1*10**-3;#in metre\n",
    "Tinf=300;\n",
    "#The required properties at the film temprature(Tf)=350K are kinematic viscosity(nu=20.75*10**-6m**2/s),Prandtl number(Pr=0.70),conductivity(k=0.03W/(m*°C))\n",
    "Tf=350.0;\n",
    "Pr=0.70;\n",
    "nu=20.75*10**-6;\n",
    "k=0.03;\n",
    "#Area(A)=L*B m**2\n",
    "A=math.pi*D*L;\n",
    "#Volume expansion Coefficient is Beta\n",
    "Beta=1/(Tf);\n",
    "#g is acceleration due to gravity =9.81m/s**2\n",
    "g=9.81;\n",
    "#Grashoff number is given by GrL=(g*beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"Grashoff number is\"\n",
    "GrL=(g*Beta*(Tw-Tinf)*L**3)/(nu)**2 \n",
    "print\"GrL=\",GrL\n",
    "#Rayleigh number is defined as RaL=GrL*Pr\n",
    "print\"Rayleigh number is\"\n",
    "RaL=GrL*Pr\n",
    "print\"RaL=\",RaL\n",
    "print\"Therefore the flow is laminar\"\n",
    "#NuL is nusselt number\n",
    "#C and n are constants\n",
    "print\"Now we use NuL=0.59*RaL**(1/4.0) with the value of constants C=0.59,n=(1/4.0)\"\n",
    "print\"Nusselt number is\"\n",
    "NuL=0.59*RaL**(1/4.0)\n",
    "print\"NuL=\",NuL\n",
    "#hbarL1 is the Average heat transfer coefficient\n",
    "print\"Average heat transfer coefficient in W/(m**2*K)\"\n",
    "hbarL1=(NuL*k)/L\n",
    "print\"hbarL1=\",hbarL1\n",
    "#Grashoff number GrD=GrL*(D/L)**3\n",
    "print\"Grashoff number GrD=GrL*(D/L)**3\"\n",
    "GrD=GrL*(D/L)**3\n",
    "print\"GrD=\",GrD\n",
    "#The correction factor is given By F=1.3*((L/D)/GrD)**(1/4.0)+1.0\n",
    "print\"The correction factor is\"\n",
    "F=1.3*((L/D)/GrD)**(1/4.0)+1.0\n",
    "print\"F=\",F\n",
    "print\"The correct value of Average heat transfer coefficient(hbarL2)=hbarL1*F in W/(m**2*K) is\"\n",
    "hbarL2=hbarL1*F\n",
    "print\"hbarL2=\",hbarL2\n",
    "#The ohmic power loss is given by energy balance I**2*R=q=hbar2*A*(Tw-Tinf)\n",
    "#q is the ohmic power loss\n",
    "print\"The ohmic loss in W is \"\n",
    "q=hbarL2*A*(Tw-Tinf)\n",
    "print\"q=\",q\n",
    "#The current flowing in the wire I=(q/(R*L)**(1/2.0)\n",
    "print\"The current flowing in the wire in Ampere is\"\n",
    "I=(q/(R*L))**(1/2.0)\n",
    "print\"I=\",I\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.7:pg-378"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 7\n",
      "Grashoff number is\n",
      "GrD= 53311595.6796\n",
      "Rayleigh number is\n",
      "RaD= 37318116.9757\n",
      "The flow is laminar over the entire cylinder\n",
      "we use following equation to find Nusselt number NuD=(0.60+((0.387*RaD**(1/6))/(1+(0.559/Pr**(9/16)))**(8/27)))**2\n",
      "NuD= 0.974169\n",
      "Average heat transfer coefficient in W/(m**2*K)\n",
      "hbar= 0.14612535\n",
      "The heat loss per meter length in W is\n",
      "q= 9.64039284733\n"
     ]
    }
   ],
   "source": [
    " \n",
    "import math \n",
    " \n",
    "print\"Introduction to heat transfer by S.K.Som, Chapter 8, Example 7\"\n",
    "#A long horizontal pressurized hot water of diameter(D)=200mm passes through a room where the air temprature is Tinf=25°C\n",
    "D=.2;\n",
    "Tinf=25;\n",
    "#Length(L)=1m ,since the unit length is considered\n",
    "L=1;\n",
    "#Area(A)=pi*L*D\n",
    "A=math.pi*L*D;\n",
    "#The pipe surface temprature is Tw=130°C\n",
    "Tw=130;\n",
    "#The properties of air at the film temprature Tf=77.5°C are kinematic viscosity(nu=21*10**-6m**2/s),Prandtl number(Pr=0.70),Conductivity(k=0.03W/(m*K))\n",
    "Tf=77.5;\n",
    "nu=21*10**-6;\n",
    "k=0.03;\n",
    "Beta=(1/(273+Tf));#Volume expansion coefficient in k**-1)\n",
    "Pr=0.70;\n",
    "#g is acceleration due to gravity =9.81m/s**2\n",
    "g=9.81;\n",
    "#Grashoff number is given by GrD=(g*beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"Grashoff number is\"\n",
    "GrD=(g*Beta*(Tw-Tinf)*D**3)/(nu)**2 \n",
    "print\"GrD=\",GrD\n",
    "#Rayleigh number is defined as RaD=GrD*Pr\n",
    "print\"Rayleigh number is\"\n",
    "RaD=GrD*Pr\n",
    "print\"RaD=\",RaD\n",
    "print\"The flow is laminar over the entire cylinder\"\n",
    "#NuD is the nusselt number\n",
    "print\"we use following equation to find Nusselt number NuD=(0.60+((0.387*RaD**(1/6))/(1+(0.559/Pr**(9/16)))**(8/27)))**2\"\n",
    "NuD=(0.60+((0.387*RaD**(1/6))/(1+(0.559/Pr**(9/16)))**(8/27)))**2\n",
    "print\"NuD=\",NuD\n",
    "#hbar is the avearge heat transfer coefficient\n",
    "print\"Average heat transfer coefficient in W/(m**2*K)\"\n",
    "hbar=(NuD*k)/D\n",
    "print\"hbar=\",hbar\n",
    "#The heat loss per meter length is given by q=hbar*A*(Tw-Tinf)\n",
    "print\"The heat loss per meter length in W is\"\n",
    "q=hbar*A*(Tw-Tinf)\n",
    "print\"q=\",q\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex8.8:pg-381"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Introduction to heat transfer by S.K.Som, Chapter 8, Example 8\n",
      "Let us take first trial Tw=64°C\n",
      "Grashoff number is\n",
      "GrD= 226303.67232\n",
      "Rayleigh number is\n",
      "The flow is laminar \n",
      "RaD= 941423.276851\n",
      "we use following equation to find Nusselt number NuD=(0.60+((0.387*RaD**(1/6))/(1+(0.559/Pr**(9/16)))**(8/27)))**2\n",
      "NuD= 0.974169\n",
      "Average heat transfer coefficient in W/(m**2*K)\n",
      "hbarD= 77.20289325\n",
      "Hence,steady state Surface temprature in °C is\n",
      "Hence we see that our guess is in excellent agreement with the calculated value\n",
      "Tw= 793.068225127\n"
     ]
    }
   ],
   "source": [
    " \n",
    "import math \n",
    " \n",
    "print\"Introduction to heat transfer by S.K.Som, Chapter 8, Example 8\"\n",
    "#An electric immersion heater diameter(D)=8mm and length(L)=300mm is rated at power input,P=450W\n",
    "P=450;\n",
    "L=0.3;#in metre\n",
    "D=0.008;#in metre\n",
    "#If the heater is horizontally positioned in a large tank of stationery water at temprature,Tinf=20°C\n",
    "Tinf=20;\n",
    "#At steady state ,The electrical power input(P)=(Q)Heat loss from the heater\n",
    "#P=Q\n",
    "#Q=hbarD*(pi*D)*L*(Tw-Tinf)\n",
    "#This gives Tw(surface temprature)=Tinf+(P/(hbarD*pi*D*L))\n",
    "#So we need to find Average heat transfer coefficient,hbarD.\n",
    "#In this problem we need to take guess of steady state surface temprature(Tw) and iterate the solution for Tw till a desired convergence is achieved.\n",
    "print\"Let us take first trial Tw=64°C\"\n",
    "Tw=64;\n",
    "Tf=(Tw+Tinf)/2;#mean film temprature\n",
    "#At this temprature of 42°C,The required properties of water kinematic viscosity(nu=6.25*10**-7m**2/s),Prandtl number(Pr=4.16),Conductivity(k=0.634W/(m*K)),Beta=4*10**-4K**-1\n",
    "Beta=4*10**-4;#Volume expansion coefficient\n",
    "nu=6.25*10**-7;\n",
    "Pr=4.16;\n",
    "k=0.634;\n",
    "#g is acceleration due to gravity =9.81m/s**2\n",
    "g=9.81;\n",
    "#Grashoff number is given by GrD=(g*beta*(Tw-Tinf)*L**3)/(nu)**2\n",
    "print\"Grashoff number is\"\n",
    "GrD=(g*Beta*(Tw-Tinf)*D**3)/(nu)**2 \n",
    "print\"GrD=\",GrD\n",
    "#Rayleigh number is defined as RaD=GrD*Pr\n",
    "print\"Rayleigh number is\"\n",
    "RaD=GrD*Pr\n",
    "print\"The flow is laminar \"\n",
    "print\"RaD=\",RaD\n",
    "#/NuD is nusselt number\n",
    "#hbarD is Average heat transfer coefficient\n",
    "print\"we use following equation to find Nusselt number NuD=(0.60+((0.387*RaD**(1/6))/(1+(0.559/Pr**(9/16)))**(8/27)))**2\"\n",
    "NuD=(0.60+((0.387*RaD**(1/6))/(1+(0.559/Pr**(9/16)))**(8/27)))**2\n",
    "print\"NuD=\",NuD\n",
    "print\"Average heat transfer coefficient in W/(m**2*K)\"\n",
    "hbarD=(NuD*k)/D\n",
    "print\"hbarD=\",hbarD\n",
    "print\"Hence,steady state Surface temprature in °C is\"\n",
    "Tw=Tinf+(P/(hbarD*math.pi*D*L))\n",
    "print\"Hence we see that our guess is in excellent agreement with the calculated value\"\n",
    "print\"Tw=\",Tw\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  }
 ],
 "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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}