summaryrefslogtreecommitdiff
path: root/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch6.ipynb
blob: ce95f23417d393a369aba94be3fbb7ceab3a96e8 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:b5e7bc5aa10585d1f719544046b71d6acecd3da70a2a86327271cc53390af498"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 6 :  Partial Molal Properties"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.1  Page: 108\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "T = 20.             #[C]\n",
      "m_1 = 0.            #[molal]\n",
      "m_2 = 1.            #[molal]\n",
      "\n",
      "# Calculations\n",
      "# The data given in the figure 6.2 , as reported in book, can be repersented with excellent accuracy by a simple data fitting equation\n",
      "#V = 1.0019+0.054668*m-0.000418*m**(2)\n",
      "# Where 'V' is( solution volume, liters per 1000g of water ) and 'm' is the molality of ethanol in water\n",
      "#The partial molal volume is obtained by differentiating the expression of the 'V' with respect to 'm'\n",
      "# v_ethanol = dV/dm = 0.054668-2*0.000418*m\n",
      "# So that at zero molality \n",
      "m = 0               #[molal]\n",
      "# the partial molal volume is \n",
      "v_1 = 0.054668-2*0.000418*m         #[L/mol]\n",
      "# and at\n",
      "m = 1.              #[molal]\n",
      "v_2 = 0.054668-2*0.000418*m         #[L/mol]\n",
      "v_1 = v_1*1000                      #[cm**(3)/mol]\n",
      "v_2 = v_2*1000                      #[cm**(3)/mol]\n",
      "\n",
      "# Results\n",
      "print \"Partial molal volume of ethanol in water at zero molality is  %f cm**3/mol\"%(v_1)\n",
      "print \" Partial molal volume of ethanol in water at unity molality is %f cm**3/mol\"%(v_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Partial molal volume of ethanol in water at zero molality is  54.668000 cm**3/mol\n",
        " Partial molal volume of ethanol in water at unity molality is 53.832000 cm**3/mol\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.2  Page: 109\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "n_eth = 1.          #[mol]\n",
      "W_water = 1.        #[kg]\n",
      "Temp = 20.          #[C]\n",
      "\n",
      "# For pure ethanol at 20C\n",
      "v_ethanol = 58.4            #[cm**(3)/mol]\n",
      "v_ethanol = v_ethanol/1000  # [L/mol]\n",
      "v_water = 1.0019            #[L/1000g]\n",
      "\n",
      "# Calculations\n",
      "# Molality of ethanol in water is\n",
      "m = n_eth/W_water           #[molal]\n",
      "# We have the equation used in the previous example as\n",
      "V_final_mix = 1.0019+0.054668*m-0.000418*m**(2)\n",
      "\n",
      "# Where 'V' is( solution volume, liters per 1000g of water ) and 'm' is the molality of ethanol in water\n",
      "# V is the final volume of the solution \n",
      "# The volume expansion on moxing is \n",
      "V_exp = V_final_mix-v_ethanol-v_water       #[L]\n",
      "V_exp = V_exp*1000                          #[cm**(3)]\n",
      "\n",
      "# Results\n",
      "print \"Volume change on mixing emath.tanol and water is %0.3f cubic cm\"%(V_exp)\n",
      "# We see that there is a net contraction on mixing of the volume of the ethanol added.\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Volume change on mixing emath.tanol and water is -4.150 cubic cm\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.3  Page: 109\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "# All the data are same as in the previous example \n",
      "# The equation 6.5 reported in the book is \n",
      "v_i_average = 0.05425       #[L/mol]\n",
      "# and\n",
      "v_i_0 = 0.0584              #[L/mol]\n",
      "delta_n = 1.00              #[mol]\n",
      "\n",
      "# Calculations\n",
      "delta_V_mixing = (v_i_average-v_i_0)*delta_n        #[L]\n",
      "delta_V_mixing = delta_V_mixing*1000                #[cm**(3)]\n",
      "\n",
      "# Results\n",
      "print \"Volume change on mixing etanol and water is %f cm**3\"%(delta_V_mixing)\n",
      "# Which is same as the solution in example 6.2\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Volume change on mixing etanol and water is -4.150000 cm**3\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.4  Page: 113\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "m = 1.              #[molal] Molality of the solution with respect to ethanol\n",
      "M_water = 18.       #[g/mol] molecular weight of water\n",
      "\n",
      "# Calculations\n",
      "# First we convert molality to mole fraction\n",
      "x_ethanol = m/(m + 1000/M_water)\n",
      "\n",
      "# For the low range of data point on figure 6.5(page 112), we can fit an equation\n",
      "# (Specific volume ) = 0.018032 + 0.037002*x_ethanol - 0.039593*x_ethanol**(2) + 0.21787*x_ethanol**(3)\n",
      "# This is applicable for (0 < x_ethanol < 0.04 ), which is the case we have\n",
      "\n",
      "# So\n",
      "v_math_tan = 0.018032 + 0.037002*x_ethanol - \\\n",
      "0.039593*x_ethanol**(2) + 0.21787*x_ethanol**(3)            #[L/mol]\n",
      "\n",
      "# Now we will find the derivative of the specific volume with respect to x_ethanol at the known point x_ethanol\n",
      "# (dv/dx_ethanol) =  0.037002 - 2*0.039593*x_ethanol + 3*0.21787*x_ethanol**(2)\n",
      "# Hence\n",
      "v_derv_math_tan = 0.037002 - 2*0.039593*x_ethanol + 3*0.21787*x_ethanol**(2)        #[L/mol]\n",
      "\n",
      "# By simple geometry from the figure 6.6(page 113) of the book we find\n",
      "# a = v_math_tan + (1-x_math_tan)*(dv/dx_1)_math_tan\n",
      "# b = v_math_tan - x_math_tan*(dv/dx_1)_math_tan\n",
      "\n",
      "# We have a = v_ethanol and b = v_water\n",
      "x_math_tan = x_ethanol\n",
      "# So\n",
      "v_ethanol = v_math_tan + (1-x_math_tan)*(v_derv_math_tan)       #[L/mol]\n",
      "v_water = v_math_tan - x_math_tan*(v_derv_math_tan)             #[L/mol]\n",
      "\n",
      "# Results\n",
      "print \" Partial molar volume of the ethanol in the given solution is %f L/mol\"%(v_ethanol)\n",
      "print \" Partial molar volume of the water in the given solution is %f L/mol\"%(v_water)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Partial molar volume of the ethanol in the given solution is 0.053848 L/mol\n",
        " Partial molar volume of the water in the given solution is 0.018042 L/mol\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.7  Page: 117\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "\n",
      "import math \n",
      "\n",
      "# Variables\n",
      "x_sulph = 0.6\n",
      "x_water = 0.4\n",
      "Temp = 200.             #[F]\n",
      "# In the given figure 6.8 in the book, drawing the math.tangent to the 200F curve at 60 wt% H2SO4, we find that it intersects the 0%(pure water) axis at      25 Btu/lbm, and the 100% H2SO4 axis at -100Btu/lbm. i.e.\n",
      "h_water_per_pound = 25.         #[Btu/lbm]\n",
      "h_sulph_per_pound = -100.       #[Btu/lbm]\n",
      "# also molecular weight of water and sulphuric acid are\n",
      "M_water = 18.                   #[lbm/lbmol]\n",
      "M_sulph = 98.                   #[lbm/lbmol]\n",
      "\n",
      "# Calculations\n",
      "# Using equation 6.20 given in the book we have\n",
      "h_water = h_water_per_pound*M_water     #[Btu/lbmol]\n",
      "h_sulph = h_sulph_per_pound*M_sulph     #[Btu/lbmol]\n",
      "\n",
      "# Results\n",
      "print \"Partial molar enthalpy of water in the mixture is  %f Btu/lbmol\"%(h_water)\n",
      "print \" Partial molar enthalpy of H2SO4 in the mixture is %f Btu/lbmol\"%(h_sulph)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Partial molar enthalpy of water in the mixture is  450.000000 Btu/lbmol\n",
        " Partial molar enthalpy of H2SO4 in the mixture is -9800.000000 Btu/lbmol\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.8  Page: 119\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "x_sulph = 0.6\n",
      "x_water = 0.4\n",
      "M_i = 18.           #[lbm/lbmol]\n",
      "Temp = 200.         #[F]\n",
      "# From Equation 6.11 as given in the book, we have \n",
      "# dQ/dm_in = h_i-h_in\n",
      "# where h_i is partial molal enthalpy which is taken from the example 6.7 and h_in is the pure species molar enthalpy which is read from the figure 6.8.\n",
      "# So at 200F we have \n",
      "h_i = 25.           #[Btu/lbm]\n",
      "h_in = 168.         #[Btu/lbm]\n",
      "\n",
      "# Calculations\n",
      "# hence\n",
      "dQ_by_dm_in = h_i-h_in          #[Btu/lbm]\n",
      "# Now \n",
      "dQ_by_dn_in = M_i*dQ_by_dm_in       #[Btu/lbmol]\n",
      "\n",
      "# Results\n",
      "print \"The amount of heat removed to keep the temperature consmath.tant is %f Btu/lbm of water added\"%(dQ_by_dm_in)\n",
      "# The negative sign shows that this mixing is exothermic we must remove 143 Btu/lbm of water added.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of heat removed to keep the temperature consmath.tant is -143.000000 Btu/lbm of water added\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.9  Page: 119\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "m_sulph = 0.4\n",
      "m_water = 0.6\n",
      "m = m_sulph+m_water\n",
      "Temp = 200.             #[F]\n",
      "# Here at 200F we can read the solution enthalpy h_solution and pure H2SO4 enthalpy h_sulph such that\n",
      "h_solution = -43.       #[Btu/lbm]\n",
      "h_sulph = 168.           #[Btu/lbm]\n",
      "# By energy balance, umath.sing h_0_water from example 6.7 in the book i.e.\n",
      "h_0_water = 53.        #[Btu/lbm]\n",
      "\n",
      "# We find \n",
      "# Calculations\n",
      "delta_Q = m*h_solution-(m_sulph*h_sulph+m_water*h_0_water)      #[Btu]\n",
      "\n",
      "# Results\n",
      "print \"The amount of heat added or removed is %f Btu\"%(delta_Q)\n",
      "# We must remove the given amount of to hold the temperature consmath.tant.\n",
      "# Note However the book has some mistake in calculation and reporting -172 Btu\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of heat added or removed is -142.000000 Btu\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.10  Page: 120\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "x_sulph = 0.6\n",
      "x_water = 0.4\n",
      "Temp = 200.         #[F]\n",
      "# At the 200F we have\n",
      "h_water = 25.       #[Btu/lbm]\n",
      "h_sulph = -100.     #[Btu/lbm]\n",
      "\n",
      "# Calculations\n",
      "# From equation 6.16 (as reporated in the book), rewritten for masses instead of moles we have \n",
      "h_solution = h_water*x_water+h_sulph*x_sulph        # [Btu/lbm]\n",
      "\n",
      "# Results\n",
      "print \"Enthalpy of the solution is %f Btu/lbm\"%(h_solution)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Enthalpy of the solution is -50.000000 Btu/lbm\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 6.11  Page: 121\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math \n",
      "\n",
      "# Variables\n",
      "x_b = 0\n",
      "x_a = 1\n",
      "# We have\n",
      "#dv_a/dx_a = 3*x_b**(2)+2*x_b\n",
      "# We have the equation \n",
      "# dv_b/dx_a = -(dv_a/dx_a)/(x_b/x_a)\n",
      "# So\n",
      "# dv_b/dx_a = -(x_a/x_b)*(3*x_b**(2)+2*x_b) \n",
      "# Calculations\n",
      "dv_b_by_dx_a = x_a*(-3*x_b-2)\n",
      "\n",
      "# Results\n",
      "print \"Value of the dv_b/dx_a at x_b =0 is %0.0f\"%(dv_b_by_dx_a)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of the dv_b/dx_a at x_b =0 is -2\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}