summaryrefslogtreecommitdiff
path: root/sample_notebooks/MohdGufran/MohdGufran_version_backup/chapter_10.ipynb
blob: 7d0f1d7b4d7af8718cead9a5b7f8642df65e8b2f (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter No - 10 : Mass Transfer\n",
      "    "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  10.1 - Page No. : 318"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "# Given data\n",
      "P1=4     # in bar\n",
      "P2=2     # in bar\n",
      "T=25     # in degree C\n",
      "Dhp=9*10**-8     # in m**2/s\n",
      "S=3*10**-3     # in kg mole/m**3 bar\n",
      "del_x=0.5*10**-3     # thickness in m\n",
      "#(a) The molar concentration of a gas in terms of solubility\n",
      "CH1=S*P1     # in kg mole/m**3\n",
      "CH2=S*P2     # in kg mole/m**3\n",
      "#(b) Molar diffusion flux of hydrogen through plastic memberence is given by Fick's law of diffision\n",
      "#N_H= N_h/A = Dhp*(CH1-CH2)/del_x#\n",
      "N_H= Dhp*(CH1-CH2)/del_x     # in kg mole/s-m**2\n",
      "print \"Molar diffusion flux of hydrogen through the membrane = %0.2e kg mole/s-m**2\" %N_H\n",
      "#Mass_d_Flux= N_H*Molecular_Weight \n",
      "Molecular_Weight=2#\n",
      "Mass_d_Flux= N_H*Molecular_Weight \n",
      "print \"Molar diffusion flux = %0.3e kg/s-m**2\" %Mass_d_Flux"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Molar diffusion flux of hydrogen through the membrane = 1.08e-06 kg mole/s-m**2\n",
        "Molar diffusion flux = 2.160e-06 kg/s-m**2\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  10.2 - Page No. : 322"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "T=25     # in degree C\n",
      "T=T+273     # in K\n",
      "P=1#\n",
      "V1=12     #Molecular volume of H2 in cm**3/gm mole\n",
      "V2=30     #Molecular volume of Air in cm**3/gm mole\n",
      "M1=2     # Molecular weight of H2\n",
      "M2=29     # Molecular weight of Air\n",
      "#The diffusion coefficient for gases in terms of molecular volumes may be express as\n",
      "D_AB= .0043*T**(3/2)/(P*(V1**(1/3)+V2**(1/3)))*(1/M1+1/M2)**(1/2)#\n",
      "print \"The diffusion coefficient for gases in terms of molecular volumes = %0.3f cm**2/sec\" %D_AB"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The diffusion coefficient for gases in terms of molecular volumes = 2.997 cm**2/sec\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  10.3 - Page No. : 322"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "T=300     # temp of gas mixture in K\n",
      "D_HN2=18*10**-6     # in m**2/s at 300 K, 1 bar\n",
      "T1=300     # in K\n",
      "D_HO2=16*10**-6     # in m**2/s at 273 K, 1 bar\n",
      "T2=273     # in K\n",
      "O_2=0.2#\n",
      "N_2=0.7#\n",
      "H_2=0.1#\n",
      "#The diffusivity at the mixture temperature and pressure are calculated as \n",
      "# D1/D2 = (T1/T2)**(3/2)*(P2/P1)\n",
      "D_HO2= (T/T2)**(3/2)*1/4*D_HO2#\n",
      "D_HN2= (T/T1)**(3/2)*1/4*D_HN2#\n",
      "#The composition of oxygen and nitrogen on a H2 free basis is \n",
      "x_O= O_2/(1-H_2)#\n",
      "x_N= N_2/(1-H_2)#\n",
      "\n",
      "# The effective diffusivity for the gas mixture at given temperature and pressure is\n",
      "D= 1/(x_O/D_HO2+x_N/D_HN2)     # in m**2/s\n",
      "print \"Effective diffusivity = %0.3e m**2/s\" %D"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Effective diffusivity = 4.524e-06 m**2/s\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  10.4 - Page No. : 323"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "# Given data\n",
      "d=3     # in mm\n",
      "d=d*10**-3     # in meter\n",
      "T=25     # in \u00b0C\n",
      "T=T+273     # in K\n",
      "D= 0.4*10**-4     # in m**2/s\n",
      "R= 8314#\n",
      "P_A1=1     # in atm\n",
      "P_A1=P_A1*10**5     # in w/m**2\n",
      "P_A2=0#\n",
      "C_A2=0#\n",
      "x2= 15     # in meter\n",
      "x1= 0#\n",
      "A= pi/4*d**2#\n",
      "M_A= D*A/(R*T)*(P_A1-P_A2)/(x2-x1)     # in kg mole/sec\n",
      "N_B= M_A#\n",
      "M_B= M_A*29     # in kg/sec\n",
      "print \"Value of N_B = %0.3e kg mole/sec\" %N_B\n",
      "print \"Value of M_B = %0.3e kg /sec\" %M_B"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of N_B = 7.608e-13 kg mole/sec\n",
        "Value of M_B = 2.206e-11 kg /sec\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  10.5 - Page No. : 325"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log\n",
      "# Given data\n",
      "P=3     # in atm\n",
      "P=P*10**5     # in N/m**2\n",
      "r1=10     # in mm\n",
      "r1=r1*10**-3     # in m\n",
      "r2=20     # in mm\n",
      "r2=r2*10**-3     # in m\n",
      "R=4160     # in J/kg-K\n",
      "T=303     # in K\n",
      "D=3*10**-8     # in m**2/s\n",
      "S=3*0.05# # Solubility of hydrogen at a pressure of 3 atm in m**3/m**3 of rubber tubing\n",
      "del_x=r2-r1     # in m\n",
      "L=1     # in m\n",
      "Am=2*pi*L*del_x/log(r2/r1)#\n",
      "#Formula P*V= m*R*T\n",
      "V=S#\n",
      "m=P*V/(R*T)     # in kg/m**3 of rubber tubing at the inner surface of the pipe\n",
      "C_A1=m#\n",
      "C_A2=0#\n",
      "#Diffusion flux through the cylinder is given\n",
      "M=D*(C_A1-C_A2)*Am/del_x#\n",
      "print \"Diffusion flux through the cylinder = %0.2e kg/sm\" %M"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diffusion flux through the cylinder = 9.71e-09 kg/sm\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  10.6 - Page No. :  329"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "R=4160     # in J/kg-K\n",
      "M=2#\n",
      "D_AB=1.944*10**-8     # in m**2/s\n",
      "R_H2=R/M#\n",
      "S=2*0.0532# # Solubility of hydrogen at a pressure of 2 atm in cm**3/cm**3 of pipe\n",
      "P=2     # in atm\n",
      "P=P*1.03*10**5     # N/m**2\n",
      "T=25     # in degree C\n",
      "T=T+273     # in K\n",
      "r1=2.5     # in mm\n",
      "r1=r1*10**-3     # in m\n",
      "r2=5     # in mm\n",
      "r2=r2*10**-3     # in m\n",
      "del_x=r2-r1     # in m\n",
      "L=1     # in m\n",
      "#Formula P*V= m*R*T\n",
      "V=S#\n",
      "m=P*V/(R*T)     # in kg/m**3 of pipe\n",
      "# So, Concentration of H2 at inner surface of the pipe\n",
      "C_A1=0.0176     # in kg/m**3\n",
      "# The resistance of diffusion of H2 away from the outer surface is negligible i.e.\n",
      "C_A2=0#\n",
      "Am=2*pi*L*del_x/log(r2/r1)#\n",
      "# Loss of H2 by diffusion \n",
      "M_A= D_AB*(C_A1-C_A2)*Am/del_x#\n",
      "print \"Loss of H2 by diffusion = %0.2ef kg/s\" %M_A"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Loss of H2 by diffusion = 3.10e-09f kg/s\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  10.7 - Page No. : 330"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Px1= 0.14     # in bar\n",
      "Px2= 0#\n",
      "P=1.013     # in bar\n",
      "Py1=P-Px1# # in bar\n",
      "Py2=P-Px2# # in bar\n",
      "D=8.5*10**-6     # in m**2/s\n",
      "d=5     # diameter in meter\n",
      "L=1     # in mm\n",
      "L=L*10**-3     #in meter\n",
      "M=78     # molecular weight\n",
      "Am_x= 1/4*pi*d**2*M#\n",
      "R=8314#\n",
      "del_x=3     # thickness in mm\n",
      "del_x=del_x*10**-3     # in m\n",
      "T=20     # in degree C\n",
      "T=T+273     # in K\n",
      "P=P*10**5     # in N/m**2\n",
      "m_x= D*Am_x*P*log(Py2/Py1)/(R*T*del_x)#\n",
      "# The mass of the benzene to be evaporated\n",
      "mass= 1/4*pi*d**2*L#\n",
      "density=880     # in kg/m**3\n",
      "m_b= mass*density#\n",
      "toh=m_b/m_x     # in sec\n",
      "print \"Time taken for the entire organic compound to evaporate = %0.0f seconds\" %toh\n",
      "\n",
      "\n",
      "# Note: Answer in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Time taken for the entire organic compound to evaporate = 644 seconds\n"
       ]
      }
     ],
     "prompt_number": 25
    }
   ],
   "metadata": {}
  }
 ]
}