summaryrefslogtreecommitdiff
path: root/Thermodynamics/Chapter12.ipynb
blob: 6b383304b5d52d62c52b576ac0a8ecf8ade00d48 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:26bd61324c67aa0fef3f72b60851ba818d2a228685c4163bcb87732321b4f4fb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12:NON-REACTING MIXTURES OF GASES AND LIQUIDS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.1, Page No:553"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "M1=28.02; # Molecular mass of N2\n",
      "M2=32; # Molecular mass of O2\n",
      "M3=39.91; # Molecular mass of Ar\n",
      "M4=44; # Molecular mass of CO2\n",
      "M5=2.02; # Molecular mass of H2\n",
      "y1=0.7803; # Part by volume of N2 in dry atmospheric air\n",
      "y2=0.2099; # Part by volume of O2 in dry atmospheric air\n",
      "y3=0.0094; # Part by volume of Ar in dry atmospheric air\n",
      "y4=0.0003; # Part by volume of CO2 in dry atmospheric air\n",
      "y5=0.0001; # Part by volume of H2 in dry atmospheric air\n",
      "R_1=8.3143; # Universal gas constant of air in kJ/kmol K\n",
      "\n",
      "#Calculation for (a)\n",
      "# (a).Average molecular mass and apperent gas constant of dry atmospheric air\n",
      "M=(y1*M1)+(y2*M2)+(y3*M3)+(y4*M4)+(y5*M5); # Average molecular mass\n",
      "R=R_1/M; #Apperent gas constant of dry atmospheric air\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a).Average molecular mass and apperent gas constant of dry atmospheric air\",\"\\nAverage molecular mass = \",round(M,3),\"kmol\"\n",
      "print \"Apperent gas constant of dry atmospheric air =\",round(R,3),\"kJ/kg K\"\n",
      "\n",
      "#Calculation for (b)\n",
      "# (b).The fraction of each component\n",
      "m1=(M1*y1)/M;#The fraction of N2 component\n",
      "m2=(M2*y2)/M;#The fraction of O2 component\n",
      "m3=(M3*y3)/M;#The fraction of Ar component\n",
      "m4=(M4*y4)/M;#The fraction of CO2 component\n",
      "m5=(M5*y5)/M;#The fraction of H2 component\n",
      "\n",
      "#Result for (b)\n",
      "print \"\\n(b).The fraction of N2,O2,Ar,CO2,H2 components are given below respectively \"\n",
      "print \"m1 =\",round(m1,4)\n",
      "print \"m2 =\",round(m2,4)\n",
      "print \"m3 =\",round(m3,4)\n",
      "print \"m4 =\",round(m4,4)\n",
      "print \"m5 =\",round(m5,4)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Average molecular mass and apperent gas constant of dry atmospheric air \n",
        "Average molecular mass =  28.969 kmol\n",
        "Apperent gas constant of dry atmospheric air = 0.287 kJ/kg K\n",
        "\n",
        "(b).The fraction of N2,O2,Ar,CO2,H2 components are given below respectively \n",
        "m1 = 0.7547\n",
        "m2 = 0.2319\n",
        "m3 = 0.013\n",
        "m4 = 0.0005\n",
        "m5 = 0.0\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.2, Page No:555"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "M1=44; # Molecular mass of CO2\n",
      "M2=32; # Molecular mass of O2\n",
      "M3=28; # Molecular mass of CO\n",
      "M4=28; # Molecular mass of N2\n",
      "y1=0.1; # Part by volume of CO2 in exhaust gas\n",
      "y2=0.06; # Part by volume of O2 in exhaust gas\n",
      "y3=0.03; # Part by volume of CO in exhaust gas\n",
      "y4=0.81; # Part by volume of N2 in exhaust gas\n",
      "R_1=8.3143; # Universal gas constant  in kJ/kmol K\n",
      "\n",
      "#Calculation for (a)\n",
      "# (a).Average molecular mass and apperent gas constant of exhaust gas\n",
      "M=(y1*M1)+(y2*M2)+(y3*M3)+(y4*M4); # Average molecular mass\n",
      "R=R_1/M; #Apperent gas constant of dry atmospheric air\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a).Average molecular mass and apperent gas constant of exhaust gas\",\"\\nAverage molecular mass = \",round(M,3),\"kmol\"\n",
      "print \"Apperent gas constant of exhaust gas =\",round(R,4),\"kJ/kg K\"\n",
      "\n",
      "#Calculation for (b)\n",
      "# (b).The fraction of each component\n",
      "m1=(M1*y1)/M;#The fraction of CO2 component\n",
      "m2=(M2*y2)/M;#The fraction of O2 component\n",
      "m3=(M3*y3)/M;#The fraction of CO component\n",
      "m4=(M4*y4)/M;#The fraction of N2 component\n",
      "print \"\\n(b).The fraction of CO2,O2,CO,N2 components are given below respectively \"\n",
      "print \"m1 =\",round(m1,3)\n",
      "print \"m2 =\",round(m2,3)\n",
      "print \"m3 =\",round(m3,3)\n",
      "print \"m4 =\",round(m4,3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Average molecular mass and apperent gas constant of exhaust gas \n",
        "Average molecular mass =  29.84 kmol\n",
        "Apperent gas constant of exhaust gas = 0.2786 kJ/kg K\n",
        "\n",
        "(b).The fraction of CO2,O2,CO,N2 components are given below respectively \n",
        "m1 = 0.147\n",
        "m2 = 0.064\n",
        "m3 = 0.028\n",
        "m4 = 0.76\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.3, Page No:557"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "y1=0.79; # Volume of Nitrogen in 1 kg of air\n",
      "y2=0.21; # Volume of Oxygen in 1 kg of air\n",
      "R_1=8.3143; # Universal gas constant of air in kJ/kmol K\n",
      "T0=298; # temperature of Surroundings in kelvin\n",
      "\n",
      "#Calculation\n",
      "del_Sgen=-R_1*((y1*math.log (y1))+(y2*math.log (y2))); #Entropy generation\n",
      "LW=T0*del_Sgen; # Minimum work\n",
      "\n",
      "#Result\n",
      "print \"The minimum work required for separation of two gases = \",round(LW,0),\"kJ/kmmol K\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum work required for separation of two gases =  1273.0 kJ/kmmol K\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.4, Page No:562"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "DPT=8; # Dew point temperature in degree celcius\n",
      "p=100; # Pressure of air in kPa\n",
      "T=25; # Temperature of air in degree celcius\n",
      "\n",
      "#Calculation for (a)\n",
      "# (a).partial pressure of water vapour in air\n",
      "pv=1.0854; # Saturation pressure of water at DBT in kPa\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a).partial pressure of water vapour in air = \",pv,\"kPa\"\n",
      "\n",
      "#Calculation for (b)\n",
      "# (b).Specific humidity\n",
      "sh=0.622*pv/(p-pv);#Specific humidity\n",
      "\n",
      "#Result for (b)\n",
      "print \"\\n(b).Specific humidity =\",round(sh,4),\"kg of water vapour /kg of dry air\"\n",
      "\n",
      "#Calculation for (c)\n",
      "# (c).Relative humidity\n",
      "pg=3.169; # Saturation pressure of water at T in kPa\n",
      "RH=pv/pg; #Relative humidity\n",
      "\n",
      "#Result for (c)\n",
      "print \"\\n(c).Relative humidity =\",round(RH*100,2),\"%\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).partial pressure of water vapour in air =  1.0854 kPa\n",
        "\n",
        "(b).Specific humidity = 0.0068 kg of water vapour /kg of dry air\n",
        "\n",
        "(c).Relative humidity = 34.25 %\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.5, Page No:566"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "DBT=35; # Dry bulb temperature in degree celcius\n",
      "WBT=23; # Wet bulb temperature in degree celcius\n",
      "P=100; # Pressure of air in kPa\n",
      "Cpo=1.0035; # Specific heat at constant pressure in kJ/kg K\n",
      "R=0.287; # characteristic gas constant of air in kJ/kg K\n",
      "# (a).Humidity ratio\n",
      "hv=2565.3; # specific enthalpy hg at DBT in kJ/kg \n",
      "hfWBT=96.52; hfgWBT=2443; # specific enthalpy at WBT in kJ/kg \n",
      "PsatWBT=2.789;# Saturation pressure at WBT in kPa\n",
      "\n",
      "#Calculation for (a)\n",
      "shWBT=0.622*PsatWBT/(P-PsatWBT);# specific humidity\n",
      "sh=((Cpo*(WBT-DBT))+(shWBT*hfgWBT))/(hv-hfWBT); # Humidity ratio\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a).Humidity ratio =\",round(sh,4),\"kg w.v /kg d.a\"\n",
      "\n",
      "#Calculation for (b)\n",
      "# (b).Relative Humidity\n",
      "pv=sh*P/(0.622+sh); # Partial pressure of water vapour\n",
      "pg=5.628; # Saturation pressure at DBT in kPa\n",
      "RH=pv/pg; #Relative Humidity\n",
      "\n",
      "#Result for (b)\n",
      "print \"\\n(b).Relative Humidity =\",round(RH*100,2),\"%\"\n",
      "\n",
      "#Calculation for (c)\n",
      "# (c).Dew point temperature\n",
      "DPT=17.5; # Saturation temperature at pg in degree celcius\n",
      "\n",
      "#Result for (c)\n",
      "print \"\\n(c).Dew point temperature =\",DPT,\"oC\"\n",
      "\n",
      "#Calculation for (d)\n",
      "# (d).Specific volume\n",
      "v=(R*(DBT+273))/(P-pv); # Specific volume\n",
      "\n",
      "#Result for (d)\n",
      "print \"\\n(d).Specific volume = \",round(v,1),\"m^3/kg\"\n",
      "\n",
      "#Calculation for (e)\n",
      "# (e).Enthalpy of air\n",
      "h=(Cpo*DBT)+(sh*hv); #Enthalpy of air\n",
      "\n",
      "#Result for (e)\n",
      "print \"\\n(e).Enthalpy of air =\",round(h,0),\"kJ/kg d.a\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Humidity ratio = 0.0128 kg w.v /kg d.a\n",
        "\n",
        "(b).Relative Humidity = 35.78 %\n",
        "\n",
        "(c).Dew point temperature = 17.5 oC\n",
        "\n",
        "(d).Specific volume =  0.9 m^3/kg\n",
        "\n",
        "(e).Enthalpy of air = 68.0 kJ/kg d.a\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.6, Page No:570"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "DPT1=30; # Dew point temperature at inlet in degree celcius\n",
      "DPT2=15; # Dew point temperature at outlet in degree celcius\n",
      "RH1=0.50; # Relative humidity  at inlet\n",
      "RH2=0.80; # Relative humidity  at outlet\n",
      "p=101.325; # Atmospheric pressure in kPa\n",
      "Cpo=1.0035; # Specific heat at constant pressure in kJ/kg K\n",
      "pg1=4.246; # saturation pressure of water at DBT1 in kPa\n",
      "pg2=1.7051;  # saturation pressure of water at DBT2 in kPa\n",
      "pv1=RH1*pg1; pv2=RH2*pg2; # Partial pressure of water vapour in air at inlet and outlet\n",
      "hv1=2556.3;# specific enthalpy hg at DBT1 in kJ/kg\n",
      "hv2=2528.9;# specific enthalpy hg at DBT2 in kJ/kg\n",
      "hv3=63;# specific enthalpy hf at DBT 2in kJ/kg\n",
      "\n",
      "#Calculation\n",
      "sh1=0.622*pv1/(p-pv1); sh2=0.622*pv2/(p-pv2); # Specific humidities at inlet and outlet\n",
      "q=(Cpo*(DPT2-DPT1))+(sh2*hv2)-(sh1*hv1)+((sh1-sh2)*hv3); # Heat transfer\n",
      "\n",
      "#Result\n",
      "print \"Heat removed from the air =\",round(q,1),\"kJ/kg of dry air\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat removed from the air = -27.3 kJ/kg of dry air\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.7, Page No:572"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "y1=0.5; # Molecular mass of CH4 in kmol\n",
      "y2=0.5; # Molecular mass of C3H8 in kmol\n",
      "T=363; # Temperature of gas in kelvin\n",
      "p=5.06; # Pressure of gas in MPa\n",
      "v=0.48; # volume of cylinder in m^3\n",
      "R_1=8.3143; # Universal gas constant of air in kJ/kmol K\n",
      "# (a).Using kay\u2019s rule\n",
      "# let component 1 refer to methane and component 2 to propane\n",
      "# the critical properties\n",
      "Tc1=190.7; Tc2=370; # temperature in kelvin\n",
      "Pc1=46.4; Pc2=42.7; # Pressure in bar\n",
      "\n",
      "#Calculation for (a)\n",
      "# using kay\u2019s rule for the mixture\n",
      "Tcmix=y1*Tc1+y2*Tc2;\n",
      "Pcmix=y1*Pc1+y2*Pc2;\n",
      "# reduced properties\n",
      "Tr=T/Tcmix; Pr=p/Pcmix;\n",
      "# From generalized chart\n",
      "z=0.832;\n",
      "v_1=z*R_1*T/(p*10**3); # molar volume of the mixture\n",
      "d=(v-v_1)/v; # Percentage deviation from actual value\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a).Using kay\u2019s rule\",\"\\nPercentage deviation from actual value = \",round(d*100,1),\"%\"\n",
      "\n",
      "#Calculation for (b)\n",
      "# (b).Using Redlich-Kwong equation of state\n",
      "a1=0.42748*R_1*Tc1**2.5/Pc1;\n",
      "a2=0.42748*R_1*Tc2**2.5/Pc2;\n",
      "b1=0.08664*R_1*Tc1/Pc1;\n",
      "b2=0.08664*R_1*Tc2/Pc2;\n",
      "# Substituting these values in the equation 12.16\n",
      "# And solving these equation by iteration method we get\n",
      "v_1=0.47864;# molar volume of the mixture\n",
      "d=(v-v_1)/v; # Percentage deviation from actual value\n",
      "\n",
      "#Result for (b)\n",
      "print \"\\n(b).Using Redlich-Kwong equation of state\",\"\\nPercentage deviation from actual value = \",round(d*100,1),\"%\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Using kay\u2019s rule \n",
        "Percentage deviation from actual value =  -3.4 %\n",
        "\n",
        "(b).Using Redlich-Kwong equation of state \n",
        "Percentage deviation from actual value =  0.3 %\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.8, Page No:586"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "ln_piCH4=-0.0323;\n",
      "pi_CH4=0.9683;\n",
      "p=6895; # Pressure in kPa\n",
      "T=104.4; # Temperature in degree celcius\n",
      "a=0.784;\n",
      "\n",
      "#Calculation \n",
      "f_CH4=pi_CH4*a*p; # Faguacity\n",
      "\n",
      "#Result\n",
      "print \"The Required Faguacity = \",round(f_CH4,0),\"kPa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Required Faguacity =  5234.0 kPa\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}