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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 5 : Properties of Real Gases"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.1 page no: 109"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"V = 0.6 #m**3 vessel\n",
"T = 473. #K temperature\n",
"N = 1. * 10 ** 3 #mol\n",
"R = 8.314 #Pa * m**3/molK\n",
"\n",
"# Calculation \n",
"P = N * R * T / (V * 10**5) \n",
"\n",
"# Result\n",
"print \"(a)Pressure calculated using ideal gas equation = %.2f bar\"%P\n",
"a = 0.4233 #N * m**4 / mol**2\n",
"b = 3.73 * 10**-5 #m**3/mol\n",
"P1 = (R*T/(V/N - b)-a/(V/N)**2)/10**5 \n",
"print \"(a)Pressure calculated using van der waals equation = %.2f bar\"%P1\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)Pressure calculated using ideal gas equation = 65.54 bar\n",
"(a)Pressure calculated using van der waals equation = 58.13 bar\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.2 pageno : 110"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"P = 10.**7 #Pa \n",
"T = 500. #K molar volume\n",
"R = 8.314 #Pa * L / mol K\n",
"N = 1000.\n",
"\n",
"# Calculation \n",
"V = N * R * T / ( P * 1000) \n",
"\n",
"# Result\n",
"print \"(a)Volume of CO2 calculated using ideal gas equation = %.4e m**3\"%V\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)Volume of CO2 calculated using ideal gas equation = 4.1570e-04 m**3\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.3 pageno : 111"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"V = 0.6 * 10**-3 #m**3\n",
"T = 473. #K vellel of volume\n",
"Tc = 405.5 #K temperature\n",
"Pc = 112.8 * 10 ** 5 #Pa pressure\n",
"R = 8.314 \n",
"\n",
"# Calculation \n",
"a = 0.4278 * (R**2) * (Tc ** 2.5)/Pc \n",
"b = 0.0867 * R * Tc / Pc \n",
"P1 = (R*T/(V - b) - a/((T**0.5)*V*(V + b)))/10**5 \n",
"\n",
"# Result\n",
"print \"Pressure developed by gas = %.2f bar\"%P1\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Pressure developed by gas = 57.87 bar\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.4 pageno : 112"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"P = 10.**6 #Pa\n",
"T = 373. #K molar volume\n",
"Tc = 405.5 #K temperature\n",
"Pc = 112.8 * 10 ** 5 #Pa pressure\n",
"R = 8.314 \n",
"\n",
"# Calculation \n",
"a = 0.4278 * (R**2) * (Tc ** 2.5)/Pc \n",
"b = 0.0867 * R * Tc / Pc \n",
"#P1 = (R*T/(V - b) - a/((T**0.5)*V*(V + b)))/10**5 \n",
"#10**6=((8.314*373)/(V-2.59*10**-5))-8.68/((373**0.5)*V*(V+2.59*10**-5) \n",
"#solving this we get,\n",
"V = 3.0 * 10**-3 #m**3/mol\n",
"\n",
"# Result\n",
"print \"molar volume of gas = %.e m**3/mol\"%V\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"molar volume of gas = 3e-03 m**3/mol\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.5 pageno : 112"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"B = -2.19 * 10**-4 #m**3/mol virial coefficients\n",
"C = -1.73 * 10**-8 #m**6/mol**2\n",
"P = 10. #bar molar volume\n",
"T = 500. #K\n",
"\n",
"# Calculation \n",
"#virial equation is given as, Z = PV/RT = 1 + B/V + C/V**2\n",
"#V = (RT/P)*(1 + B/V + C/V**2)\n",
"# now by assuming different values for V on RHS and checking for corresponding V on LHS, we have to assume such value of V on RHS by which we get the same value for LHS V\n",
"#by trial and error we get,\n",
"V = 3.92 * 10**-3 #m**3\n",
"\n",
"# Result\n",
"print \"Molar volume of methanol = %.3e m**3\"%V\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Molar volume of methanol = 3.920e-03 m**3\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.6 pageno : 120"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"T = 510. #K molar volume\n",
"P = 26.6 #bar \n",
"Tc = 425.2 #K temperature\n",
"Pc = 38. #bar pressure\n",
"Zc = 0.274 # compressibility factor\n",
"R = 8.314 \n",
"\n",
"# Calculation \n",
"Pr = P / Pc \n",
"Tr = T / Tc \n",
"\n",
"# Result\n",
"print \"Pr = \",Pr\n",
"print \"Tr = %.2f\"%Tr\n",
"\n",
"#From fig. 5.4 and 5.5 from the text book\n",
"Z = 0.865 \n",
"D = 0.15 \n",
"Z1 = Z + D * ( Zc - 0.27) \n",
"V = R * T * Z1 / (P * 10**5) \n",
"print \"Molar volume of n-butane = %.4e m**3/mol\"%V\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Pr = 0.7\n",
"Tr = 1.20\n",
"Molar volume of n-butane = 1.3798e-03 m**3/mol\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.7 pageno : 120"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"T = 510. #K molar volumes\n",
"P = 26.6 #bar\n",
"Tc = 425.2 #K temperature\n",
"Pc = 38. #bar pressure\n",
"w = 0.193 # acentric factor\n",
"R = 8.314 \n",
"\n",
"# Calculation \n",
"Pr = P / Pc \n",
"Tr = T / Tc \n",
"\n",
"# Result\n",
"print \"Pr = \",Pr\n",
"print \"Tr = %.2f\"%Tr\n",
"\n",
"#From fig. 5.6 and 5.7 from the text book\n",
"Z0 = 0.855 \n",
"Z1 = 0.042 \n",
"Z = Z0 + w*Z1 \n",
"print \"Z = %.4f\"%Z\n",
"V = R * T * Z / (P * 10**5) \n",
"\n",
"print \"Molar volume of n-butane = %.4e m**3/mol\"%V\n",
"\n",
"# note : answer may vary because of rounding error."
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Pr = 0.7\n",
"Tr = 1.20\n",
"Z = 0.8631\n",
"Molar volume of n-butane = 1.3758e-03 m**3/mol\n"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.8 pageno : 122"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from numpy import *\n",
"# variables \n",
"P = 6000. #kPa ethane\n",
"T = 325. #K ethane\n",
"xn2 = 0.4 # gas mixture\n",
"xethane = 0.6 \n",
"an2 = 0.1365 #N m**4 / mol**2 nitrogen\n",
"\n",
"# Calculation \n",
"bn2 = 3.86 * 10**-5 #m**3/mol\n",
"aethane = 0.557 #N m**4 / mol**2\n",
"bethane = 6.51 * 10**-5 #m**3/mol\n",
"Pcn2 = 3394. #kPa\n",
"Tcn2 = 126.2 #K\n",
"Pcethane = 4880. #kPa\n",
"Tcethane = 305.4 #K\n",
"R = 8.314 \n",
"\n",
"\n",
"# Result\n",
"V = R * T / (P*1000) \n",
"print \"(a)Molar volume by ideal gas equation = %.3e m**3/mol\"%V\n",
"\n",
"\n",
"a = (xn2 * (an2**0.5) + xethane * (aethane**0.5))**2 \n",
"b = (xn2*bn2 + xethane*bethane) \n",
"#substituting the above values in van der waals equation, and solving, we get\n",
"#V^3 - 5.0484*10^-4V^2+5.9117*10^-8V-3.2214*10^-12=0\n",
"#Using co-efficients from the above equation,\n",
"coeff = [1, -5.0484e-4, 5.9117e-8, -3.2217e-12]\n",
"x = roots(coeff)\n",
"y = x[0]\n",
"print \"(b)Molar volume by van der waals equation =\",round((y.real)/1e-4,3),\"*10^-4 m**3/mol\"\n",
"\n",
"\n",
"Prin2 = P/Pcn2 \n",
"Trin2 = T/Tcn2 \n",
"Priethane = P/Pcethane \n",
"Triethane = T/Tcethane \n",
"# using compressibilty chart, \n",
"Zn2 = 1 \n",
"Zethane = 0.42 \n",
"Z = xn2 * Zn2 + xethane * Zethane \n",
"V2 = Z * R * T / P * (10**-3)\n",
"print \"(c)Molar volume based on compressibilty factor = %.2e m**3/mol\"%V2\n",
"\n",
"\n",
"Pri1n2 = xn2*P/Pcn2 \n",
"Tri1n2 = T/Tcn2 \n",
"Pri1ethane = xethane*P/Pcethane \n",
"Tri1ethane = T/Tcethane \n",
"# using compressibilty chart, \n",
"Zn21 = 1. \n",
"Zethane1 = 0.76 \n",
"Z1 = xn2 * Zn21 + xethane * Zethane1 \n",
"V3 = (Z1 * R * T / P ) * (10**-3)\n",
"print \"(c)Molar volume based on daltons law = %.3e m**3/mol\"%V3\n",
"\n",
"\n",
"Tc = xn2 * Tcn2 + xethane * Tcethane \n",
"Pc = xn2 * Pcn2 + xethane * Pcethane \n",
"Zc = 0.83 \n",
"V4 = Zc * R *T / P * (10**-3)\n",
"print \"(d)Molar volume by kays method = %.3e m**3/mol\"%V4\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)Molar volume by ideal gas equation = 4.503e-04 m**3/mol\n",
"(b)Molar volume by van der waals equation = 3.68 *10^-4 m**3/mol\n",
"(c)Molar volume based on compressibilty factor = 2.94e-04 m**3/mol\n",
"(c)Molar volume based on daltons law = 3.855e-04 m**3/mol\n",
"(d)Molar volume by kays method = 3.738e-04 m**3/mol\n"
]
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5.9 page no : 124"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables \n",
"P1 = 40. #% ( nitrogen )\n",
"P2 = 60. #% ( ethane )\n",
"T = 325. #K ethane\n",
"\n",
"# Calculation \n",
"V = 4.5 * 10**-4 #m**3/mol\n",
"a1 = 0.1365 #N*m**4/mol**2\n",
"b1 = 3.86 * 10 ** -5 #m**3/mol\n",
"a2 = 0.557 #N*m**4/mol**2\n",
"b2 = 6.51 * 10 ** -5 #m**3/mol\n",
"Pc1 = 3394. #kPa\n",
"Tc1 = 126.1 #K\n",
"Pc2 = 4880. #kPa\n",
"Tc2 = 305.4 #K\n",
"R = 8.314 \n",
"Pideal = R * T / (V * 1000) #kPa\n",
"\n",
"# Result\n",
"print \"(a)Pressure of Gas by the ideal gas equation = %.f kPa\"%Pideal\n",
"y1 = P1/100. \n",
"y2 = P2/100. \n",
"a = (y1 * (a1**(1./2)) + y2 * (a2**(1./2)))**2 \n",
"b = y1 * b1 + y2 * b2 \n",
"Pv = ((R * T / (V - b)) - a / (V**2))/1000 \n",
"print \"(b)Pressure of Gas by Van der waals equation = %.f kPa\"%Pv\n",
"Tc = y1*Tc1 + y2*Tc2 \n",
"Pc = y1*Pc1 + y2*Pc2 \n",
"Vc = R * Tc / Pc #Pseudo critical ideal volume\n",
"Vr = V / Vc #Pseudo reduced ideal volume\n",
"Tr = T / Tc #Pseudo reduced temperature\n",
"\n",
"#From fig 5.3, we get Pr = 1.2\n",
"Pr = 1.2 \n",
"Pk = Pr * Pc \n",
"print \"(c)Pressure of Gas by the Kays method = %.f kPa\"%Pk\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)Pressure of Gas by the ideal gas equation = 6005 kPa\n",
"(b)Pressure of Gas by Van der waals equation = 5080 kPa\n",
"(c)Pressure of Gas by the Kays method = 5143 kPa\n"
]
}
],
"prompt_number": 22
}
],
"metadata": {}
}
]
}
|