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
|
{
"metadata": {
"name": "",
"signature": "sha256:af5e98897fdd6a212dc067e1708c75ce618fcbb9ad24c85104d033a4702b884e"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 6 : Thermodynamic Properties of Pure Fluids"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.1 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#Given:\n",
"betta = 1.25*10**-3; \t\t\t#coeffecient of math.expansion (K**-1)\n",
"V = 0.1; \t\t\t#molar volume of organic liquid (m**3/kmol)\n",
"P2 = 20.; \t\t\t#final pressure (bar)\n",
"P1 = 1.; \t\t\t#initial pressure (bar)\n",
"\n",
"# Calculations\n",
"#To determine the change in entropy of system\n",
"#betta = (1/V)*(del V/del T)p\n",
"#Let k = (del V/del T)p\n",
"k = betta*V;\n",
"\n",
"#Considering Maxwell's relation Eq. 6.24 (Page no. 193)\n",
"#dS = -k*(dP)\n",
"S = -k*(P2-P1)*10**5; \t\t\t#entropy change (J/kmol K)\n",
"\n",
"# Results\n",
"print 'Change in entropy is %f J/kmol K'%S\n",
"print ' It is assumed that (del V/del T)p is constant in the pressure range 1 to 20 bar'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Change in entropy is -237.500000 J/kmol K\n",
" It is assumed that (del V/del T)p is constant in the pressure range 1 to 20 bar\n"
]
}
],
"prompt_number": 18
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.2"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"\n",
"# Variables\n",
"T1 = 363.; \t\t\t#temperature (K)\n",
"T2 = 373.; \t\t\t#temperature (K)\n",
"P2 = 101.3; \t\t\t#vapour pressure at 373 K (kPa)\n",
"H = 2275.*18; \t\t\t#mean heat of vaporisation (kJ/kmol)\n",
"R =8.314; \t\t\t#ideal gas constant (kJ/kmol K)\n",
"\n",
"# Calculations\n",
"#To calculate vapour pressure of water at 363 K\n",
"#Using eq. 6.28 (Page no. 196)\n",
"P1 = P2/(math.e**((H/R)*((1./T1)-(1./T2))))\n",
"\n",
"# Results\n",
"print ' Vapour pressure of water at 363 K is %f kPa'%P1\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" Vapour pressure of water at 363 K is 70.408579 kPa\n"
]
}
],
"prompt_number": 19
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.3"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"d_l = 13.69*10**3; \t\t\t#density of mercury in liquid state (kg/m**3)\n",
"d_s = 14.193*10**3; \t\t\t#density of mercury in solid state (kg/m**3)\n",
"T1 = 234.33; \t\t\t#temperature in K\n",
"P1 = 1.; \t\t\t#initial pressure in bar\n",
"P2 = 10.; \t\t\t#final pressure in bar\n",
"Hf = 9.7876; \t\t\t#heat of fusion of mercury (kJ/kg)\n",
"\n",
"# Calculations\n",
"#Assuming del_V/del_H remains constant% math.log(T2/T1) = (del_V/del_H)*(P2-P1)\n",
"del_V = (1./d_l)-(1./d_s)\n",
"T2 = T1*(math.e**((del_V/Hf)*(P2-P1)))\n",
"\n",
"# Results\n",
"print 'The melting point of mercury at 10 bar is %f K'%T2\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The melting point of mercury at 10 bar is 234.330558 K\n"
]
}
],
"prompt_number": 20
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.4, page no:198"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"T1 = 300.; \t\t\t#initial temperature (K)\n",
"T2 = 800.; \t\t\t#final temperature (K)\n",
"\n",
"# Calculations\n",
"#Heat capacity (J/mol K)\n",
"#Cp = 26.04+(5.586*10**-3*T)+(28.476*10**4*T**-2)\n",
"import math\n",
"S = 26.04*math.log(T2/T1)+5.586*10**-3*(T2-T1)+28.476*10**4/(-2)*(T2**-2-T1**-2)\n",
"\n",
"# Results\n",
"print 'The increase in entropy of solid magnesium is %f J/mol K'%S\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The increase in entropy of solid magnesium is 29.693325 J/mol K\n"
]
}
],
"prompt_number": 21
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.7"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"T = 773.; \t\t\t#temperature (K)\n",
"P = 100.; \t\t\t#pressure (bar)\n",
"Ho = 0; \t\t\t#enthalpy of nitrogen at 273 K and 1 bar\n",
"So = 192.4; \t\t\t#entropy of nitrogen at 298 K and 1 bar\n",
"To = 273.; \t\t\t#(K)\n",
"Po = 1.; \t\t\t#(bar)\n",
"R = 8.314; \t\t\t#ideal gas constant (kJ/kmol K)\n",
"\n",
"# Calculations\n",
"#Cp = 27.3+(4.2*10**-3*T) molal heat capacity at 1 bar\n",
"#To calculate internal energy enthalpy entropy and free energyfor one mole of nitrogen\n",
"#Step 1:\n",
"#Assuming that nitrogen is initially at 273 K and 1 bar\n",
"#del_H1 = intg(CpdT)\n",
"del_H1 = 27.3*(T-To)+4.2*10**-3*(T**2-To**2)/2;\n",
"#Assuming that nitrogen is initially at 298 K and 1 bar\n",
"#del_S1 = intg(Cp*(dT/T))\n",
"del_S1 = 27.3*math.log(T/To)+4.2*10**-3*(T-To)\n",
"H1 = Ho + del_H1;\n",
"S1 = So + del_S1;\n",
"\n",
"#Step 2:\n",
"#del_H2 = [V - T*(del_V/del_T)p]dP\n",
"#Since nitrogen behaves as ideal gas\n",
"#(del_V/del_T)p = R/P% V-(R*T)/P = 0\n",
"del_H2 = 0.;\n",
"del_S2 = -R*math.log(P/Po)\n",
"H = H1 + del_H2;\n",
"S = S1 + del_S2;\n",
"\n",
"#Internal energy: U = H-PV = H-RT (J/mol)\n",
"U = H - (R*T)\n",
"\n",
"#Gibbs free energy (J/mol)\n",
"G = H-(T*S)\n",
"\n",
"# Results\n",
"print 'Enthalpy is %5.3e J/mol'%H\n",
"print ' Entropy is %f J/mol K'%S\n",
"print ' Internal energy is %4.3e J/mol'%U\n",
"print ' Gibbs free energy is %4.3e J/mol'%G\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Enthalpy is 1.475e+04 J/mol\n",
" Entropy is 184.626653 J/mol K\n",
" Internal energy is 8.322e+03 J/mol\n",
" Gibbs free energy is -1.280e+05 J/mol\n"
]
}
],
"prompt_number": 22
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.8"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"#Equation of state: P(V-B) = RT + (A*P**2)/T\n",
"Cp = 33.6; \t\t\t#mean specific heat at atmosheric pressure (J/mol K)\n",
"A = 1*10**-3; \t\t\t#m**3 K/(bar)mol\n",
"B = 8.0*10**-5; \t\t\t#m**3/mol\n",
"R = 8.314*10**-5; \t\t\t#ideal gas constant (m**3 (bar)/mol K)\n",
"\n",
"import math\n",
"#For step 1:\n",
"Po = 4.; \t\t\t#pressure at A (bar)\n",
"P1 = 1.; \t\t\t#pressure at C (bar)\n",
"T = 300.; \t\t\t#temperature (K)\n",
"\n",
"# Calculations and Results\n",
"#del_S1 = intg[(del_V/del_T)pdP]\n",
"del_S1 = (R*math.log(Po/P1) - (A/T**2)*(Po**2-P1**2)/2)*10**5; \t\t\t#(J/mol K)\n",
"\n",
"#For step 2:\n",
"T1 = 300.; \t\t\t#temperature at C (K)\n",
"T2 = 400.; \t\t\t#temperature at D (K)\n",
"del_S2 = Cp*math.log(T2/T1) \t\t\t#(J/mol K)\n",
"\n",
"#For step 3:\n",
"P2 = 1.; \t\t\t#pressure at D (bar)\n",
"P3 = 12.; \t\t\t#pressure at B (bar)\n",
"T = 400.; \t\t\t#temperature (K)\n",
"del_S3 = (R*math.log(P2/P3) - (A/T**2)*(P2**2-P3**2)/2)*10**5; \t\t\t#(J/mol K)\n",
"S = del_S1+del_S2+del_S3; \t\t\t#total entropy change\n",
"print '(a). Total entropy change is %f J/mol K'%S\n",
"\n",
"#(b). The mean heat capacity at 12 bar\n",
"P1 = 4.; \t\t\t#pressure at A (bar)\n",
"P2 = 12.; \t\t\t#pressure at Co (bar)\n",
"T = 300.; \t\t\t#temperature (K)\n",
"del_S1 = R*math.log(P1/P2) - (A/T**2)*(P1**2-P2**2)/2;\n",
"\n",
"#For CoB\n",
"T2 = 400.; \t\t\t#temperature at B (K)\n",
"T1 = 300.; \t\t\t#temperature at Co (K)\n",
"del_S2 = S-del_S1;\n",
"Cpm = del_S2/(math.log(T2/T1))\n",
"print ' (b). The mean heat capacity at 12 bar is %f J/mol K'%Cpm\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a). Total entropy change is 0.568609 J/mol K\n",
" (b). The mean heat capacity at 12 bar is 1.976835 J/mol K\n"
]
}
],
"prompt_number": 23
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.10"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"betta = 1.8*10**-4; \t\t\t#coeffecient of volume math.expansion (K**-1)\n",
"k = 3.9*10**-6; \t\t\t#coeffecient of compressibility (bar**-1)\n",
"T = 273.; \t\t\t#temperature in K\n",
"d = 13.596*10**3; \t\t\t#density (kg/m**3)\n",
"Cp = 0.14*10**3; \t\t\t#(J/kg K)\n",
"\n",
"# Calculations\n",
"#To calculate Cv for mercury\n",
"#Using equation 6.55 (Page no. 208)\n",
"Cv = Cp - (betta**2*T*10**5)/(k*d)\n",
"\n",
"# Results\n",
"print 'Cv for mercury is %f J/kg K'%Cv\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Cv for mercury is 123.318623 J/kg K\n"
]
}
],
"prompt_number": 24
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.21"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"#Eqution of state: P(V-b) = RT\n",
"P = 10.; \t\t\t#pressure (bar)\n",
"T = 298.; \t\t\t#temperature (K)\n",
"b = 3.707*10**-5; \t\t\t#Vander Waal's constant (m**3/mol)\n",
"R = 8.314; \t\t\t#ideal gas constant\n",
"\n",
"# Calculations\n",
"#To estimate the fugacity of ammonia\n",
"#Since PV = RT + Pb% Z = 1 + (Pb/RT)\n",
"#Using equation 6.127 (Page no. 228)\n",
"f = P*(math.e**((b*P*10**5)/(R*T)))\n",
"\n",
"# Results\n",
"print 'Fugacity f = %f bar'%f\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Fugacity f = 10.150747 bar\n"
]
}
],
"prompt_number": 25
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.22"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"#intg(alphadP) = -556.61 J/mol\n",
"P = 50.; \t\t\t#pressure in bar\n",
"T = 300.; \t\t\t#temperature in K\n",
"R = 8.314; \t\t\t#ideal gas constant\n",
"\n",
"# Calculations\n",
"#To determine the fugacity of gas\n",
"#Using equation 6.130 (Page no. 230)\n",
"f = P*math.e**(-556.61/(R*T))\n",
"\n",
"# Results\n",
"print 'Fugacity of gas at 50 bar and 300 K is %i bar'%f\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Fugacity of gas at 50 bar and 300 K is 39 bar\n"
]
}
],
"prompt_number": 26
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.23"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"#Equation of state: PV = RT(1-0.00513P)\n",
"P = [1, 5, 10]; \t\t\t#pressures in bar\n",
"phi = [0,0,0]\n",
"\n",
"# Calculations and Results\n",
"for i in range(3):\n",
" phi[i] = math.e**(-0.00513*P[i])\n",
" print ' Fugacity coeffecient at %i bar is %f'%(P[i],phi[i])\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" Fugacity coeffecient at 1 bar is 0.994883\n",
" Fugacity coeffecient at 5 bar is 0.974676\n",
" Fugacity coeffecient at 10 bar is 0.949994\n"
]
}
],
"prompt_number": 27
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.25"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"P = 100.; \t\t\t#pressure in bar\n",
"T = 373.; \t\t\t#temperature in K\n",
"a = 0.453; \t\t\t#Vander Waal's constant (J m**3/mol**2)\n",
"b = 0.571*10**-4; \t\t\t#Vander Waal's constant (m**3/mol)\n",
"V = 2.072*10**-4; \t\t\t#molar volume (m**3/mol)\n",
"R = 8.314; \t\t\t#ideal gas constant\n",
"\n",
"# Calculations\n",
"#To determine the fugacity of pure ethylene\n",
"#Using eq. 6.139 (Page no. 233)\n",
"ln_f = (b/(V-b)) - ((2*a)/(R*T*V)) + math.log((R*T*10**-5)/(V-b) )\n",
"f = math.e**ln_f;\n",
"\n",
"# Results\n",
"print 'Fugacity is %f bar'%f\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Fugacity is 73.789328 bar\n"
]
}
],
"prompt_number": 28
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.26"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"T = 623.; \t\t\t#temperature in K\n",
"\n",
"#Data from steam tables:\n",
"H = 3159.; \t\t\t#enthalpy at 1000 kPa and 623 K (kJ/kg)\n",
"S = 7.3; \t\t\t#entropy at 1000 kPa and 623 K (kJ/kg K)\n",
"Ho = 3176.; \t\t\t#enthalpy at 101.3 kPa and 623 K (kJ/kg)\n",
"So = 8.38; \t\t\t#entropy at 101.3 kPa and 623 K (kJ/kg K)\n",
"fo = 101.3; \t\t\t#fugacity at 101.3 kPa (kPa)\n",
"R = 8.314/18; \t\t\t#ideal gas consatnt (kJ/kg K)\n",
"\n",
"# Calculations\n",
"#To determine fugacity and fugacity coeffecient of steam\n",
"ln_phi = (1/(R*T))*((H-Ho)-T*(S-So))\n",
"f = fo*math.e**ln_phi;\n",
"phi = f/fo;\n",
"\n",
"# Results\n",
"print 'Fugacity of steam is %f bar'%(f/100)\n",
"print ' Fugacity coeffecient is %f'%phi\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Fugacity of steam is 9.895333 bar\n",
" Fugacity coeffecient is 9.768345\n"
]
}
],
"prompt_number": 29
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.27"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"T = 473.; \t\t\t#temperature in K\n",
"P = 50.*10**5; \t\t\t#pressure in Pa\n",
"d = 24.3; \t\t\t#density of ammonia (kg/m**3)\n",
"m = 17.; \t\t\t#molecular wt of ammonia\n",
"R = 8.314; \t\t\t#ideal gas constant\n",
"\n",
"# Calculations\n",
"#To estimate the fugacity of ammonia\n",
"V = m/(d*1000) \t\t\t#molar volume of ammonia (m**3/kmol)\n",
"#Using eq. 6.142 (Page no. 234)\n",
"f = (V*(P**2))/(R*T)\n",
"\n",
"# Results\n",
"print 'The fugacity of ammonia is %f bar'%(f/10**5)\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The fugacity of ammonia is 44.474543 bar\n"
]
}
],
"prompt_number": 30
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.28"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"T = 303.; \t\t\t#temperature in K\n",
"P = 10.; \t\t\t#pressure in bar\n",
"Ps = 4.241/100; \t\t\t#saturation pressure (bar)\n",
"sp_vol = 1.004 *10**-3; \t\t\t#specific volume at 303 K (m**3/kg)\n",
"R = 8.314; \t\t\t#ideal gas constant\n",
"\n",
"# Calculations\n",
"#To calculate the fugacity of liquid water\n",
"V = sp_vol*10**-3*18; \t\t\t#molar volume (m**3/mol)\n",
"#Assuming vapour behaves as an ideal gas\n",
"f_sat = Ps;\n",
"#Using Eq. 6.144 (Page no. 235)\n",
"ln_phi = (V/(R*T))*(P-Ps)*10**5;\n",
"f = f_sat*math.e**ln_phi;\n",
"\n",
"# Results\n",
"print 'Fugacity of liquid water at given conditions is %f bar'%f\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Fugacity of liquid water at given conditions is 0.042714 bar\n"
]
}
],
"prompt_number": 32
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.29"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"T = 350.; \t\t\t#temperature in K\n",
"P = 60.; \t\t\t#pressure in bar\n",
"Ps = 9.35; \t\t\t#vapour pressure at 350 K (bar)\n",
"V = 0.1072*10**-3; \t\t\t#molar volume (m**3/mol\n",
"phi = 0.834; \t\t\t#fugacity coeffecient\n",
"R = 8.314; \t\t\t#ideal gas constant\n",
"import math\n",
"\n",
"# Calculations\n",
"#To determine fugaity of n butane in liquid state at given conditions\n",
"f_sat = phi*Ps;\n",
"#Using eq. 6.144 (Page no. 235)\n",
"ln_phi = (V/(R*T))*(P-Ps)*10**5;\n",
"f = f_sat*math.e**ln_phi;\n",
"\n",
"# Results\n",
"print 'Fugacity of n-butane in liquid state at given conditions is %f bar'%f\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Fugacity of n-butane in liquid state at given conditions is 9.397539 bar\n"
]
}
],
"prompt_number": 33
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 6.30"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variables\n",
"M = 24.32; \t\t\t#molecular wt of solid magnesium\n",
"T = 300.; \t\t\t#temperature in K\n",
"P = 10.; \t\t\t#pressure in bar\n",
"Po = 1.; \t\t\t#reference state pressure (bar)\n",
"R = 8.314\n",
"d = 1.745*10**3; \t\t\t#density of Mg at 300 K in kg/m**3\n",
"\n",
"# Calculations\n",
"#To determine the ativity of solid magnesiun\n",
"#Using eq. 6.149 (Page no. 237)\n",
"ln_a = (M/(d*10**3*R*T))*(P-Po)*10**5;\n",
"a = (math.e)**ln_a;\n",
"\n",
"# Results\n",
"print 'Acivity of solid magnesium at 300 K and 10 bar is %f'%a\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Acivity of solid magnesium at 300 K and 10 bar is 1.005042\n"
]
}
],
"prompt_number": 34
}
],
"metadata": {}
}
]
}
|