summaryrefslogtreecommitdiff
path: root/Fundamentals_Of_Thermodynamics/Chapter15_6.ipynb
blob: 1c9182a73cd35fca2a23123946e7673210d88b8d (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
921
{

 "metadata": {

  "name": "",

  "signature": "sha256:4afaac3b11e3c61840a392c8cec12435d16ae2f3d2cdfe278957aaca509d72f5"

 },

 "nbformat": 3,

 "nbformat_minor": 0,

 "worksheets": [

  {

   "cells": [

    {

     "cell_type": "heading",

     "level": 1,

     "metadata": {},

     "source": [

      "Chapter15:CHEMICAL REACTIONS"

     ]

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.1:Pg-621"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques1\n",

      "#theoratical air-fuel ratio for combustion of octane\n",

      "#combustion equation is\n",

      "#C8H18 + 12.5O2 + 12.5(3.76) N2 \u2192 8 CO2 + 9H2O + 47.0N2\n",

      "rm=(12.5+47.0)/1;#air fuel ratio on mole basis\n",

      "rma=rm*28.97/114.2;#air fuel ratio on mass basis;\n",

      "print \"Theoratical air fuel ratio on mass basis is\",round(rma),\"kg air/kg fuel\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " Theoratical air fuel ratio on mass basis is 15.0 kg air/kg fuel\n"

       ]

      }

     ],

     "prompt_number": 3

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.2:Pg-622"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 2\n",

      "# molal analysis of the products of combustion\n",

      "# combustion equation is \n",

      "# C8H18 + 12.5(2) O2 + 12.5(2)(3.76) N2 \u2192 8 CO2 + 9H2O + 12.5O2 + 94.0N2\n",

      "nCO2=8 # number of moles of CO2 \n",

      "nH2O=9 # number of moles of H2O\n",

      "nO2=12.5 # number of moles of O2\n",

      "nN2=94.0 # number of moles of N2\n",

      "moles=nCO2+nH2O+nO2+nN2 # total moles\n",

      "# molal analysis of products\n",

      "xCO2=nCO2*100/moles \n",

      "xH2O=nH2O*100/moles\n",

      "xO2=nO2*100/moles\n",

      "xN2=nN2*100/moles\n",

      "print \" CO2 =\",round(xCO2,2)\n",

      "print \"\\n H2O=\",round(xH2O,2)\n",

      "print \"\\n O2=\",round(xO2,2)\n",

      "print \"\\n N2=\",round(xN2,2)\n",

      "print \"\\n The dew point temp. corresponding to partial pressure of water i.e \",round(xH2O,2),\"KPa is 39.7 degree C\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " CO2 = 6.48\n",

        "\n",

        " H2O= 7.29\n",

        "\n",

        " O2= 10.12\n",

        "\n",

        " N2= 76.11\n",

        "\n",

        " The dew point temp. corresponding to partial pressure of water i.e  7.29 KPa is 39.7 degree C\n"

       ]

      }

     ],

     "prompt_number": 6

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.2E:Pg-622"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 2\n",

      "# molal analysis of the products of combustion\n",

      "# combustion equation is \n",

      "# C8H18 + 12.5(2) O2 + 12.5(2)(3.76) N2 \u2192 8 CO2 + 9H2O + 12.5O2 + 94.0N2\n",

      "pressure=14.7 # in lbf/in^2\n",

      "nCO2=8 # number of moles of CO2 \n",

      "nH2O=9 # number of moles of H2O\n",

      "nO2=12.5 # number of moles of O2\n",

      "nN2=94.0 # number of moles of N2\n",

      "moles=nCO2+nH2O+nO2+nN2 # total moles\n",

      "# molal analysis of products\n",

      "xCO2=nCO2*100/moles \n",

      "xH2O=nH2O*100/moles\n",

      "xO2=nO2*100/moles\n",

      "xN2=nN2*100/moles\n",

      "print \" CO2 =\",round(xCO2,2)\n",

      "print \"\\n H2O=\",round(xH2O,2)\n",

      "print \"\\n O2=\",round(xO2,2)\n",

      "print \"\\n N2=\",round(xN2,2)\n",

      "PressureO2=pressure*xH2O/100 # partial pressure of O2\n",

      "print \"\\n The dew point temp. corresponding to partial pressure of water i.e \",round(PressureO2,3),\"lbf/in^2 is 104 F degree C\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " CO2 = 6.48\n",

        "\n",

        " H2O= 7.29\n",

        "\n",

        " O2= 10.12\n",

        "\n",

        " N2= 76.11\n",

        "\n",

        " The dew point temp. corresponding to partial pressure of water i.e  1.071 lbf/in^2 is 104 F degree C\n"

       ]

      }

     ],

     "prompt_number": 8

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.3:Pg-623"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 3\n",

      "# to determine the air\u2013fuel ratio on a volumetric basis\n",

      "# the combustion equation is\n",

      "# 0.14H2+0.27CO+0.03CH4+0.006O2+0.509N2+0.045CO2+0.259O2+0.259(3.76)N2\u21920.20H2O+0.345CO2+1.482 N2\n",

      "mH2=2 # molar mass of H2\n",

      "mCO=28 # molar mass of CO\n",

      "mCH4=16 # molar mass of CH4\n",

      "mO2=32 # molar mass of O2\n",

      "mN2=28 # molar mass of N2\n",

      "mCO2=44 # molar mass of CO2\n",

      "\n",

      "\n",

      "kmolair=0.259 # moles of air in mixture using combustion equation\n",

      "kmolfuel=0.21 # moles of fuel in mixture using combustion equation\n",

      "ratioth=kmolair/kmolfuel # theoratical ratio\n",

      "\n",

      "# For 20% excess air\n",

      "vratio=ratioth*(1+0.2) # new ratio for excess air on volume basis\n",

      "\n",

      "print \" The A/F ratio on volumetric basis is \",round(vratio,2)\n",

      "mratio=vratio*28.97 /(0.14*mH2+0.27*mCO+0.03*mCH4+0.006*mO2+0.509*mN2+0.045*mCO2)\n",

      "print \"\\n The A/F ratio on mass basis is \",round(mratio,2),\"kg air/kg fuel\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " The A/F ratio on volumetric basis is  1.48\n",

        "\n",

        " The A/F ratio on mass basis is  1.73 kg air/kg fuel\n"

       ]

      }

     ],

     "prompt_number": 11

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.4:Pg-624"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 4\n",

      "# determining the air\u2013fuel ratio and the percent theoretical air\n",

      "CO2=10.00 # percentage\n",

      "O2=2.37 # percentage\n",

      "CO=0.53 # percentage\n",

      "N2=87.10 # percentage\n",

      "mCH4=16 # molecular mass of CH4\n",

      "# using this data the combustion equation is\n",

      "# a CH4 + b O2 + c N2 \u2192 10.0 CO2 + 0.53 CO + 2.37 O2 + d H2O + 87.1N2\n",

      "# on balancing we get\n",

      "# 10.53 CH4 + 23.16 O2 + 87.1N2 \u219210.0 CO2 + 0.53 CO + 2.37 O2 + 21.06 H2O + 87.1N2\n",

      "# balanced combustion equation for per Kmole of fuel is:\n",

      "# CH4 + 2.2O2 + 8.27 N2 \u2192 0.95 CO2 + 0.05 CO + 2H2O + 0.225 O2 + 8.27 N2\n",

      "molesAir=2.2+8.27 # moles of air\n",

      "AF= 28.97*molesAir/mCH4 # air fuel ratio on mass basis\n",

      "print \"\\n The A/F ratio on mass basis is \",round(AF,2),\"kg air/kg fuel\"\n",

      "# Theoritical combustion equation:\n",

      "# CH4 + 2O2 + 2(3.76)N2 \u2192 CO2 + 2H2O + 7.52 N2\n",

      "molesAirth=2+2*3.76 # moles of air(theoritical)\n",

      "AFth= 28.97*molesAirth/mCH4 # air fuel ratio on mass basis (theoritical)\n",

      "print \"\\n The A/F ratio (theoritical) on mass basis is \",round(AFth,2),\"kg air/kg fuel\"\n",

      "print \"\\n The percent theoretical air is\",round(AF*100/AFth,1)"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "\n",

        " The A/F ratio on mass basis is  18.96 kg air/kg fuel\n",

        "\n",

        " The A/F ratio (theoritical) on mass basis is  17.24 kg air/kg fuel\n",

        "\n",

        " The percent theoretical air is 110.0\n"

       ]

      }

     ],

     "prompt_number": 16

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.5:Pg-625"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 5\n",

      "\n",

      "Sulfur=0.6 # percent by mass\n",

      "Hydrogen=5.7 # percent by mass\n",

      "Carbon=79.2 # percent by mass\n",

      "Oxygen=10.0 # percent by mass\n",

      "Nitrogen=1.5 # percent by mass\n",

      "Ash=3.0 # percent by mass\n",

      "mS=32.0 # molecular mass \n",

      "mH2=2.0  # molecular mass\n",

      "mC=12.0  # molecular mass\n",

      "mO2=32.0  # molecular mass\n",

      "mN2=28.0  # molecular mass\n",

      "# molal composition per 100 Kg of fuel:\n",

      "S=Sulfur/mS # molal composition \n",

      "H=Hydrogen/mH2 # molal composition\n",

      "C=Carbon/mC # molal composition\n",

      "O2=Oxygen/mO2 # molal composition\n",

      "N2=Nitrogen/mN2 # molal composition\n",

      "\n",

      "#The combustion equation becomes \n",

      "# 0.02 S + 0.02 O2 \u21920.02 SO2\n",

      "# 2.85 H2 + 1.42 O2 \u21922.85 H2O\n",

      "# 6.60 C + 6.60 O2 \u21926.60 CO2\n",

      "\n",

      "O2req=0.02+1.42+6.60 # kmol O2 required/100 kg fuel\n",

      "O2present=O2req-O2 # kmol O2 from air/100 kg fuel\n",

      "AFtheo= (O2present+O2present*3.76)*28.97/100 # AF ration theoritical kg air/kg fuel\n",

      "print \"\\n The A/F ratio (theoritical) on mass basis is \",round(AFtheo,2),\"kg air/kg fuel\"\n",

      "print \"\\n The A/F ratio for 30% excess air on mass basis is \",round(AFtheo*1.3,2),\"kg air/kg fuel\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "\n",

        " The A/F ratio (theoritical) on mass basis is  10.66 kg air/kg fuel\n",

        "\n",

        " The A/F ratio for 30% excess air on mass basis is  13.85 kg air/kg fuel\n"

       ]

      }

     ],

     "prompt_number": 23

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.6:Pg-629"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques6\n",

      "# determining heat transfer per kilomole of fuel entering combustion chamber\n",

      "\n",

      "#1-CH4\n",

      "#2-CO2\n",

      "#3-H2O\n",

      "#hf-standard enthalpy of given substance\n",

      "hf1=-74.873;#kJ\n",

      "hf2=-393.522;#kJ\n",

      "hf3=-285.830;#kJ\n",

      "Qcv=hf2+2*hf3-hf1;#kJ\n",

      "print \"Heat transfer per kilomole of fuel entering combustion chamber is\",round(Qcv,3),\"kJ\"\n",

      "#the answers in the book is different as they have not printed the decimals in values"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "Heat transfer per kilomole of fuel entering combustion chamber is -890.309 kJ\n"

       ]

      }

     ],

     "prompt_number": 5

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.7:Pg-631"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques7\n",

      "#calculating enthalpy of water at given pressure and temperature\n",

      "\n",

      "#1.Assuming steam to be an ideal gas with value of Cp\n",

      "T1=298.15;#Initial temperature in K\n",

      "T2=573.15;#final temperature in K\n",

      "T=(T1+T2)/2;#average temperature in K\n",

      "Cp=1.79+0.107*T/1000+0.586*(T/1000)**2-.20*(T/1000)**3;#specific heat at constant pressure in kj/kg.K\n",

      "M=18.015;#mass in kg\n",

      "dh=M*Cp*(T2-T1);#enthalpy change in kJ/kmol\n",

      "ho=-241.826;#enthalpy at standard temperature and pressure in kJ/mol\n",

      "htp1=ho+dh/1000;#enthalpy at given temp and pressure in kJ/kmol\n",

      "print \" 1. Enthalpy of water at given pressure and temperature using value of Cp =\",round(htp1,3),\"kJ/kmol\"\n",

      "\n",

      "#2..Assuming steam to be an ideal gas with value for dh\n",

      "dh=9359;#enthalpy change from table A.9 in kJ/mol\n",

      "htp2=ho+dh/1000;#enthalpy at given temp and pressure in kJ/kmol\n",

      "print \" 2. Enthalpy of water at given pressure and temperature assuming value od dh =\",round(htp2,3),\"kJ/kmol \"\n",

      "\n",

      "#3. Using steam table\n",

      "dh=M*(2977.5-2547.2);#enthalpy change for gases in kJ/mol\n",

      "htp3g=dh/1000+ho;\n",

      "dh=M*(2977.5-104.9);#enthalpy change for liquid in kJ/mol\n",

      "hl=-285.830;#standard enthalpy for liquid in kJ/kmol\n",

      "htp31=hl+dh/1000.0;#enthalpy at given temp and pressure in kJ/kmol\n",

      "print \" 3.(i) enthalpy at given temp and pressure in kJ/kmol in terms of liquid =\",round(htp31,3),\"kJ/kmol \"\n",

      "print \" 3.(ii) enthalpy at given temp and pressure in kJ/kmol in terms of liquid =\",round(htp3g,3),\"kJ/kmol \"\n",

      "#4.using generalised charts\n",

      "#htp=ho-(h2*-h2)+(h2*-h1*)+(h1*-h1);\n",

      "#h2*-h2=Z*R*Tc,\n",

      "#h2*-h1*=9539 kJ/mol, from part 2\n",

      "#h1*-h1=0 ,as ideal gas \n",

      "Z=0.21;#from chart\n",

      "R=8.3145;#gas constant in SI units\n",

      "Tc=647.3;#critical temperature in K\n",

      "htp4=ho+9539/1000-Z*R*Tc/1000;#enthalpy at given temp and pressure in kJ/kmol\n",

      "print \" 4. enthalpy at given temp and pressure in kJ/kmol using compressibility chart = \",round(htp4,3),\"kJ/kmol\"\n",

      "#the answers in book are different as they have not printed the decimals in values"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " 1. Enthalpy of water at given pressure and temperature using value of Cp = -232.258 kJ/kmol\n",

        " 2. Enthalpy of water at given pressure and temperature assuming value od dh = -232.826 kJ/kmol \n",

        " 3.(i) enthalpy at given temp and pressure in kJ/kmol in terms of liquid = -234.08 kJ/kmol \n",

        " 3.(ii) enthalpy at given temp and pressure in kJ/kmol in terms of liquid = -234.074 kJ/kmol \n",

        " 4. enthalpy at given temp and pressure in kJ/kmol using compressibility chart =  -233.956 kJ/kmol\n"

       ]

      }

     ],

     "prompt_number": 12

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.8:Pg-632"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 8\n",

      "# Determine the heat transfer\n",

      "airth=400 # % excess theoritical air\n",

      "Ti=25 # Entry temp in degree celsius\n",

      "To=900 # Exit temp in Kelvin\n",

      "mf=0.25 # specific fuel consumption in kg/s of fuel per megawatt output\n",

      "# The combustion equation is:\n",

      "# C8H18(l) + 4(12.5)O2 + 4(12.5)(3.76)N2 \u2192 8CO2 + 9H2O + 37.5O2 + 188.0N2\n",

      "hfC8H18=-250105 # is the enthalpy of fuel in kJ/kmol \n",

      "nCO2=8 # moles\n",

      "hfCO2=-393522 # enthalpy in kJ/kmol\n",

      "DelhCO2=28030 # enthalpy in kJ/kmol\n",

      "mC8H18=114.23 # molecular mass\n",

      "nH2O=9 # moles\n",

      "hfH2O=-241826 # enthalpy in kJ/kmol\n",

      "DelhH2O=21937 # enthalpy in kJ/kmol\n",

      "DelhO2=19241 # enthalpy in kJ/kmol\n",

      "nO2=37.5 # moles\n",

      "DelhN2=18225 # enthalpy in kJ/kmol\n",

      "nN2=188.0 # moles\n",

      "Eproduct=nCO2*(hfCO2+DelhCO2)+nH2O*(hfH2O+DelhH2O)+nO2*DelhO2+nN2*DelhN2\n",

      "\n",

      "Wcv=1000*mC8H18/mf # work in kJ/kmol fuel\n",

      "print \" The work is \",Wcv,\"kJ/kmol fuel\"\n",

      "\n",

      "Qcv=Eproduct+Wcv-hfC8H18 # using first law\n",

      "print \" The Heat transfer is \",Qcv,\"kJ/kmol fuel\"\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " The work is  456920.0 kJ/kmol fuel\n",

        " The Heat transfer is  -48074.5 kJ/kmol fuel\n"

       ]

      }

     ],

     "prompt_number": 27

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.8E:Pg-633"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 8\n",

      "# Determine the heat transfer\n",

      "airth=400 # % excess theoritical air\n",

      "Ti=77 # Entry temp in F\n",

      "To=1100 # Exit temp in F\n",

      "mf=1 # specific fuel consumption in lb of fuel per horsepower-hour\n",

      "# The combustion equation is:\n",

      "# C8H18(l) + 4(12.5)O2 + 4(12.5)(3.76)N2 \u2192 8CO2 + 9H2O + 37.5O2 + 188.0N2\n",

      "hfC8H18=-107526 # is the enthalpy of fuel in Btu/lb.mol\n",

      "nCO2=8 # moles\n",

      "hfCO2=-169184 # enthalpy in Btu/lb.mol\n",

      "DelhCO2=11391 # enthalpy in Btu/lb.mol\n",

      "mC8H18=114.23 # molecular mass\n",

      "nH2O=9 # moles\n",

      "hfH2O=-103966 # enthalpy in Btu/lb.mol\n",

      "DelhH2O=8867 # enthalpy in Btu/lb.mol\n",

      "DelhO2=7784 # enthalpy in Btu/lb.mol\n",

      "nO2=37.5 # moles\n",

      "DelhN2=7374 # enthalpy in Btu/lb.mol\n",

      "nN2=188.0 # moles\n",

      "Eproduct=nCO2*(hfCO2+DelhCO2)+nH2O*(hfH2O+DelhH2O)+nO2*DelhO2+nN2*DelhN2\n",

      "\n",

      "Wcv=2544*mC8H18 # work in kJ/kmol fuel\n",

      "print \" The work is \",Wcv,\"Btu/lb.mol fuel\"\n",

      "\n",

      "Qcv=Eproduct+Wcv-hfC8H18 # using first law\n",

      "print \" The Heat transfer is \",Qcv,\"Btu/lb.mol fuel\"\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " The work is  290601.12 Btu/lb.mol fuel\n",

        " The Heat transfer is  -41895.88 Btu/lb.mol fuel\n"

       ]

      }

     ],

     "prompt_number": 31

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.9:Pg-634"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques 9\n",

      "\n",

      "# The combustion equation is\n",

      "# C2H4 + 3O2 \u2192 2 CO2 + 2H2O(g)\n",

      "hfC2H4=52467 # enthalpy in KJ/mol\n",

      "R=8.314 # gas constant\n",

      "T=298.2 # temperature in Kelvin\n",

      "hfCO2=-393522 # enthalpy in kJ/kmol\n",

      "DelhCO2=12906 # enthalpy in kJ/kmol\n",

      "hfH2O=-241826 # enthalpy in kJ/kmol\n",

      "DelhH2O=10499 # enthalpy in kJ/kmol\n",

      "Ureactant=hfC2H4-4*R*T # energy of reactant in KJ\n",

      "Uproduct=2*(hfCO2+DelhCO2)+2*(hfH2O+DelhH2O) # energy of product in KJ\n",

      "Q=Uproduct-Ureactant # using first law\n",

      "print \"The Heat transfer is \",Q,\"kJ\"\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The Heat transfer is  -1266436.0608 kJ\n"

       ]

      }

     ],

     "prompt_number": 33

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.10:Pg-638"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques 10\n",

      "\n",

      "# The combustion equation is\n",

      "# C3H8 + 5O2 \u2192 3 CO2 + 4H2O\n",

      "hfC3H8g=-103900 # enthalpy of C3H8 in KJ/mol from Table A.10\n",

      "hfC3H8l=hfC3H8g-44.097*370 # enthalpy of C3H8 liquid as enthalpy of evaporation is given in question\n",

      "hfH2Ol=285830 # enthalpy of water in KJ/mol\n",

      "hfH2Og=241826 # enthalpy in KJ/mol\n",

      "hfCO2=393522 # enthalpy in KJ/mol\n",

      "nO2=5 # moles\n",

      "nCO2=3 # moles\n",

      "nH2O=4 # moles\n",

      "nC3H8=1 # moles\n",

      "# part(1) : liquid propane-liquid water\n",

      "hrP=(nCO2*hfCO2 + nH2O*hfH2Ol -nC3H8*hfC3H8l)/44.097 # higher heating value of liquid propane \n",

      "print \"The higher heating value of liquid propane is\",round(hrP,2),\"KJ/kg\"\n",

      "\n",

      "# part(2) : Liquid propane\u2013gaseous water\n",

      "\n",

      "hrP=(nCO2*hfCO2 + nH2O*hfH2Og -nC3H8*hfC3H8l)/44.097 # lower heating value of liquid propane \n",

      "print \"The lower heating value of liquid propane is\",round(hrP,2),\"KJ/kg\"\n",

      "\n",

      "# part(3) :Gaseous propane\u2013liquid water\n",

      "hrP=(nCO2*hfCO2 + nH2O*hfH2Ol -nC3H8*hfC3H8g)/44.097 # higher heating value of gaseous propane \n",

      "print \"The higher heating value of gaseous propane is\",round(hrP,2),\"KJ/kg\"\n",

      "\n",

      "# part(4) :Gaseous propane\u2013Gaseous water\n",

      "hrP=(nCO2*hfCO2 + nH2O*hfH2Og -nC3H8*hfC3H8g)/44.097 # lower heating value of gaseous propane \n",

      "print \"The lower heating value of gaseous propane is\",round(hrP,2),\"KJ/kg\"\n",

      "\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The higher heating value of liquid propane is -120215.89 KJ/kg\n",

        "The lower heating value of liquid propane is 51434.02 KJ/kg\n",

        "The higher heating value of gaseous propane is 55055.58 KJ/kg\n",

        "The lower heating value of gaseous propane is 51064.02 KJ/kg\n"

       ]

      }

     ],

     "prompt_number": 3

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.11:Pg-638"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques 10\n",

      "# The combustion equation is\n",

      "# C3H8(g) + 5O2 \u2192 3 CO2 + 4H2O(g)\n",

      "hfC3H8=-103900 # enthalpy of C3H8 in KJ/mol from Table A.10\n",

      "Cp=2.1 # in KJ/Kg.K\n",

      "T1=500 # temp in Kelvin\n",

      "T2=298.2 # temp in Kelvin\n",

      "DelhO2=6086 # enthalpy of O2 in KJ/mol\n",

      "hfCO2=-393522 # enthalpy in KJ/mol\n",

      "DelhCO2=8305 # enthalpy of CO2 in KJ/mol\n",

      "hfH2O=-241826 # enthalpy of H2O in KJ/mol\n",

      "DelhH2O=6922 # enthalpy in KJ/mol\n",

      "nO2=5 # moles\n",

      "nCO2=3 # moles\n",

      "nH2O=4 # moles\n",

      "nC3H8=1 # moles\n",

      "\n",

      "hR500= hfC3H8+Cp*44.097*(T1-T2)+nO2*DelhO2  # in KJ/mol\n",

      "hP500= nCO2*(hfCO2+DelhCO2)+ nH2O*(DelhH2O+hfH2O) # in KJ/mol\n",

      "hRP500=hP500-hR500 #  in KJ/mol\n",

      "Hrp500=hRP500/44.097 # KJ/Kg\n",

      "\n",

      "print \" The enthalpy of combustion of gaseous propane at 500 K \",round(Hrp500)\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " The enthalpy of combustion of gaseous propane at 500 K  -46273.0\n"

       ]

      }

     ],

     "prompt_number": 10

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.12:Pg-639"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 12\n",

      "# The question is solved by Trial and Error and  using the table , no need for Calculation Thus not solved in Python"

     ],

     "language": "python",

     "metadata": {},

     "outputs": []

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.13:Pg-645"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 13\n",

      "# The equation for this chemical reaction is\n",

      "# C2H4(g) + 3(4) O2 + 3(4)(3.76) N2 \u2192 2 CO2+2H2O(g) + 9O2 + 45.1 N2\n",

      "T=25+273.15 # temp in degree kelvin\n",

      "P=0.1 # pressure in Mpa\n",

      "hfCO2=-393522 # enthalpy in KJ/mol\n",

      "hfH2O=-241826 # enthalpy of H2O in KJ/mol\n",

      "HfC2H4=52467 # enthalpy of C2H4 in KJ/mol\n",

      "hfO2=0 # enthalpy of formation in KJ/mol\n",

      "SCO2=213.795 # kJ/kmol fuel\n",

      "SH2O=188.243 # kJ/kmol fuel\n",

      "SC2H4=219.330 # kJ/kmol fuel\n",

      "SO2=205.148 # kJ/kmol fuel\n",

      "DelH=2*hfCO2+2*hfH2O-HfC2H4-3*hfO2 # in KJ/mol\n",

      "DelS=2*SCO2+2*SH2O-SC2H4-3*SO2 # kJ/kmol fuel\n",

      "DelG=DelH-T*(DelS) # Gibbs Energy\n",

      "Wrev=-DelG/28.054 # reversible work in kJ/kg\n",

      "print \"The reversible work is \",round(Wrev,2),\"kJ/kg \"\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The reversible work is  46838.61 kJ/kg \n"

       ]

      }

     ],

     "prompt_number": 12

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.14:Pg-647"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques \n",

      "# The question is solved by Trial and Error and  using the table , no need for Calculation Thus not solved in Python"

     ],

     "language": "python",

     "metadata": {},

     "outputs": []

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.15:Pg-649"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques15\n",

      "#calculatng reversible elecromotive force \n",

      "\n",

      "#1-H2O\n",

      "#2-H2\n",

      "#3-O2\n",

      "#hf-standard enthalpy \n",

      "#sf-standard entropy\n",

      "hf1=-285.830;#kJ\n",

      "hf2=0;#kJ\n",

      "hf3=0;#kJ\n",

      "sf1=69.950;#kJ/K\n",

      "sf2=130.678;#kJ/K\n",

      "sf3=205.148;#kJ/K\n",

      "dH=2*hf1-2*hf2-hf3;#change in enthalpy in kJ\n",

      "dS=2*sf1-2*sf2-sf3;#change in entropy in kJ/K\n",

      "T=298.15;#temperature in K\n",

      "dG=dH-T*dS/1000;#change in gibbs free energy in kJ\n",

      "E=-dG*1000/(96485*4);#emf in V\n",

      "print\" Reversible electromotive Force =\",round(E,3),\" V\"\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " Reversible electromotive Force = 1.229  V\n"

       ]

      }

     ],

     "prompt_number": 15

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.16:Pg-654"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# ques 16\n",

      "# to Calculate the combustion efficiency\n",

      "Tair = 400  # temp in K\n",

      "Vair = 100 # velocity in m/s\n",

      "Tfuel = 50 # temp of fuel in \u25e6C\n",

      "Tproducts = 1100 # temp of product in K\n",

      "Vproducts = 150 # velocity of product in m/s\n",

      "FAactual = 0.0211 # air fuel ratio kg fuel/kg air\n",

      "\n",

      "# HR + KER= \u2212243737 + 14892nO2 \n",

      "# HP + KEP= \u22125 068 599 + 120 853nO2 \n",

      "# using these two equations :\n",

      "no2=(-5068599.0 + 243737.0)/(14892.0-120853) # in kmol O2/kmol fuel\n",

      "FAideal=114.23/(4.76*no2*28.91) # in kg fuel/kg air\n",

      "\n",

      "efficomb=FAideal*100/FAactual # Efficiency\n",

      "\n",

      "print \" The combustion efficiency is \",round(efficomb,2),\"%\"\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " The combustion efficiency is  86.4 %\n"

       ]

      }

     ],

     "prompt_number": 16

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex15.17:Pg-654"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#ques17\n",

      "#efficiency of generator and plant\n",

      "\n",

      "q=325000*(3398.3-856.0);#heat transferred to H2O/kg fuel in kJ/kg\n",

      "qv=26700.0*33250;#higher heating value in kJ/kg\n",

      "nst=q/qv*100;#efficiency of steam generator\n",

      "w=81000.0*3600;#net work done in kJ/kg\n",

      "nth=w/qv*100.0;#thermal efficiency\n",

      "print\" Efficiency of generator =\",round(nst,1),\"percent\\n\"\n",

      "print\" Thermal Efficiency =\",round(nth,1),\" percent\"\n",

      "\n",

      "# the answer is slightly different in textbook due to approximation while here the answers are precise"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " Efficiency of generator = 93.1 percent\n",

        "\n",

        " Thermal Efficiency = 32.8  percent\n"

       ]

      }

     ],

     "prompt_number": 13

    }

   ],

   "metadata": {}

  }

 ]

}