summaryrefslogtreecommitdiff
path: root/Thermal_Engineering_by_A._V._Arasu/ch6.ipynb
blob: f0f6f4157fa813ff092a0f6bf121b1f65809027d (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
894
895
896
897
898
899
900
901
{
 "metadata": {
  "name": "",
  "signature": "sha256:4962285b4f62f2bf376e81ac1782d3fcaba245abd75f93d7b849812ce5c45ab3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 6 :\n",
      "Refrigeration Cycles"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.1  Page no : 308"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "COP = 8.5;\t\t\t#Co-efficient of performance\n",
      "T1 = 300.;\t\t\t#Room temperature in K\n",
      "T2 = 267.;\t\t\t#Refrigeration temperature in K\n",
      "\n",
      "# Calculations\n",
      "COPmax = T2/(T1-T2);\t\t\t#Maximum COP possible\n",
      "\n",
      "# Results\n",
      "print 'Maximum COP possible is %3.2f  \\\n",
      "\\nSince the COP claimed by the inventor is more than the maximum possible COP\\\n",
      " his claim is not correct'%(COPmax)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum COP possible is 8.09  \n",
        "Since the COP claimed by the inventor is more than the maximum possible COP his claim is not correct\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.2  Page no : 309"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "TL = 268.;\t\t\t#Low temperature in K\n",
      "TH = 293.;\t\t\t#High temperature in K\n",
      "t = 24.;\t\t\t#time in hrs\n",
      "C = 2100.;\t\t\t#Capacity of refrigerator in kJ/s\n",
      "Tw = 10.;\t\t\t#Water temperature in oC\n",
      "L = 335.;\t\t\t#Latent heat of ice in kJ/kg\n",
      "\n",
      "# Calculations\n",
      "COP = TL/(TH-TL);\t\t\t#Co-efficient of performance\n",
      "Pmin = C/COP;\t\t\t#Minimum power required in kW\n",
      "Qr = (4.187*(Tw-0))+L;\t\t\t#Heat removed from water in kJ/kg\n",
      "m = C/Qr;\t\t\t#mass of ice formed in kg/s\n",
      "W = (m*t*3600)/1000;\t\t\t#Weight of ice formed in tons\n",
      "\n",
      "# Results\n",
      "print 'Minimum power required is %3.2f kW  \\\n",
      "\\nWeight of ice formed in 24 hours is %3.2f tons'%(Pmin,W)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum power required is 195.90 kW  \n",
        "Weight of ice formed in 24 hours is 481.44 tons\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.3  Page no : 309"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "TL = -10.;\t\t\t#Temperature of brine in oC\n",
      "TH = 20.;\t\t\t#Temperature of water in oC\n",
      "L = 335.;\t\t\t#Latent heat of ice in kJ/kg\n",
      "\n",
      "# Calculations\n",
      "Qr = (4.187*(TH-0))+L;\t\t\t#Heat removed from water in kJ/kg\n",
      "COP = (TL+273)/(TH-TL);\t\t\t#Co-efficient of performance\n",
      "mi = (COP*3600)/Qr;\t\t\t#mass of ice formed per kWh in kg\n",
      "\n",
      "# Results\n",
      "print 'Mass of ice formed per kWh is %3.1f kg'%(mi)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass of ice formed per kWh is 75.4 kg\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.4  Page no : 310"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "P1 = 1.2;\t\t\t#Pressure at point 1 in bar\n",
      "P2 = 7.;\t\t\t#Pressure at point 2 in bar\n",
      "m = 0.05;\t\t\t#mass flow rate of refrigerant in kg/s\n",
      "h1 = 340.1;\t\t\t#Enthalpy at point 1 from refrigerant-12 tables in kJ/kg\n",
      "s1 = 1.57135;\t\t\t#Entropy at point 1 from refrigerant-12 tables in kJ/kg-K\n",
      "s2 = 1.57135;\t\t\t#Entropy at point 2 from refrigerant-12 tables in kJ/kg-K\n",
      "h2 = 372.;\t\t\t#Enthalpy at point 2 from refrigerant-12 tables in kJ/kg\n",
      "h3 = 226.575;\t\t\t#Enthalpy at point 3 from refrigerant-12 tables in kJ/kg\n",
      "h4 = 226.575;\t\t\t#Enthalpy at point 4 from refrigerant-12 tables in kJ/kg\n",
      "\n",
      "# Calculations\n",
      "Q2 = m*(h1-h4);\t\t\t#Rate of heat removed from the refrigerated space in kW\n",
      "W = m*(h2-h1);\t\t\t#Power input to the compressor in kW\n",
      "Q1 = m*(h2-h3);\t\t\t#Rate of heat rejection to the environment in kW\n",
      "COP = Q2/W;\t\t\t#Co-efficient of performance\n",
      "\n",
      "# Results\n",
      "print 'Rate of heat removed from the refrigerated space is %3.2f kW  \\\n",
      "\\nPower input to the compressor is %3.3f kW  \\\n",
      "\\nRate of heat rejection to the environment is %3.2f kW  \\\n",
      "\\nCo-efficient of performance is %3.2f'%(Q2,W,Q1,COP)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rate of heat removed from the refrigerated space is 5.68 kW  \n",
        "Power input to the compressor is 1.595 kW  \n",
        "Rate of heat rejection to the environment is 7.27 kW  \n",
        "Co-efficient of performance is 3.56\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.5  Page no : 311"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T2 = 40.;\t\t\t#Temperature at point 2 in oC\n",
      "T1 = -10.;\t\t\t#Temperature at point 1 in oC\n",
      "h2 = 367.155;\t\t\t#Enthalpy at point 2 from refrigerant-12 tables in kJ/kg\n",
      "s2 = 1.54057;\t\t\t#Entropy at point 2 from refrigerant-12 tables in kJ/kg-K\n",
      "s1 = 1.54057;\t\t\t#Entropy at point 1 from refrigerant-12 tables in kJ/kg-K\n",
      "sg = 1.56004;\t\t\t#Entropy from refrigerant-12 tables in kJ/kg-K\n",
      "sf = 0.96601;\t\t\t#Entropy from refrigerant-12 tables in kJ/kg-K\n",
      "hf = 190.822;\t\t\t#Enthalpy from refrigerant-12 tables in kJ/kg-K\n",
      "hfg = 156.319;\t\t\t#Enthalpy from refrigerant-12 tables in kJ/kg-K\n",
      "h3 = 238.533;\t\t\t#Enthalpy at point 3 from refrigerant-12 tables in kJ/kg-K\n",
      "h4 = h3;\t\t\t#Enthalpy at point 4 from refrigerant-12 tables in kJ/kg-K\n",
      "\n",
      "# Calculations\n",
      "x1 = (s1-sf)/(sg-sf);\t\t\t#Quality factor\n",
      "h1 = hf+(x1*hfg);\t\t\t#Enthalpy at point 1 from refrigerant-12 tables in kJ/kg\n",
      "COP = (h1-h4)/(h2-h1);\t\t\t#Co-efficient of performance\n",
      "\n",
      "# Results\n",
      "print 'COP of the system is %3.2f'%(COP)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "COP of the system is 4.12\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.6  Page no : 311"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Tc = 35.;\t\t\t#Temperature of condenser in oC\n",
      "Te = -15.;\t\t\t#Temperature of evaporator in oC\n",
      "m = 10.;\t\t\t#Mass of ice per day in tons\n",
      "Tw = 30.;\t\t\t#Temperature of water in oC\n",
      "Ti = -5.;\t\t\t#Temperature of ice in oC\n",
      "nv = 0.65;\t\t\t#Volumetric efficiency\n",
      "N = 1200.;\t\t\t#Speed in rpm\n",
      "x = 1.2;\t\t\t#Stroke to bore ratio\n",
      "na = 0.85;\t\t\t#Adiabatic efficiency\n",
      "nm = 0.95;\t\t\t#Mechanical efficiency\n",
      "S = 4.187;\t\t\t#Specific heat of water in kJ/kg\n",
      "L = 335.;\t\t\t#Latent heat of ice in kJ/kg\n",
      "h1 = 1667.24;\t\t\t#Enthalpy at Te from Ammonia chart in kJ/kg\n",
      "h2 = 1925.;\t\t\t#Enthalpy at Te from Ammonia chart in kJ/kg\n",
      "h4 = 586.41;\t\t\t#Enthalpy at Tc from Ammonia chart in kJ/kg\n",
      "v1 = 0.508;\t\t\t#Specific humidity at Te from Ammonia chart in (m**3)/kg\n",
      "\n",
      "# Calculations\n",
      "Qr = (((m*1000)/24)*((S*(Tw-0))+L+(1.94*(0-Ti))))/3600;\t\t\t#Refrigerating capacity in kW\n",
      "mr = Qr/(h1-h4);\t\t\t#Refrigerant mass flow rate in kg/s\n",
      "T2 = 112;\t\t\t#Discharge temperature in oC\n",
      "D = ((mr*v1*4*60)/(nv*3.14*x*N))**(1./3);\t\t\t#Cylinder diameter in m\n",
      "L = x*D;\t\t\t#Stroke length in m\n",
      "W = (mr*(h2-h1))/(na*nm);\t\t\t#Compressor motor power in kW\n",
      "COPth = (h1-h4)/(h2-h1);\t\t\t#Theoretical COP\n",
      "COPact = Qr/W;\t\t\t#Actual COP\n",
      "\n",
      "# Results\n",
      "print 'Refrigerating capacity of plant is %3.2f kW  \\\n",
      "\\nRefrigerant mass flow rate is %3.4f kg/s  \\\n",
      "\\nDischarge temperature is %3.0f oC  \\\n",
      "\\nCylinder diameter is %3.3f m  \\\n",
      "\\nStroke length is %3.3f m  \\\n",
      "\\nCompressor motor power is %3.2f kW  \\\n",
      "\\nTheoretical COP is %3.2f  \\\n",
      "\\nActual COP is %3.2f'%(Qr,mr,T2,D,L,W,COPth,COPact)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refrigerating capacity of plant is 54.43 kW  \n",
        "Refrigerant mass flow rate is 0.0504 kg/s  \n",
        "Discharge temperature is 112 oC  \n",
        "Cylinder diameter is 0.128 m  \n",
        "Stroke length is 0.153 m  \n",
        "Compressor motor power is 16.08 kW  \n",
        "Theoretical COP is 4.19  \n",
        "Actual COP is 3.39\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.7  Page no : 313"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T1 = -5.;\t\t\t#Temperature at point 1 in oC\n",
      "T2 = 30.;\t\t\t#Temperature at point 2 in oC\n",
      "m = 13500.;\t\t\t#mass of ice per day in kg\n",
      "Tw = 20.;\t\t\t#Temperature of water in oC\n",
      "COP = 0.6;\t\t\t#Co-efficient of performance\n",
      "h2 = 1709.33;\t\t\t#Enthalpy at point 2 in kJ/kg\n",
      "s2 = 6.16259;\t\t\t#Entropy at point 2 in kJ/kg-K\n",
      "s1 = 6.16259;\t\t\t#Entropy at point 1 in kJ/kg-K\n",
      "sf = 1.8182;\t\t\t#Entropy in kJ/kg-K\n",
      "sg = 6.58542;\t\t\t#Entropy in kJ/kg-K\n",
      "hf = 400.98;\t\t\t#Enthalpy in kJ/kg\n",
      "hfg = 1278.35;\t\t\t#Enthalpy in kJ/kg\n",
      "h4 = 562.75;\t\t\t#Enthalpy at point 4 in kJ/kg\n",
      "S = 4.187;\t\t\t#Specific heat of water in kJ/kg\n",
      "L = 336.;\t\t\t#Latent heat of ice in kJ/kg\n",
      "\n",
      "# Calculations\n",
      "x1 = (s1-sf)/(sg-sf);\t\t\t#Quality factor\n",
      "h1 = hf+(x1*hfg);\t\t\t#Enthalpy at point 1 from refrigerant-12 tables in kJ/kg\n",
      "COPi = (h1-h4)/(h2-h1);\t\t\t#Ideal COP\n",
      "COPact = COP*COPi;\t\t\t#Actual COP\n",
      "Qr = ((m*S*(Tw-0))+(m*L))/(24*3600);\t\t\t#Total amount of heat removed in kJ/s\n",
      "mr = Qr/(h1-h4);\t\t\t#Circulation rate of ammonia in kg/s\n",
      "W = mr*(h2-h1);\t\t\t#Power required in kW\n",
      "\n",
      "# Results\n",
      "print 'Circulation rate of ammonia is %3.3f kg/s  \\\n",
      "\\nPower required is %3.3f kW  \\\n",
      "\\nCOP is %3.3f'%(mr,W,COPact)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Circulation rate of ammonia is 0.065 kg/s  \n",
        "Power required is 9.374 kW  \n",
        "COP is 4.198\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.8  Page no : 314"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "Tc = 20.;\t\t\t#Temperature of condenser in oC\n",
      "Te = -25.;\t\t\t#Temperature of evaporator in oC\n",
      "m = 15.;\t\t\t#Mass of ice per day in tons\n",
      "Ts = 5.;\t\t\t#Subcooled temperature in oC\n",
      "Tsh = 10.;\t\t\t#Superheated temperature in oC\n",
      "n = 6.;\t\t\t#No. of cylinders\n",
      "N = 950.;\t\t\t#Speed of compressor in rpm\n",
      "x = 1.;\t\t\t#Stroke to bore ratio\n",
      "h1 = 402.;\t\t\t#Enthalpy at point 1 from R-22 tables in kJ/kg\n",
      "h2 = 442.;\t\t\t#Enthalpy at point 2 from R-22 tables in kJ/kg\n",
      "h3 = 216.;\t\t\t#Enthalpy at point 3 from R-22 tables in kJ/kg\n",
      "h4 = 216.;\t\t\t#Enthalpy at point 4 from R-22 tables in kJ/kg\n",
      "v1 = 2.258;\t\t\t#Specific volume at point 1 in (m**3)/min\n",
      "\n",
      "# Calculations\n",
      "Re = h1-h4;         \t\t\t#Refrigerating effect in kJ/kg\n",
      "mr = (m*14000)/(Re*60);\t\t\t#Mass flow of refrigerant in kg/min\n",
      "Pth = (mr*(h2-h1))/60;\t\t\t#Theoretical power in kW\n",
      "COP = (h1-h4)/(h2-h1);\t\t\t#Co-efficient of performance\n",
      "Dth = v1/n;\t\t\t            #Theoretical print lacement per cylinder\n",
      "D = (((Dth*4)/(3.147*N))**(1./3))*1000;\t\t\t#Theoretical bore of compressor in mm\n",
      "L = D;              \t\t\t#Theoretical stroke of compressor in mm\n",
      "\n",
      "# Results\n",
      "print 'Refrigerating effect is %3.0f kJ/kg  \\\n",
      "\\nMass flow of refrigerant per minute is %3.2f kg/min  \\\n",
      "\\nTheoretical input power is %3.2f kW  COP is %3.2f  \\\n",
      "\\nTheoretical bore of compressor is %3.2f mm  \\\n",
      "\\nTheoretical stroke of compressor is %3.2f mm'%(Re,mr,Pth,COP,D,L)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refrigerating effect is 186 kJ/kg  \n",
        "Mass flow of refrigerant per minute is 18.82 kg/min  \n",
        "Theoretical input power is 12.54 kW  COP is 4.65  \n",
        "Theoretical bore of compressor is 79.56 mm  \n",
        "Theoretical stroke of compressor is 79.56 mm\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.9  Page no : 316"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "T2 = 40.;\t\t\t#Temperature at point 2 in oC\n",
      "T1 = -5.;\t\t\t#Temperature at point 1 in oC\n",
      "h2 = 367.155;\t\t\t#Enthalpy at point 2 from F-12 tables in kJ/kg\n",
      "sg = 1.55717;\t\t\t#Entropy from F-12 tables in kJ/kg-K\n",
      "s1 = 1.54057;\t\t\t#Entropy at point 1 from F-12 tables in kJ/kg-K\n",
      "sf = 0.98311;\t\t\t#Entropy from F-12 tables in kJ/kg-K\n",
      "hf = 195.394;\t\t\t#Enthalpy from F-12 tables in kJ/kg\n",
      "hfg = 153.934;\t\t\t#Enthalpy from F-12 tables in kJ/kg\n",
      "h4 = 238.533;\t\t\t#Enthalpy at point 4 from F-12 tables in kJ/kg\n",
      "h4s = 218;\t\t\t#Enthalpy at point 4 with subcooling from F-12 tables in kJ/kg\n",
      "\n",
      "# Calculations\n",
      "x1 = (s1-sf)/(sg-sf);\t\t\t#Quality factor\n",
      "h1 = hf+(x1*hfg);\t\t\t#Enthalpy at point 1 from refrigerant-12 tables in kJ/kg\n",
      "COPns = (h1-h4)/(h2-h1);\t\t\t#Co-efficient of performance with no subcooling\n",
      "COPs = (h1-h4s)/(h2-h1);\t\t\t#Co-efficient of performance with subcooling\n",
      "\n",
      "# Results\n",
      "print 'COP with no subcooling is %3.3f  \\\n",
      "\\nCOP with subcooling is %3.3f'%(COPns,COPs)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "COP with no subcooling is 4.773  \n",
        "COP with subcooling is 5.695\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.10  Page no : 309"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Tg = 470.;\t\t\t#Heating temperature in K\n",
      "T0 = 290.;\t\t\t#Cooling temperature in K\n",
      "TL = 270.;\t\t\t#Refrigeration temperature in K\n",
      "\n",
      "# Calculations\n",
      "COP = ((Tg-T0)/Tg)*(TL/(T0-TL));\t\t\t#Ideal COP of absorption refrigeration system\n",
      "\n",
      "# Results\n",
      "print 'Ideal COP of absorption refrigeration system is %3.2f'%(COP)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ideal COP of absorption refrigeration system is 5.17\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.11  Page no : 317"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T1 = -18.;\t\t\t#Temperature at point 1 in oC\n",
      "T3 = 27.;\t\t\t#Temperature at point 3 in oC\n",
      "rp = 4.;\t\t\t#Pressure ratio\n",
      "m = 0.045;\t\t\t#mass flow rate in kg/s\n",
      "y = 1.4;\t\t\t#Ratio of specific heats\n",
      "Cp = 1.005;\t\t\t#Specific heat at constant pressure in kJ/kg-K\n",
      "\n",
      "# Calculations\n",
      "x = (y-1)/y;\t\t\t#Ratio\n",
      "T2 = (rp**x)*(273+T1);\t\t\t#Temperature at point 2 in K\n",
      "Tmax = T2-273;\t\t\t#Maximum temperature in oC\n",
      "T4 = ((1/rp)**x)*(273+T3);\t\t\t#Temperature at point 4 in K\n",
      "Tmin = T4-273;\t\t\t#Minimum temperature in oC\n",
      "qL = Cp*(T1-Tmin);\t\t\t#Heat rejected\n",
      "Wcin = Cp*(Tmax-T1);\t\t\t#Compressor work\n",
      "Wtout = Cp*(T3-Tmin);\t\t\t#Turbine work\n",
      "Wnet = Wcin-Wtout;\t\t\t#Net work done\n",
      "COP = qL/Wnet;\t\t\t#Co-efficient of performance\n",
      "Qref = m*qL;\t\t\t#Rate of refrigeration in kW\n",
      "\n",
      "# Results\n",
      "print 'Maximum temperature in the cycle is %3.0f oC  \\\n",
      "\\nMinimum temperature in the cycle is %3.0f oC  \\\n",
      "\\nCOP is %3.2f  \\\n",
      "\\nRate of refrigeration is %3.2f kW'%(Tmax,Tmin,COP,Qref)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum temperature in the cycle is 106 oC  \n",
        "Minimum temperature in the cycle is -71 oC  \n",
        "COP is 2.06  \n",
        "Rate of refrigeration is 2.40 kW\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.12  Page no : 318"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "P1 = 1.;\t\t\t#Pressure at point 1 in bar\n",
      "T1 = 268.;\t\t\t#Temperature at point 1 in K\n",
      "P2 = 5.;\t\t\t#Pressure at point 2 in bar\n",
      "T3 = 288.;\t\t\t#Temperature at point 3 in K\n",
      "n = 1.3;\t\t\t#Adiabatic gas constant\n",
      "Cp = 1.005;\t\t\t#Specific heat at constant pressure in kJ/kg-K\n",
      "\n",
      "# Calculations\n",
      "x = (n-1)/n;\t\t\t#Ratio\n",
      "T2 = ((P2/P1)**x)*T1;\t\t\t#Temperature at point 2 in K\n",
      "T4 = ((P1/P2)**x)*T3;\t\t\t#Temperature at point 4 in K\n",
      "W = Cp*(T3-T4);\t\t\t#Work developed per kg of air in kJ/kg\n",
      "Re = Cp*(T1-T4);\t\t\t#Refrigerating effect per kg of air in kJ/kg\n",
      "Wnet = Cp*((T2-T1)-(T3-T4));\t\t\t#Net work output in kJ/kg\n",
      "COP = Re/Wnet;\t\t\t#Co-efficient of performance\n",
      "\n",
      "# Results\n",
      "print 'Work developed per kg of air is %3.3f kJ/kg  \\\n",
      "\\nRefrigerating effect per kg of air is %3.3f kJ/kg  \\\n",
      "\\nCOP of the cycle is %3.2f'%(W,Re,COP)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Work developed per kg of air is 89.795 kJ/kg  \n",
        "Refrigerating effect per kg of air is 69.695 kJ/kg  \n",
        "COP of the cycle is 2.22\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.13  Page no : 319"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T1 = 277.;\t\t\t#Temperature at point 1 in K\n",
      "T3 = 328.;\t\t\t#Temperature at point 3 in K\n",
      "P1 = 0.1;\t\t\t#Pressure at point 1 in MPa\n",
      "P2 = 0.3;\t\t\t#Pressure at point 2 in MPa\n",
      "nc = 0.72;\t\t\t#Isentropic efficiency of compressor\n",
      "nt = 0.78;\t\t\t#Isentropic efficiency of turbine\n",
      "y = 1.4;\t\t\t#Adiabatic gas constant\n",
      "Cp = 1.005;\t\t\t#Specific heat at constant pressure in kJ/kg-K\n",
      "m = 3.;\t\t\t#Cooling load in tonnes\n",
      "\n",
      "# Calculations\n",
      "x = (y-1)/y;\t\t\t#Ratio\n",
      "T2s = T1*((P2/P1)**x);\t\t\t#Temperature at point 2s in K\n",
      "T2 = ((T2s-T1)/nc)+T1;\t\t\t#Temerature at point 2 in K\n",
      "T4s = T3*((P1/P2)**x);\t\t\t#Temperature at point 4s in K\n",
      "T4 = T3-((T3-T4s)*nt);\t\t\t#Temperature at point 4 in K\n",
      "Re = Cp*(T1-T4);\t\t\t#Refrigerating effect in kJ/kg\n",
      "Wnet = Cp*((T2-T1)-(T3-T4));\t\t\t#Net work output in kJ/kg\n",
      "COP = Re/Wnet;\t\t\t#Co-efficient of performance\n",
      "P = (m*3.52)/COP;\t\t\t#Driving power required in kW\n",
      "ma = (m*3.52)/Re;\t\t\t#Mass flow rate of air in kg/s\n",
      "\n",
      "# Results\n",
      "print 'COP of refrigerator is %3.2f  \\\n",
      "\\nDriving power required is %3.0f kW  \\\n",
      "\\nMass flow rate of air is %3.2f kg/s'%(COP,P,ma)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "COP of refrigerator is 0.25  \n",
        "Driving power required is  43 kW  \n",
        "Mass flow rate of air is 0.59 kg/s\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.14  Page no : 321"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "P1 = 2.5;\t\t\t#Pressure at point 1 in bar\n",
      "P3 = 9.;\t\t\t#Pressure at point 3 in bar\n",
      "COPr = 0.65;\t\t\t#Ratio of actual COP to the theoretical COP\n",
      "m = 5.;\t\t\t#Refrigerant flow in kg/min\n",
      "T1 = 309;\t\t\t#Temperature at point 1 in K\n",
      "T2s = 300;\t\t\t#Temperature at point 2s in K\n",
      "h1 = 570.3;\t\t\t#Enthalpy at P1 from the given tables in kJ/kg\n",
      "h4 = 456.4;\t\t\t#Enthalpy at P3 from the given tables in kJ/kg\n",
      "h2g = 585.3;\t\t\t#Enthalpy at P3 from the given tables in kJ/kg\n",
      "s2 = 4.76;\t\t\t#Entropy at P1 from the given tables in kJ/kg-K\n",
      "s2g = 4.74;\t\t\t#Entropy at P3 from the given tables in kJ/kg-K\n",
      "Cp = 0.67;\t\t\t#Specific heat at P3 in kJ/kg-K\n",
      "\n",
      "# Calculations\n",
      "T2 = (2.718**((s2-s2g)/Cp))*T2s;\t\t\t#Temperature at point 2 in K\n",
      "h2 = h2g+(Cp*(T2-T2s));\t\t\t#Enthalpy at point 2 in kJ/kg\n",
      "COPR = (h1-h4)/(h2-h1);\t\t\t#Refrigerant COP\n",
      "COPact = COPr*COPR;\t\t\t#Actual COP\n",
      "qL = COPact*(h2-h1);\t\t\t#Heat rejected in kJ/kg\n",
      "QL = ((m*qL*60)/3600)/3.516;\t\t\t#Cooling produced per kg of refrigerant in tonnes of refrigeration\n",
      "\n",
      "# Results\n",
      "print 'Theoretical COP is %3.2f  \\\n",
      "\\nNet cooling produced per hour is %3.2f TR'%(COPR,QL)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Theoretical COP is 5.40  \n",
        "Net cooling produced per hour is 1.75 TR\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.15  Page no : 322"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "T2 = 298.;\t\t\t#Temperature at point 2 in K\n",
      "T1 = 268.;\t\t\t#Temperature at point 1 in K\n",
      "hf1 = -7.54;\t\t\t#Liquid Enthalpy at T1 in kJ/kg\n",
      "x1 = 0.6;\t\t\t#Quality factor 1\n",
      "hfg1 = 245.3;\t\t\t#Latent heat at T1 in kJ/kg\n",
      "sf1 = 0.251;\t\t\t#Liquid Entropy at T1 in kJ/kg-K\n",
      "s1 = 0.507;\t\t\t#Entropy at point 1 in kJ/kg-K\n",
      "hfg2 = 121.4;\t\t\t#Latent heat at T2 in kJ/kg\n",
      "hf2 = 81.3;\t\t\t#Liquid Enthalpy at T2 in kJ/kg\n",
      "h4 = hf2;\t\t\t#Enthalpy at point 4 in kJ/kg\n",
      "\n",
      "# Calculations\n",
      "h1 = hf1+(x1*hfg1);\t\t\t#Enthalpy at point 1 in kJ/kg\n",
      "x2 = ((s1-sf1)*T2)/hfg2;\t\t\t#Quality factor 2\n",
      "h2 = hf2+(x2*hfg2);\t\t\t#Enthalpy at point 2 in kJ/kg\n",
      "COP = (h1-h4)/(h2-h1);\t\t\t#COP of the machine\n",
      "\n",
      "# Results\n",
      "print 'COP of the machine is %3.2f'%(COP)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "COP of the machine is 3.25\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.16  Page no : 323"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "P1 = 25.;\t\t\t#Pressure at point 1 in bar\n",
      "P2 = 60.;\t\t\t#Pressure at point 2 in bar\n",
      "h2 = 208.1;\t\t\t#Vapour enthalpy at P2 in kJ/kg\n",
      "h3 = 61.9;\t\t\t#Liquid enthalpy at P2 in kJ/kg\n",
      "h4 = h3;\t\t\t#Liquid enthalpy at P2 in kJ/kg\n",
      "s2 = 0.703;\t\t\t#Vapour entropy at P2 in kJ/kg-K\n",
      "sf1 = -0.075;\t\t\t#Liquid entropy at P1 in kJ/kg-K\n",
      "sfg1 = 0.971;\t\t\t#Entropy in kJ/kg-K\n",
      "hf1 = -18.4;\t\t\t#Liquid Enthalpy at P1 in kJ/kg\n",
      "hfg1 = 252.9;\t\t\t#Latent heat at P1 in kJ/kg\n",
      "m = 5.;\t\t\t#Refrigerant flow in kg/min\n",
      "\n",
      "# Calculations\n",
      "x1 = (s2-sf1)/sfg1;\t\t\t#Quality factor 1\n",
      "h1 = hf1+(x1*hfg1);\t\t\t#Enthalpy at point 1 in kJ/kg\n",
      "COP = (h1-h4)/(h2-h1);\t\t\t#Co-efficient of performance\n",
      "QL = (m*(h1-h4))/60;\t\t\t#Capacity of the refrigerator in kW\n",
      "\n",
      "# Results\n",
      "print 'COP of refrigerator is %3.2f  \\\n",
      "\\nCapacity of refrigerator is %3.2f kW'%(COP,QL)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "COP of refrigerator is 5.13  \n",
        "Capacity of refrigerator is 10.19 kW\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.17  Page no : 324"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math \n",
      "\n",
      "# Variables\n",
      "T1 = 271.;\t\t\t#Temperature at point 1 in K\n",
      "T = 265.;\t\t\t#Temperature at point 1' in K\n",
      "Ta = 303.;\t\t\t#Temperature at point 2' in K\n",
      "Cpv = 0.733;\t\t\t#Specific heat of vapour in kJ/kg\n",
      "Cpl = 1.235;\t\t\t#Specific heat of liquid in kJ/kg\n",
      "h = 184.07;\t\t\t#Liquid enthalpy at T in kJ/kg\n",
      "s = 0.7;\t\t\t#Entropy at point 1' in kJ/kg-K\n",
      "sa = 0.685;\t\t\t#Vapour entropy at Ta in kJ/kg-K\n",
      "ha = 199.62;\t\t\t#Enthalpy at point 2' in kJ/kg\n",
      "hfb = 64.59;\t\t\t#Liquid enthalpy at Ta in kJ/kg\n",
      "DT3 = 5.;\t\t\t#Temperature difference in oC\n",
      "Q = 2532.;\t\t\t#Refrigeration capacity in kJ/min\n",
      "\n",
      "# Calculations\n",
      "s2 = s+(Cpv*((math.log(T1/T))/(math.log(2.718))));\t\t\t#Entropy at point 1 in kJ/kg-K\n",
      "h1 = h+(Cpv*(T1-T));\t\t\t#Enthalpy at point 1 in kJ/kg-K\n",
      "T2 = (2.718**((s2-sa)/Cpv))*Ta;\t\t\t#Temperature at point 2 in K\n",
      "h2 = ha+(Cpv*(T2-Ta));\t\t\t#Enthalpy at point 2 in kJ/kg\n",
      "h4 = hfb-(Cpl*DT3);\t\t\t#Enthalpy at point 4 in kJ/kg\n",
      "COP = (h1-h4)/(h2-h1);\t\t\t#Co-efficient of performance\n",
      "m = Q/(h1-h4);\t\t\t#Mass flow rate of refrigerant in kJ/min\n",
      "P = (m*(h2-h1))/(60*12);\t\t\t#Power required in kW/TR\n",
      "\n",
      "# Results\n",
      "print 'COP is %3.2f  \\\n",
      "\\nTheoretical power required per tonne of refrigeration is %3.3f kW/TR'%(COP,P)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "COP is 6.23  \n",
        "Theoretical power required per tonne of refrigeration is 0.564 kW/TR\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}