summaryrefslogtreecommitdiff
path: root/Thermal_Engineering_by_S._l._Somasundaram/Ch7.ipynb
blob: 358ceb3971357da25b10bbfe278bd436b56aae8e (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
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
{
 "metadata": {
  "name": "",
  "signature": "sha256:9acdea47ca7898eae442036130d51b232205190e82c14f3cc5e8b20a00e6edad"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Ch-7 : Psychrometrics "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.1 : Pg - 290"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps=0.024853 #at 21 degress \n",
      "phi=0.34 #relative humidity\n",
      "p=1.013 #pressure in bar\n",
      "#CALCULATIONS\n",
      "pv=ps*phi\n",
      "w=0.622*(pv/(p-pv))\n",
      "tdew=4.5 #at 0.00845 bar\n",
      "#RESULTS\n",
      "print 'specific humidity is %0.5f kg/kg of da'%(w)\n",
      "print 'dew point temp is %0.2f degree C'%(tdew)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "specific humidity is 0.00523 kg/kg of da\n",
        "dew point temp is 4.50 degree C\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.2 : Pg - 291"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "t1=26 #temp in degrees\n",
      "t2=32 #temp in degrees\n",
      "pvs=0.033597 #pressure in bar\n",
      "ps=0.047534 #pressure in bar\n",
      "p=1.013 #pressure in bar\n",
      "a=6.6*10**-4\n",
      "#CALCULATIONS\n",
      "pv=pvs-(p*a*(t2-t1))\n",
      "w=(0.622*pv)/(p-pv)\n",
      "phi=pv/ps\n",
      "#RESULTS\n",
      "print 'specific humidity is %0.4f kg/kg of da'%(w)\n",
      "print '\\nrelative humidity is %0.3f '%(phi)\n",
      "print 'dew point temp is 23.5 degree C' #from steam tables"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "specific humidity is 0.0187 kg/kg of da\n",
        "\n",
        "relative humidity is 0.622 \n",
        "dew point temp is 23.5 degree C\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.3 : Pg - 291"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps=0.042415 #under 30 degrees temp in bar\n",
      "vg=32.929 #m*m*m/kg\n",
      "phi=0.3 #relative humidity\n",
      "p=1.01325 #bar\n",
      "pv=0.012725**10**2 #pressure \n",
      "rv=0.4615\n",
      "t=313 #temp in k\n",
      "pa=1.005*10**2\n",
      "ra=0.287\n",
      "#CALCULATIONS\n",
      "pv=phi*ps\n",
      "w1=0.622*(pv/(p-pv))\n",
      "rhos=1/vg\n",
      "rhov=phi*rhos\n",
      "rho=pv/(rv*t)\n",
      "pa=p-pv\n",
      "rhoa=pa*100/(ra*t)\n",
      "w2=rhov/rhoa\n",
      "ds=phi*((p-ps)/(p-pv))\n",
      "#RESULTS\n",
      "print 'partial pressure of water vapour is %0.6f bar'%(pv)\n",
      "print '\\ndensity of dry air is %0.4f kg/m*m*m'%(rhoa)\n",
      "print 'dew point temp is 10.5 degrees'\n",
      "print '\\nspecific humidity is %0.5f kg/kg of da'%(w2) #textbook answer slightly varies\n",
      "print '\\ndegree of saturation is %0.4f '%(ds)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "partial pressure of water vapour is 0.012724 bar\n",
        "\n",
        "density of dry air is 1.1138 kg/m*m*m\n",
        "dew point temp is 10.5 degrees\n",
        "\n",
        "specific humidity is 0.00818 kg/kg of da\n",
        "\n",
        "degree of saturation is 0.2911 \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.4 : Pg - 292"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps=0.035636 #pressure in bar\n",
      "pvw=0.018168 #pressure in bar\n",
      "p=1.01325 #pressure in bar\n",
      "a=6.6*10**-4\n",
      "w=0.00667\n",
      "td=27 #temparature in degrees\n",
      "tw=16 #temparature in degrees\n",
      "#CALCULATIONS\n",
      "pv=pvw-(p*a*(td-tw))\n",
      "w=0.622*(pv/(p-pv))\n",
      "phi=pv/ps\n",
      "h=(1.005*td+w*(2500+1.86*td))\n",
      "#RESULTS\n",
      "print 'humidity ratio is %0.5f kg/kg of da'%(w)\n",
      "print '\\nrelative humidity is %0.4f '%(phi)\n",
      "print 'dew point temparature is 8 degrees'\n",
      "print '\\nenthalphy of moist air is %0.2f kg/kg of da'%(h)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "humidity ratio is 0.00671 kg/kg of da\n",
        "\n",
        "relative humidity is 0.3034 \n",
        "dew point temparature is 8 degrees\n",
        "\n",
        "enthalphy of moist air is 44.24 kg/kg of da\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.5 : Pg - 293"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "p=1.01325 #pressure in bar\n",
      "pv=0.020 #pressure in bar at 21 degrees temp\n",
      "ws=0.0154 #kg/kg of da\n",
      "w=0.0123 #kg/kg of da\n",
      "vs=0.86 #under 21 degrees temp m*m*m/kg\n",
      "w1=0.0074\n",
      "#CALCULATIONS\n",
      "pa=p-pv\n",
      "sr=w/ws\n",
      "rho=1/vs\n",
      "avc=0.0163-w1\n",
      "#RESULTS\n",
      "print 'partial pressure of vapour and dry air are %0.2f bar and %0.5f bar'%(pv,pa)\n",
      "print 'dew point temp is 17.4 degrees'\n",
      "print 'specific humidity is 0.0123 kg/kg of da'\n",
      "print '\\nsaturation ratio is %0.3f '%(sr)\n",
      "print '\\ndensity of misture is %0.3f kg/m*m*m'%(rho)\n",
      "print '\\namount of water vapour condensed is %0.4f kg/kg of da'%(avc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "partial pressure of vapour and dry air are 0.02 bar and 0.99325 bar\n",
        "dew point temp is 17.4 degrees\n",
        "specific humidity is 0.0123 kg/kg of da\n",
        "\n",
        "saturation ratio is 0.799 \n",
        "\n",
        "density of misture is 1.163 kg/m*m*m\n",
        "\n",
        "amount of water vapour condensed is 0.0089 kg/kg of da\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.6 : Pg - 294"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "p=1.01325 #pressure in bar\n",
      "w1=0.01468\n",
      "td=20 #temp in degrees\n",
      "tw=40 #temp in degrees\n",
      "#CALCULATIONS\n",
      "ha=(1.005*td+w1*(2500+1.86*td))\n",
      "w2=(ha-(1.005*tw))/(2500+1.86*tw)\n",
      "#RESULTS\n",
      "print 'humidity rate is %0.2f kg/kg of da'%(ha)\n",
      "print '\\nw2 is %0.5f kg/kg of da'%(w2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "humidity rate is 57.35 kg/kg of da\n",
        "\n",
        "w2 is 0.00666 kg/kg of da\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.7 : Pg - 297"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "#initialisation of variables\n",
      "ps1=0.006566 #bar pressure\n",
      "phi1=0.6 #relative humidity\n",
      "td2=21 #temp in degrees\n",
      "td1=1 #temp in degrees\n",
      "ps2=0.02486 #pressure in bar\n",
      "td3=26 #temp in degrees\n",
      "p=1.013 #pressure in bar\n",
      "#CALCULATIONS\n",
      "pv1=(phi1*ps1)\n",
      "w=0.622*(pv1/(p-pv1))\n",
      "q=(td2-td1)*(1.005+(1.86*w))\n",
      "phi2=pv1/ps2\n",
      "cbf=(td3-td2)/(td3-td1)\n",
      "cf=1-cbf\n",
      "#RESULTS\n",
      "print 'heat supplied to air is %0.2f kg/kg of da'%(q)\n",
      "print '\\nfinal relative humidity is %0.4f kg/kg of da'%(phi2)\n",
      "print '\\ncoil bypass factor is %0.2f '%(cbf)\n",
      "print '\\ncontact factor is %0.2f '%(cf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "heat supplied to air is 20.19 kg/kg of da\n",
        "\n",
        "final relative humidity is 0.1585 kg/kg of da\n",
        "\n",
        "coil bypass factor is 0.20 \n",
        "\n",
        "contact factor is 0.80 \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.8 : Pg - 298"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps1=0.056216 #bar pressure\n",
      "phi1=0.2 #relative humidity\n",
      "td1=35 #temp in degrees\n",
      "p=1.01325 #pressure in bar\n",
      "td2=25 #temp in degrees\n",
      "ps2=0.03166 #bar\n",
      "#CALCULATIONS\n",
      "pv1=phi1*ps1\n",
      "w1=0.622*(pv1/(p-pv1))\n",
      "ha=(1.005*td1+w1*(2500+1.86*td1))\n",
      "w2=(ha-(1.005*td2))/(2500+1.86*td2)\n",
      "pv2=(w2*p)/(w2+0.622)\n",
      "phi2=pv2/ps2\n",
      "#RESULTS\n",
      "print 'relative humidity rate is %0.2f kg/kg of da'%(ha)\n",
      "print '\\nrelative humidity is %0.4f '%(phi2)\n",
      "print '\\namount of water to be added is %0.5f kg/kg of da'%(w2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "relative humidity rate is 53.08 kg/kg of da\n",
        "\n",
        "relative humidity is 0.5550 \n",
        "\n",
        "amount of water to be added is 0.01098 kg/kg of da\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.9 : Pg - 300"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps1=0.056216 #bar pressure\n",
      "ps3=0.023366 #bar pressure\n",
      "phi1=0.6 #relative humidity\n",
      "td3=20 #temp in degress\n",
      "td1=35 #temp in degrees\n",
      "td2=12 #temp in degrees\n",
      "r=0.287\n",
      "p=1.01325 #pressure in bar\n",
      "x1=90.12 #kj/kg\n",
      "x2=34.08 #kj/kg\n",
      "x3=42.25 #kj/kg\n",
      "hf=0.4 #kj/kg\n",
      "w1=0.02142\n",
      "w2=0.00873\n",
      "#CALCULATIONS\n",
      "pv1=phi1*ps1\n",
      "w1=0.622*(pv1/(p-pv1))\n",
      "h1=(1.005*td1+w1*(2500+1.86*td1))\n",
      "pv3=phi1*ps3\n",
      "w3=0.622*(pv3/(p-pv3))\n",
      "h3=(1.005*td3+w3*(2500+1.86*td3))\n",
      "h2=(1.005*td2+0.0073*(2500+1.86*td2))\n",
      "ma=((p-pv1)*100*2.5)/(r*(td1+273))\n",
      "q1=ma*(x2-x1)+(w1-w2)*hf\n",
      "q2=(ma*(x3-x2))\n",
      "#RESULTS\n",
      "print 'mass of dry air is %0.2f kg/s'%(ma)\n",
      "print '\\ncooler load on the dehumidyfier is %0.2f kw'%(q1) # ans wrong in the book\n",
      "print '\\nheating load of the heater is %0.2f kw'%(q2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "mass of dry air is 2.77 kg/s\n",
        "\n",
        "cooler load on the dehumidyfier is -155.24 kw\n",
        "\n",
        "heating load of the heater is 22.63 kw\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.10 : Pg - 302"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "x1=90.12 #kj/kg\n",
      "x3=42.25 #kj/kg\n",
      "ps3=0.023366 #bar pressure\n",
      "td3=35 #temp in degrees\n",
      "phi1=0.6 #relative humidity\n",
      "p=1.01325 #pressure in bar\n",
      "#CALCULATIONS\n",
      "pv3=phi1*ps3\n",
      "w3=0.622*(pv3/(p-pv3))\n",
      "h3=(1.005*td3+w3*(2500+1.86*td3))\n",
      "qs=h3-x3\n",
      "ql=x1-h3\n",
      "shf=qs/(qs+ql)\n",
      "#RESULTS\n",
      "print 'sensible heat removed is %0.2f kj/kg of da'%(qs)\n",
      "print '\\nlatent heat removed is %0.2f kj/kg of da'%(ql)\n",
      "print '\\nsensible heat factor is %0.2f '%(shf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "sensible heat removed is 15.31 kj/kg of da\n",
        "\n",
        "latent heat removed is 32.56 kj/kg of da\n",
        "\n",
        "sensible heat factor is 0.32 \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.11 : Pg - 302"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps1=0.010720 #bar pressure\n",
      "phi1=0.3 #relative humidity\n",
      "td1=8 #temp in degrees\n",
      "td2=32 #temp in degrees\n",
      "td3=30 #temp in degrees\n",
      "ps3=0.042415 #bar pressure\n",
      "phi3=0.5 #relative humidity\n",
      "hf=762.6 #kj/kg\n",
      "hfg=2013.6 #kj/kg\n",
      "p=1.01325 #pressure in bar\n",
      "#CALCULATIONS\n",
      "pv1=phi1*ps1\n",
      "w1=0.622*(pv1/(p-pv1))\n",
      "h1=(1.005*td1+w1*(2500+1.86*td1))\n",
      "h2=(1.005*td2+w1*(2500+1.86*td2))\n",
      "ha=h2-h1\n",
      "pv3=phi3*ps3\n",
      "w3=0.622*(pv3/(p-pv3))\n",
      "h3=(1.005*td3+w3*(2500+1.86*td3))\n",
      "wa=w3-w1\n",
      "hw=(h3-h2)/(w3-w1)\n",
      "x=(hw-hf)/hfg\n",
      "#RESULTS\n",
      "print 'heat added is %0.2f kJ/kg of da'%(ha)\n",
      "print '\\nwater added is %0.5f kg/kg of da'%(wa)\n",
      "print 'temp os steam supplied is 179.88 degrees' #at 10 bar pressure\n",
      "print '\\nsteam required is %0.2f kj/kg of steam'%(hw)\n",
      "print '\\nquality of steam at 10 bar is %0.3f '%(x)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "heat added is 24.21 kJ/kg of da\n",
        "\n",
        "water added is 0.01132 kg/kg of da\n",
        "temp os steam supplied is 179.88 degrees\n",
        "\n",
        "steam required is 2377.53 kj/kg of steam\n",
        "\n",
        "quality of steam at 10 bar is 0.802 \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.12 : Pg - 305"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps1=0.023366 #bar pressure\n",
      "phi1=0.4#relative humidity\n",
      "td1=20 #temp in degrees\n",
      "m1=40 #kg/s\n",
      "ps2=0.01227 #bar pressure\n",
      "phi2=0.8#relative humidity\n",
      "td2=10 #temp in degrees\n",
      "m2=20 #kg/s\n",
      "p=1.01325 #pressure in bar\n",
      "#CALCULATIONS\n",
      "pv1=phi1*ps1\n",
      "w1=0.622*(pv1/(p-pv1))\n",
      "h1=(1.005*td1+w1*(2500+1.86*td1))\n",
      "ma1=m1/(1+w1)\n",
      "pv2=phi2*ps2\n",
      "w2=0.622*(pv2/(p-pv2))\n",
      "h2=(1.005*td2+w2*(2500+1.86*td2))\n",
      "ma2=m2/(1+w2)\n",
      "w3=((ma1*w1)+(ma2*w2))/(ma1+ma2)\n",
      "h3=((ma1*h1)+(ma2*h2))/(ma1+ma2)\n",
      "td3=((ma1*td1)+(ma2*td2))/(ma1+ma2)\n",
      "#RESULTS\n",
      "print 'specific humidity is %0.5f kJ/kg of da'%(w3)\n",
      "print '\\ntemparature of air leaving chamber is %0.2f degrees'%(td3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "specific humidity is 0.00589 kJ/kg of da\n",
        "\n",
        "temparature of air leaving chamber is 16.67 degrees\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.13 : Pg - 307"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "ps1=0.062739 #bar pressure\n",
      "phi1=0.9 #relative humidity\n",
      "td1=37 #temp in degrees\n",
      "td3=10.7 #dew point temparature\n",
      "ps4=0.02366 #bar pressure\n",
      "phi4=0.55 #relative humidity\n",
      "td4=20 #temp in degrees\n",
      "w12=1.5 #work input in kw\n",
      "v4=50 #\n",
      "t4=37+273 #temp  in k\n",
      "Ra = 0.287\n",
      "r= 1\n",
      "w2= 1\n",
      "w3= 1\n",
      "hf3= 2\n",
      "p=1.01325 #pressure in bar\n",
      "#CALCULATIONS\n",
      "pv1=phi1*ps1\n",
      "w1=0.622*(pv1/(p-pv1))\n",
      "h1=(1.005*td1+w1*(2500+1.86*td1))\n",
      "pv4=phi4*ps4\n",
      "w4=0.622*(pv4/(p-pv4))\n",
      "h4=(1.005*td4+w4*(2500+1.86*td4))\n",
      "h3=(1.005*td3+w4*(2500+1.86*td3))\n",
      "pa4=p-pv4\n",
      "ma=(pa4*v4*100)/(Ra*t4)\n",
      "q12=(w12*60)/ma\n",
      "h2=h1+q12\n",
      "q23=((h3+(w2-w3)*hf3)-h2)\n",
      "Q23=-1*q23*ma\n",
      "q34=h4-h3\n",
      "Q34=q34*ma\n",
      "#RESULTS\n",
      "#ans in the book are wrong.\n",
      "print 'enthalpy rate 1 is %0.2f kJ/kg of da'%(h1)\n",
      "print '\\nenthalpy rate 4 is %0.2f kJ/kg of da'%(h4)\n",
      "print '\\nenthalpy rate 3 is %0.2f kJ/kg of da'%(h3) \n",
      "print '\\nmass of dry air is %0.2f kg/min'%(ma) \n",
      "print '\\nenthalpy rate 2 is %0.2f kJ/kg of da'%(h2)\n",
      "print '\\ncapacity od cooling coil q23 is %0.2f kJ/min'%(Q23)\n",
      "print '\\ncapacity od cooling coil q34 is %0.2f kJ/min'%(Q34)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "enthalpy rate 1 is 131.48 kJ/kg of da\n",
        "\n",
        "enthalpy rate 4 is 40.63 kJ/kg of da\n",
        "\n",
        "enthalpy rate 3 is 31.14 kJ/kg of da\n",
        "\n",
        "mass of dry air is 56.21 kg/min\n",
        "\n",
        "enthalpy rate 2 is 133.08 kJ/kg of da\n",
        "\n",
        "capacity od cooling coil q23 is 5730.05 kJ/min\n",
        "\n",
        "capacity od cooling coil q34 is 533.25 kJ/min\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.14 : Pg - 310"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "td3=15 #dew point temparature\n",
      "ps3=0.017039 #bar pressure\n",
      "phi3=0.55 #relative humidity\n",
      "p=1 #bar pressure\n",
      "ps4=0.029821 #bar pressure\n",
      "phi4=1 #relative humidity\n",
      "td4=24 #temp in degrees\n",
      "mw1=1000 #kg/min\n",
      "hf1=109 #kj/kg\n",
      "hf2=50.4 #kj/kg\n",
      "w4=0.01912\n",
      "w3=0.00588\n",
      "#CALCULATIONS\n",
      "pv3=phi3*ps3\n",
      "w1=0.622*(pv3/(p-pv3))\n",
      "h3=(1.005*td3+w3*(2500+1.86*td3))\n",
      "pv4=phi4*ps4\n",
      "w4=0.622*(pv4/(p-pv4))\n",
      "h4=(1.005*td4+w4*(2500+1.86*td4))\n",
      "ma=mw1*(hf1-hf2)/(h4-h3-(w4-w3)*hf2)\n",
      "x=ma*(w4-w3) #mw1-mw2\n",
      "mf=ma+x\n",
      "pl=(x/mw1)*100\n",
      "#RESULTS\n",
      "print 'mass of dry air is %0.1f kg/min'%(ma)\n",
      "print '\\nmass cooling water loss by evoporation is %0.2f kg/min '%(x)\n",
      "print '\\nmass flow of moist air is %0.2f kg/min '%(mf)\n",
      "print '\\npercentage loss by evoporation is %0.2f %%'%(pl)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "mass of dry air is 1389.8 kg/min\n",
        "\n",
        "mass cooling water loss by evoporation is 18.40 kg/min \n",
        "\n",
        "mass flow of moist air is 1408.20 kg/min \n",
        "\n",
        "percentage loss by evoporation is 1.84 %\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.15 : Pg - 311"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "td3=17 #dew point temparature\n",
      "ps3=0.019362 #bar pressure\n",
      "phi3=0.6 #relative humidity\n",
      "p=0.98 #bar pressure\n",
      "t3=290 #temp in k\n",
      "ps4=0.042415 #bar pressure\n",
      "phi4=1 #relative humidity\n",
      "td4=30 #temp in degrees\n",
      "mw2=80\n",
      "v=110 #volume\n",
      "ma=127.98\n",
      "w4=0.02814\n",
      "w3=0.007464\n",
      "r=0.287\n",
      "hf1=209.3\n",
      "#CALCULATIONS\n",
      "pv3=phi3*ps3\n",
      "w3=0.622*(pv3/(p-pv3))\n",
      "h3=(1.005*td3+w3*(2500+1.86*td3))\n",
      "pa3=p-pv3\n",
      "m=(pa3*v*100)/(r*t3)\n",
      "h2=h3+(240/ma)\n",
      "pv4=phi4*ps4\n",
      "w4=0.622*(pv4/(p-pv4))\n",
      "h4=(1.005*td4+w4*(2500+1.86*td4))\n",
      "mw1=mw2+ma*(w4-w3)\n",
      "hf2=((mw1*hf1)+(ma*h2)-(ma*h4))/mw2\n",
      "#RESULTS\n",
      "print 'mass of dry air is %0.2f kg/min'%(m)\n",
      "print '\\nenthalpy rate 3 is %0.2f kJ/kg of da'%(h3)\n",
      "print '\\nenthalpy rate 2 is %0.2f kJ/kg of da'%(h2)\n",
      "print '\\nenthalpy rate 4 is %0.2f kJ/kg of da'%(h4)\n",
      "print '\\nenthalpy rate  is %0.1f kJ/kg of da'%(hf2)\n",
      "print 'temparature of water leaving the tower is 27.1 degrees'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "mass of dry air is 127.99 kg/min\n",
        "\n",
        "enthalpy rate 3 is 35.98 kJ/kg of da\n",
        "\n",
        "enthalpy rate 2 is 37.85 kJ/kg of da\n",
        "\n",
        "enthalpy rate 4 is 102.07 kJ/kg of da\n",
        "\n",
        "enthalpy rate  is 113.5 kJ/kg of da\n",
        "temparature of water leaving the tower is 27.1 degrees\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex - 7.16 : Pg - 315"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "uw=2.5\n",
      "aw=127.82\n",
      "to=34 #temp in degrees\n",
      "tr=26 #temp in degrees\n",
      "ur=1.5\n",
      "ar=90\n",
      "ag=8.68\n",
      "clf1=100\n",
      "pvwo=0.037782\n",
      "p=1.013 #pressure in bar\n",
      "a=6.66*10**-4\n",
      "phi=0.5\n",
      "#CALCULATIONS\n",
      "shgw=uw*aw*(to-tr)\n",
      "shgr=ur*ar*(to-tr)\n",
      "sg=ag*clf1\n",
      "pvo=pvwo-(p*a*(to-tr))\n",
      "wo=0.622*(pvo/(p-pvo))\n",
      "ho=(1.005*to+wo*(2500+1.86*to))\n",
      "pvr=phi*pvo\n",
      "wr1=0.622*(pvr/(p-pvr))\n",
      "hr=(1.005*tr+wr1*(2500+1.86*tr))\n",
      "#RESULTS\n",
      "print 'recommended indoor conditions are 25.5-26.7 degrees and 50% rh and outdoor conditions are  26 degrees and 50%rh'\n",
      "print 'area of the roof is 90 m*m'\n",
      "print 'overall heat transfer coefficients are 2.5 w/m*m'\n",
      "print '\\nsensible heat gain through walls is %0.2f '%(shgw)\n",
      "print '\\nsensible heat gain through roofs is %0.2f '%(shgr)\n",
      "print '\\nsensible heat gain through windows is %0.2f '%(sg)\n",
      "print 'sensible heat per adult male is 67.5 W and latent heat is 55.7 W'\n",
      "print '\\nenthalpy rate o is %0.2f '%(ho)\n",
      "print '\\nenthalpy rate r is %0.2f '%(hr)\n",
      "print 'volume of air infiltered is 1.628 m*m*m/min'\n",
      "print 'latent heat gain is 902.4 W'\n",
      "print 'sensible heat gain is 257.2 W'\n",
      "print 'room sensible heat factor is 0.803'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "recommended indoor conditions are 25.5-26.7 degrees and 50% rh and outdoor conditions are  26 degrees and 50%rh\n",
        "area of the roof is 90 m*m\n",
        "overall heat transfer coefficients are 2.5 w/m*m\n",
        "\n",
        "sensible heat gain through walls is 2556.40 \n",
        "\n",
        "sensible heat gain through roofs is 1080.00 \n",
        "\n",
        "sensible heat gain through windows is 868.00 \n",
        "sensible heat per adult male is 67.5 W and latent heat is 55.7 W\n",
        "\n",
        "enthalpy rate o is 86.82 \n",
        "\n",
        "enthalpy rate r is 51.88 \n",
        "volume of air infiltered is 1.628 m*m*m/min\n",
        "latent heat gain is 902.4 W\n",
        "sensible heat gain is 257.2 W\n",
        "room sensible heat factor is 0.803\n"
       ]
      }
     ],
     "prompt_number": 16
    }
   ],
   "metadata": {}
  }
 ]
}