summaryrefslogtreecommitdiff
path: root/Engineering_Thermodynamics_by__O._Singh/chapter12_3.ipynb
blob: f89e1b1a2b84e4cccc3c479be21647144370f053 (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 12:Introduction to Heat Transfer"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.1;pg no: 483"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.1, Page:483  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 1\n",
      "here for one dimentional heat transfer across the wall the heat transfer circuit shall comprises of thermal resistance due to convection between air & brick(R1),conduction in brick wall(R2),conduction in wood(R3),and convection between wood and air(R4).Let temperature at outer brick wall be T2 K,brick-wood interface be T3 K,outer wood wall be T4 K\n",
      "overall heat transfer coefficient for steady state heat transfer(U)in W/m^2 K\n",
      "(1/U)=(1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5)\n",
      "so U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))\n",
      "rate of heat transfer,Q in W= 10590.0\n",
      "so rate of heat transfer=10590 W\n",
      "heat transfer across states 1 and 3(at interface).\n",
      "overall heat transfer coefficient between 1 and 3\n",
      "(1/U1)=(1/h1)+(deltax_brick/k_brick)\n",
      "so U1=1/((1/h1)+(deltax_brick/k_brick))in W/m^2 K\n",
      "Q=U1*A*(T1-T3)\n",
      "so T3=T1-(Q/(U1*A))in degree celcius 44.7\n",
      "so temperature at interface of brick and wood =44.71 degree celcius\n"
     ]
    }
   ],
   "source": [
    "#cal of rate of heat transfer and temperature at interface of brick and wood\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.1, Page:483  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 1\")\n",
    "h1=30.;#heat transfer coefficient on side of 50 oc in W/m^2 K\n",
    "h5=10.;#heat transfer coefficient on side of 20 oc in W/m^2 K\n",
    "k_brick=0.9;#conductivity of brick in W/m K\n",
    "k_wood=0.15;#conductivity of wood in W/m K\n",
    "T1=50.;#temperature of air on one side of wall in degree celcius\n",
    "T5=20.;#temperature of air on other side of wall in degree celcius\n",
    "A=100.;#surface area in m^2\n",
    "deltax_brick=1.5*10**-2;#length of brick in m\n",
    "deltax_wood=2*10**-2;#length of wood in m\n",
    "print(\"here for one dimentional heat transfer across the wall the heat transfer circuit shall comprises of thermal resistance due to convection between air & brick(R1),conduction in brick wall(R2),conduction in wood(R3),and convection between wood and air(R4).Let temperature at outer brick wall be T2 K,brick-wood interface be T3 K,outer wood wall be T4 K\")\n",
    "print(\"overall heat transfer coefficient for steady state heat transfer(U)in W/m^2 K\")\n",
    "print(\"(1/U)=(1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5)\")\n",
    "print(\"so U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))\")\n",
    "U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))\n",
    "U=3.53;#approx.\n",
    "Q=U*A*(T1-T5)\n",
    "print(\"rate of heat transfer,Q in W=\"),round(Q,2)\n",
    "print(\"so rate of heat transfer=10590 W\")\n",
    "print(\"heat transfer across states 1 and 3(at interface).\")\n",
    "print(\"overall heat transfer coefficient between 1 and 3\")\n",
    "print(\"(1/U1)=(1/h1)+(deltax_brick/k_brick)\")\n",
    "print(\"so U1=1/((1/h1)+(deltax_brick/k_brick))in W/m^2 K\")\n",
    "U1=1/((1/h1)+(deltax_brick/k_brick))\n",
    "print(\"Q=U1*A*(T1-T3)\")\n",
    "T3=T1-(Q/(U1*A))\n",
    "print(\"so T3=T1-(Q/(U1*A))in degree celcius\"),round(T3,2)\n",
    "print(\"so temperature at interface of brick and wood =44.71 degree celcius\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.2;pg no: 484"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.2, Page:484  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 2\n",
      "here thermal resistances are\n",
      "R1=thermal resistance due to convection between kitchen air and outer surface of refrigerator wall(T1 & T2)\n",
      "R2=thermal resistance due to conduction across mild steel wall between 2 & 3(T2 & T3)\n",
      "R3=thermal resistance due to conduction across glass wool between 3 & 4(T3 & T4)\n",
      "R4=thermal resistance due to conduction across mild steel wall between 4 & 5(T4 & T5)\n",
      "R5=thermal resistance due to convection between inside refrigerator wall and inside of refrigerator between 5 & 6(T5 & T6)\n",
      "overall heat transfer coefficient for one dimentional steady state heat transfer\n",
      "(1/U)=(1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6)\n",
      "so U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))in KJ/m^2hr oc\n",
      "rate of heat transfer(Q) in KJ/m^2 hr= 112.0\n",
      "wall surface area(A) in m^2\n",
      "so rate of heat transfer=112 KJ/m^2 hr \n",
      "Q=A*h1*(T1-T2)=k_steel*A*(T2-T3)/deltax_steel=k_wool*A*(T3-T4)/deltax_wool\n",
      "Q=k_steel*A*(T4-T5)/deltax_steel=A*h6*(T5-T6)\n",
      "substituting,T2 in degree celcius= 23.6\n",
      "so temperature of outer wall,T2=23.6 oc\n",
      "T3 in degree=  23.6\n",
      "so temperature at interface of outer steel wall and wool,T3=23.59 oc\n",
      "T4 in degree celcius= 6.1\n",
      "so temperature at interface of wool and inside steel wall,T4=6.09 oc\n",
      "T5 in degree celcius= 6.1\n",
      "so temperature at inside of inner steel wall,T5=6.08 oc\n"
     ]
    }
   ],
   "source": [
    "#cal of rate of heat transfer,temperatures\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.2, Page:484  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 2\")\n",
    "h1=40;#average heat transfer coefficient at inner surface in KJ/m^2 hr oc\n",
    "h6=50;#average heat transfer coefficient at outer surface in KJ/m^2 hr oc\n",
    "deltax_steel=2*10**-3;#mild steel sheets thickness in m\n",
    "deltax_wool=5*10**-2;#thickness of glass wool insulation in m\n",
    "k_wool=0.16;#thermal conductivity of wool in KJ/m hr\n",
    "k_steel=160;#thermal conductivity of steel in KJ/m hr\n",
    "T1=25;#kitchen temperature in degree celcius\n",
    "T6=5;#refrigerator temperature in degree celcius\n",
    "print(\"here thermal resistances are\")\n",
    "print(\"R1=thermal resistance due to convection between kitchen air and outer surface of refrigerator wall(T1 & T2)\")\n",
    "print(\"R2=thermal resistance due to conduction across mild steel wall between 2 & 3(T2 & T3)\")\n",
    "print(\"R3=thermal resistance due to conduction across glass wool between 3 & 4(T3 & T4)\")\n",
    "print(\"R4=thermal resistance due to conduction across mild steel wall between 4 & 5(T4 & T5)\")\n",
    "print(\"R5=thermal resistance due to convection between inside refrigerator wall and inside of refrigerator between 5 & 6(T5 & T6)\")\n",
    "print(\"overall heat transfer coefficient for one dimentional steady state heat transfer\")\n",
    "print(\"(1/U)=(1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6)\")\n",
    "print(\"so U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))in KJ/m^2hr oc\")\n",
    "U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))\n",
    "U=2.8;#approx.\n",
    "A=4*(1*0.5)\n",
    "Q=U*A*(T1-T6)\n",
    "print(\"rate of heat transfer(Q) in KJ/m^2 hr=\"),round(Q,2)\n",
    "print(\"wall surface area(A) in m^2\")\n",
    "print(\"so rate of heat transfer=112 KJ/m^2 hr \")\n",
    "print(\"Q=A*h1*(T1-T2)=k_steel*A*(T2-T3)/deltax_steel=k_wool*A*(T3-T4)/deltax_wool\")\n",
    "print(\"Q=k_steel*A*(T4-T5)/deltax_steel=A*h6*(T5-T6)\")\n",
    "T2=T1-(Q/(A*h1))\n",
    "print(\"substituting,T2 in degree celcius=\"),round(T2,1)\n",
    "print(\"so temperature of outer wall,T2=23.6 oc\")\n",
    "T3=T2-(Q*deltax_steel/(k_steel*A))\n",
    "print(\"T3 in degree= \"),round(T3,2)\n",
    "print(\"so temperature at interface of outer steel wall and wool,T3=23.59 oc\")\n",
    "T4=T3-(Q*deltax_wool/(k_wool*A))\n",
    "print(\"T4 in degree celcius=\"),round(T4,2)\n",
    "print(\"so temperature at interface of wool and inside steel wall,T4=6.09 oc\")\n",
    "T5=T4-(Q*deltax_steel/(k_steel*A))\n",
    "print(\"T5 in degree celcius=\"),round(T5,2)\n",
    "print(\"so temperature at inside of inner steel wall,T5=6.08 oc\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.3;pg no: 486"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.3, Page:486  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 3\n",
      "here,heat conduction is considered in pipe wall from 1 to 2 and conduction through insulation between 2 and 3 of one dimentional steady state type.\n",
      "Q=(T1-T3)*2*%pi*L/((1/k_pipe)*log(r2/r1)+(1/k_insulation*log(r3/r2)))in KJ/hr\n",
      "so heat loss per meter from pipe in KJ/hr= 1479.77\n",
      "heat loss from  5 m length(Q) in KJ/hr 7396.7\n",
      "enthalpy of saturated steam at 300 oc,h_sat=2749 KJ/kg=hg from steam table\n",
      "mass flow of steam(m)in kg/hr\n",
      "final enthalpy of steam per kg at exit of 5 m pipe(h)in KJ/kg\n",
      "let quality of steam at exit be x,\n",
      "also at 300oc,hf=1344 KJ/kg,hfg=1404.9 KJ/kg from steam table\n",
      "h=hf+x*hfg\n",
      "so x=(h-hf)/hfg 0.8245\n",
      "so quality of steam at exit=0.8245\n"
     ]
    }
   ],
   "source": [
    "#cal of heat loss per meter from pipe and quality of steam\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.3, Page:486  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 3\")\n",
    "k_insulation=0.3;#thermal conductivity of insulation in KJ/m hr oc\n",
    "k_pipe=209;#thermal conductivity of pipe in KJ/m hr oc\n",
    "T1=300;#temperature of inner surface of steam pipe in degree celcius\n",
    "T3=50;#temperature of outer surface of insulation layer in degree celcius\n",
    "r1=15*10**-2/2;#steam pipe inner radius without insulation in m\n",
    "r2=16*10**-2/2;#steam pipe outer radius without insulation in m\n",
    "r3=22*10**-2/2;#radius with insulation in m\n",
    "m=0.5;#steam entering rate in kg/min\n",
    "print(\"here,heat conduction is considered in pipe wall from 1 to 2 and conduction through insulation between 2 and 3 of one dimentional steady state type.\")\n",
    "print(\"Q=(T1-T3)*2*%pi*L/((1/k_pipe)*log(r2/r1)+(1/k_insulation*log(r3/r2)))in KJ/hr\")\n",
    "L=1;\n",
    "Q=(T1-T3)*2*math.pi*L/((1/k_pipe)*math.log(r2/r1)+(1/k_insulation*math.log(r3/r2)))\n",
    "print(\"so heat loss per meter from pipe in KJ/hr=\"),round(Q,2)\n",
    "Q=5*Q\n",
    "print(\"heat loss from  5 m length(Q) in KJ/hr\"),round(5*1479.34,2)\n",
    "print(\"enthalpy of saturated steam at 300 oc,h_sat=2749 KJ/kg=hg from steam table\")\n",
    "hg=2749;\n",
    "print(\"mass flow of steam(m)in kg/hr\")\n",
    "m=m*60\n",
    "print(\"final enthalpy of steam per kg at exit of 5 m pipe(h)in KJ/kg\")\n",
    "h=hg-(Q/m)\n",
    "print(\"let quality of steam at exit be x,\")\n",
    "print(\"also at 300oc,hf=1344 KJ/kg,hfg=1404.9 KJ/kg from steam table\")\n",
    "hf=1344;\n",
    "hfg=1404.9;\n",
    "print(\"h=hf+x*hfg\")\n",
    "x=(h-hf)/hfg\n",
    "print(\"so x=(h-hf)/hfg\"),round(x,4)\n",
    "print(\"so quality of steam at exit=0.8245\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.4;pg no: 487"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.4, Page:487  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 4\n",
      "considering one dimensional heat transfer of steady state type\n",
      "for sphere(Q)=(T1-T2)*4*%pi*k*r1*r2/(r2-r1) in KJ/hr 168892.02\n",
      "so heat transfer rate=168892.02 KJ/hr\n",
      "heat flux in KJ/m^2 hr= 23893.33\n",
      "so heat flux=23893.33 KJ/m^2 hr\n"
     ]
    }
   ],
   "source": [
    "#cal of amount of heat transfer and heat flux\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.4, Page:487  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 4\")\n",
    "r1=150.*10**-2/2;#inner radius in m\n",
    "r2=200.*10**-2/2;#outer radius in m\n",
    "k=28.;#thermal conductivity in KJ m hr oc\n",
    "T1=200.;#inside surface temperature in degree celcius\n",
    "T2=40.;#outer surface temperature in degree celcius\n",
    "print(\"considering one dimensional heat transfer of steady state type\")\n",
    "Q=(T1-T2)*4*math.pi*k*r1*r2/(r2-r1)\n",
    "print(\"for sphere(Q)=(T1-T2)*4*%pi*k*r1*r2/(r2-r1) in KJ/hr\"),round(Q,2)\n",
    "print(\"so heat transfer rate=168892.02 KJ/hr\")\n",
    "Q/(4*math.pi*r1**2)\n",
    "print(\"heat flux in KJ/m^2 hr=\"),round(Q/(4*math.pi*r1**2),2)\n",
    "print(\"so heat flux=23893.33 KJ/m^2 hr\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.5;pg no: 487"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.5, Page:487  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 5\n",
      "R1=thermal resistance for convection heat transfer between inside room (1)and inside surface of glass window(2)=1/(h1*A)\n",
      "R2=thermal resistance for conduction through glass between inside of glass window(2)to outside surface of glass window(3)=deltax/(k*A)\n",
      "R3=thermal resistance for convection heat transfer between outside surface of glass window(3)to outside atmosphere(4)=1/(h4*A)\n",
      "total thermal resistance,R_total=R1+R2+R3 in oc/W\n",
      "so rate of heat transfer,Q=(T1-T4)/R_total in W 118.03\n",
      "heat transfer rate from inside of room to inside surface of glass window.\n",
      "Q=(T1-T2)/R1\n",
      "so T2=T1-Q*R1 in degree celcius 9.26\n",
      "Thus,inside surface of glass window will be at temperature of 9.26 oc where as room inside temperature is 25 oc\n"
     ]
    }
   ],
   "source": [
    "#cal of heat transfer rate\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.5, Page:487  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 5\")\n",
    "T1=25.;#room temperature in degree celcius\n",
    "T4=2.;#winter outside temperature in degree celcius\n",
    "h1=10.;#heat transfer coefficient on inner window surfaces in W/m^2 oc\n",
    "h4=30.;#heat transfer coefficient on outer window surfaces in W/m^2 oc\n",
    "k=0.78;#thermal conductivity of glass in W/m^2 oc\n",
    "A=75.*10**-2*100.*10**-2;#area in m^2\n",
    "deltax=10.*10**-3;#glass thickness in m\n",
    "print(\"R1=thermal resistance for convection heat transfer between inside room (1)and inside surface of glass window(2)=1/(h1*A)\")\n",
    "print(\"R2=thermal resistance for conduction through glass between inside of glass window(2)to outside surface of glass window(3)=deltax/(k*A)\")\n",
    "print(\"R3=thermal resistance for convection heat transfer between outside surface of glass window(3)to outside atmosphere(4)=1/(h4*A)\")\n",
    "print(\"total thermal resistance,R_total=R1+R2+R3 in oc/W\")\n",
    "R_total=1/(h1*A)+deltax/(k*A)+1/(h4*A)\n",
    "Q=(T1-T4)/R_total\n",
    "print(\"so rate of heat transfer,Q=(T1-T4)/R_total in W\"),round(Q,2)\n",
    "print(\"heat transfer rate from inside of room to inside surface of glass window.\")\n",
    "R1=(1/7.5);\n",
    "T2=T1-Q*R1\n",
    "print(\"Q=(T1-T2)/R1\")\n",
    "print(\"so T2=T1-Q*R1 in degree celcius\"),round(T2,2)\n",
    "print(\"Thus,inside surface of glass window will be at temperature of 9.26 oc where as room inside temperature is 25 oc\") \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.6;pg no: 488"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.6, Page:488  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 6\n",
      "reynolds number,Re=V*D/v\n",
      "subsituting in Nu=0.023*(Re)^0.8*(Pr)^0.4\n",
      "or (h*D/k)=0.023*(Re)^0.8*(Pr)^0.4\n",
      "so h=(k/D)*0.023*(Re)^0.8*(Pr)^0.4 in W/m^2 K\n",
      "rate of heat transfer due to convection,Q in W \n",
      "Q=h*A*(T2-T1)= 61259.36\n",
      "so heat transfer rate=61259.38 W\n"
     ]
    }
   ],
   "source": [
    "#cal of heat transfer rate\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.6, Page:488  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 6\")\n",
    "D=4*10**-2;#inner diameter in m\n",
    "L=3;#length in m\n",
    "V=1;#velocity of water in m/s\n",
    "T1=40;#mean temperature in degree celcius\n",
    "T2=75;#pipe wall temperature in degree celcius \n",
    "k=0.6;#conductivity of water in W/m\n",
    "Pr=3;#prandtl no.\n",
    "v=0.478*10**-6;#viscocity in m^2/s\n",
    "print(\"reynolds number,Re=V*D/v\")\n",
    "Re=V*D/v\n",
    "print(\"subsituting in Nu=0.023*(Re)^0.8*(Pr)^0.4\")\n",
    "print(\"or (h*D/k)=0.023*(Re)^0.8*(Pr)^0.4\")\n",
    "print(\"so h=(k/D)*0.023*(Re)^0.8*(Pr)^0.4 in W/m^2 K\")\n",
    "h=(k/D)*0.023*(Re)**0.8*(Pr)**0.4 \n",
    "print(\"rate of heat transfer due to convection,Q in W \") \n",
    "Q=h*(math.pi*D*L)*(T2-T1)\n",
    "print(\"Q=h*A*(T2-T1)=\"),round(Q,2)\n",
    "print(\"so heat transfer rate=61259.38 W\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.7;pg no: 489"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.7, Page:489  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 7\n",
      "Let the temperature of water at exit be T\n",
      "Heat exchanger,Q=heat rejected by glasses=heat gained by water\n",
      "Q=m*Cg*(T1-T2)=mw*Cw*(T-T3)\n",
      "so T=T3+(m*Cg*(T1-T2)/(mw*Cw))in degree celcius\n",
      "and Q in KJ\n",
      "deltaT_in=T1-T3 in degree celcius\n",
      "deltaT_out=T2-T in degree celcius\n",
      "for parallel flow heat exchanger,\n",
      "LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree celcius\n",
      "also,Q=U*A*LMTD\n",
      "so A=Q/(U*LMTD) in m^2 5.937\n",
      "surface area,A=5.936 m^2\n"
     ]
    }
   ],
   "source": [
    "#cal of surface area\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.7, Page:489  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 7\")\n",
    "m=0.5;#hot gases flowing rate in kg/s\n",
    "T1=500;#initial temperature of gas in degree celcius\n",
    "T2=150;#final temperature of gas in degree celcius\n",
    "Cg=1.2;#specific heat of gas in KJ/kg K\n",
    "Cw=4.18;#specific heat of water in KJ/kg K\n",
    "U=150;#overall heat transfer coefficient in W/m^2 K\n",
    "mw=1;#mass of water in kg/s\n",
    "T3=10;#water entering temperature in degree celcius\n",
    "print(\"Let the temperature of water at exit be T\")\n",
    "print(\"Heat exchanger,Q=heat rejected by glasses=heat gained by water\")\n",
    "print(\"Q=m*Cg*(T1-T2)=mw*Cw*(T-T3)\")\n",
    "print(\"so T=T3+(m*Cg*(T1-T2)/(mw*Cw))in degree celcius\")\n",
    "T=T3+(m*Cg*(T1-T2)/(mw*Cw))\n",
    "print(\"and Q in KJ\")\n",
    "Q=m*Cg*(T1-T2)\n",
    "print(\"deltaT_in=T1-T3 in degree celcius\")\n",
    "deltaT_in=T1-T3\n",
    "print(\"deltaT_out=T2-T in degree celcius\")\n",
    "deltaT_out=T2-T\n",
    "print(\"for parallel flow heat exchanger,\")\n",
    "print(\"LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree celcius\")\n",
    "LMTD=(deltaT_in-deltaT_out)/math.log(deltaT_in/deltaT_out)\n",
    "print(\"also,Q=U*A*LMTD\")\n",
    "A=Q*10**3/(U*LMTD)\n",
    "print(\"so A=Q/(U*LMTD) in m^2\"),round(A,3)\n",
    "print(\"surface area,A=5.936 m^2\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.8;pg no: 490"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.8, Page:490  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 8\n",
      "This oil cooler has arrangement similar to a counter flow heat exchanger.\n",
      "by heat exchanger,Q=U*A*LMTD=mc*Cpc*(Tc_out-Th_in)=mh*Cph*(Tc_in-Th_out)\n",
      "so Q in KJ/min\n",
      "and T=Th_out+(Q/(mh*Cph))in degree celcius\n",
      "LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree \n",
      "here deltaT_in=Tc_out-T in degree celcius\n",
      "deltaT_out=Th_in-Th_out in degree celcius\n",
      "so LMTD in degree celcius\n",
      "substituting in,Q=U*A*LMTD\n",
      "A=(Q*10^3/60)/(U*LMTD)in m^2 132.81\n",
      "so surface area=132.85 m^2\n"
     ]
    }
   ],
   "source": [
    "#cal of surface area\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.8, Page:490  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 8\")\n",
    "mc=20;#mass of oil in kg/min \n",
    "Tc_out=100;#initial temperature of oil in degree celcius\n",
    "Th_in=30;#final temperature of oil in degree celcius\n",
    "Th_out=25;#temperature of water in degree celcius\n",
    "Cpc=2;#specific heat of oil in KJ/kg K\n",
    "Cph=4.18;#specific heat of water in KJ/kg K\n",
    "mh=15;#water flow rate in kg/min\n",
    "U=25;#overall heat transfer coefficient in W/m^2 K\n",
    "print(\"This oil cooler has arrangement similar to a counter flow heat exchanger.\")\n",
    "print(\"by heat exchanger,Q=U*A*LMTD=mc*Cpc*(Tc_out-Th_in)=mh*Cph*(Tc_in-Th_out)\")\n",
    "print(\"so Q in KJ/min\")\n",
    "Q=mc*Cpc*(Tc_out-Th_in)\n",
    "print(\"and T=Th_out+(Q/(mh*Cph))in degree celcius\")\n",
    "T=Th_out+(Q/(mh*Cph))\n",
    "print(\"LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree \")\n",
    "print(\"here deltaT_in=Tc_out-T in degree celcius\")\n",
    "deltaT_in=Tc_out-T\n",
    "print(\"deltaT_out=Th_in-Th_out in degree celcius\")\n",
    "deltaT_out=Th_in-Th_out\n",
    "print(\"so LMTD in degree celcius\")\n",
    "LMTD=(deltaT_in-deltaT_out)/math.log(deltaT_in/deltaT_out)\n",
    "print(\"substituting in,Q=U*A*LMTD\")\n",
    "A=(Q*10**3/60)/(U*LMTD)\n",
    "print(\"A=(Q*10^3/60)/(U*LMTD)in m^2\"),round(A,2)\n",
    "print(\"so surface area=132.85 m^2\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.9;pg no: 490"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.9, Page:490  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 9\n",
      "rate of heat loss by radiation(Q)=wpsilon*sigma*A*(T1^4-T2^4)\n",
      "heat loss per unit area by radiation(Q)in W\n",
      "Q= 93597.71\n"
     ]
    }
   ],
   "source": [
    "#cal of heat loss per unit area by radiation\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.9, Page:490  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 9\")\n",
    "T1=(1200+273);#temperature of body in K\n",
    "T2=(600+273);#temperature of black surrounding in K\n",
    "epsilon=0.4;#emissivity of body at 1200 degree celcius\n",
    "sigma=5.67*10**-8;#stephen boltzman constant in W/m^2 K^4\n",
    "print(\"rate of heat loss by radiation(Q)=wpsilon*sigma*A*(T1^4-T2^4)\")\n",
    "print(\"heat loss per unit area by radiation(Q)in W\")\n",
    "Q=epsilon*sigma*(T1**4-T2**4)\n",
    "print(\"Q=\"),round(Q,2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.10;pg no: 491"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.10, Page:491  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 10\n",
      "Let us carry out one dimentional analysis for steady state.Due to flow of electricity the heat generated can be given as:\n",
      "Q=V*I in W\n",
      "For steady state which means there should be no change in temperature of cable due to electricity flow,the heat generated should be transferred out to surroundings.Therefore,heat transfer across table should be 80 W\n",
      "surface area for heat transfer,A2=2*%pi*r*L in m^2\n",
      "R1=thermal resistance due to convection between surroundings and cable outer surface,(1-2)=1/(h1*A2)\n",
      "R2=thermal resistance due to conduction across plastic insulation(2-3)=log(r2/r3)/(2*%pi*k*L)\n",
      "Total resistance,R_total=R1+R2 in oc/W\n",
      "Q=(T3-T1)/R_total\n",
      "so T3 in degree celcius= 98.28\n",
      "so temperature at interface=125.12 degree celcius\n",
      "critical radius of insulation,rc in m= 0.01\n",
      "rc in mm 10.67\n",
      "This rc is more than outer radius of cable so the increase in thickness of insulation upon rc=110.66 mmwould increase rate of heat transfer.Doubling insulation thickness means new outer radius would be r1=1.5+5=6.5 mm.Hence doubling(increase) of insulation thickness would increase heat transfer and thus temperature at interface would decrease if other parameters reamins constant.\n",
      "NOTE=>In this question value of R_total is calculated wrong in book,hence it is correctly solve above,so the values of R_total and T3 may vary.\n"
     ]
    }
   ],
   "source": [
    "#cal of temperature at interface\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.10, Page:491  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 10\")\n",
    "V=16.;#voltage drop in V\n",
    "I=5.;#current in cable in A\n",
    "r2=8.*10.**-3/2.;#outer cable radius in m\n",
    "r3=3.*10.**-3/2.;#copper wire radius in m\n",
    "k=0.16;#thermal conductivity of copper wire in W/m oc\n",
    "L=5.;#length of cable in m\n",
    "h1=15.;#heat transfer coefficient of cable in W/m^2 oc\n",
    "T1=40.;#temperature of surrounding in degree celcius\n",
    "print(\"Let us carry out one dimentional analysis for steady state.Due to flow of electricity the heat generated can be given as:\")\n",
    "print(\"Q=V*I in W\")\n",
    "Q=V*I\n",
    "print(\"For steady state which means there should be no change in temperature of cable due to electricity flow,the heat generated should be transferred out to surroundings.Therefore,heat transfer across table should be 80 W\")\n",
    "print(\"surface area for heat transfer,A2=2*%pi*r*L in m^2\")\n",
    "A2=2.*math.pi*r2*L\n",
    "A2=0.125;#approx.\n",
    "print(\"R1=thermal resistance due to convection between surroundings and cable outer surface,(1-2)=1/(h1*A2)\")\n",
    "print(\"R2=thermal resistance due to conduction across plastic insulation(2-3)=log(r2/r3)/(2*%pi*k*L)\")\n",
    "print(\"Total resistance,R_total=R1+R2 in oc/W\")\n",
    "R_total=(1/(h1*A2))+(math.log(r2/r3)/(2.*math.pi*k*L))\n",
    "print(\"Q=(T3-T1)/R_total\")\n",
    "T3=T1+Q*R_total\n",
    "print(\"so T3 in degree celcius=\"),round(T3,2)\n",
    "print(\"so temperature at interface=125.12 degree celcius\")\n",
    "rc=k/h1\n",
    "print(\"critical radius of insulation,rc in m=\"),round(rc,2)\n",
    "print(\"rc in mm\"),round(rc*1000,2)\n",
    "print(\"This rc is more than outer radius of cable so the increase in thickness of insulation upon rc=110.66 mmwould increase rate of heat transfer.Doubling insulation thickness means new outer radius would be r1=1.5+5=6.5 mm.Hence doubling(increase) of insulation thickness would increase heat transfer and thus temperature at interface would decrease if other parameters reamins constant.\")\n",
    "print(\"NOTE=>In this question value of R_total is calculated wrong in book,hence it is correctly solve above,so the values of R_total and T3 may vary.\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.11;pg no: 492"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.11, Page:492  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 11\n",
      "for maximum heat transfer the critical radius of insulation should be used.\n",
      "critical radius of insulation(rc)=k/h in mm\n",
      "economical thickness of insulation(t)=rc-r_wire in mm\n",
      "so economical thickness of insulation=7 mm\n",
      "heat convected from cable surface to environment,Q in W\n",
      "Q= 35.2\n",
      "so heat transferred per unit length=35.2 W\n"
     ]
    }
   ],
   "source": [
    "#cal of heat transferred per unit length\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.11, Page:492  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 11\")\n",
    "r_wire=3;#radius of electric wire in mm\n",
    "k=0.16;#thermal conductivity in W/m oc\n",
    "T_surrounding=45;#temperature of surrounding in degree celcius\n",
    "T_surface=80;#temperature of surface in degree celcius\n",
    "h=16;#heat transfer cooefficient in W/m^2 oc\n",
    "print(\"for maximum heat transfer the critical radius of insulation should be used.\")\n",
    "print(\"critical radius of insulation(rc)=k/h in mm\")\n",
    "rc=k*1000/h\n",
    "print(\"economical thickness of insulation(t)=rc-r_wire in mm\")\n",
    "t=rc-r_wire\n",
    "print(\"so economical thickness of insulation=7 mm\")\n",
    "print(\"heat convected from cable surface to environment,Q in W\")\n",
    "L=1;#length in mm\n",
    "Q=2*math.pi*rc*L*h*(T_surface-T_surrounding)*10**-3\n",
    "print(\"Q=\"),round(Q,1)\n",
    "print(\"so heat transferred per unit length=35.2 W\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##example 12.12;pg no: 492"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.12, Page:492  \n",
      " \n",
      "\n",
      "Engineering Thermodynamics by Onkar Singh Chapter 12 Example 12\n",
      "heat transfer through concentric sphere,Q in KJ/hr \n",
      "Q= -6297.1\n",
      "so heat exchange=6297.1 KJ/hr\n"
     ]
    }
   ],
   "source": [
    "#cal of heat exchange\n",
    "#intiation of all variables\n",
    "# Chapter 12\n",
    "import math\n",
    "print\"Example 12.12, Page:492  \\n \\n\"\n",
    "print(\"Engineering Thermodynamics by Onkar Singh Chapter 12 Example 12\")\n",
    "T1=(-150+273);#temperature of air inside in K\n",
    "T2=(35+273);#temperature of outer surface in K\n",
    "epsilon1=0.03;#emissivity\n",
    "epsilon2=epsilon1;\n",
    "D1=25*10**-2;#diameter of inner sphere in m\n",
    "D2=30*10**-2;#diameter of outer sphere in m\n",
    "sigma=2.04*10**-4;#stephen boltzmann constant in KJ/m^2 hr K^4\n",
    "print(\"heat transfer through concentric sphere,Q in KJ/hr \")\n",
    "A1=4*math.pi*D1**2/4;\n",
    "A2=4*math.pi*D2**2/4;\n",
    "Q=(A1*sigma*(T1**4-T2**4))/((1/epsilon1)+((A1/A2)*((1/epsilon2)-1)))\n",
    "print(\"Q=\"),round(Q,2)\n",
    "print(\"so heat exchange=6297.1 KJ/hr\")"
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}