summaryrefslogtreecommitdiff
path: root/Fluidization_Engineering_by_K_Daizo_And_O_Levenspiel/ch18.ipynb
blob: 281bc4a57b61dd20b6b7f56324cce12b37e30d2d (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
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
{
 "metadata": {
  "name": "",
  "signature": "sha256:3eba5bf9f8e98dcb46f4a3b03f9f7fa4b342f8fb2d0d8b697e9a50303c32aa8f"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 18 : The Design of Noncatalytic Gas Solid Reactors"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1, Page 456\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "xA=0.08;      #Fraction of oxygen in stream\n",
      "dp=[2,0.1];   #Particle diameter in mm\n",
      "rhos=4130;    #Density of catalyst in kg/m**3\n",
      "Ds=8E-6;      #Diffusion coefficient of solid in m**2/s\n",
      "kc=0.02;      #Reaction rate constant in m/s\n",
      "P=10**5;      #Pressure in bar\\\n",
      "R=8.314;      #Universal gas constant\n",
      "T=900;        #Temperature in degree C\n",
      "mB=0.09745;   #Molecular weight of ZnS in kg/mol\n",
      "\n",
      "#CALCULATION\n",
      "b=2.0/3;#Stoichiometric coefficient of ZnS in the reaction equation\n",
      "CA=xA*P/(R*(T+273));#Concentration of Oxygen\n",
      "rhob=rhos/mB;       #Molar density of pure solid\n",
      "n=len(dp);\n",
      "i=0;\n",
      "kbar = [0,0]\n",
      "tou = [0,0]\n",
      "while i<n:\n",
      "    kbar[i]=(kc**-1+(dp[i]*10**-3/(12.0*Ds)))**-1;#Average reaction rate constant from Eqn.(11)\n",
      "    tou[i]=rhob*dp[i]*10**-3/(2*b*kbar[i]*CA);#Time for complete reaction in seconds from Eqn.(9)\n",
      "    i=i+1;\n",
      "\n",
      "#OUTPUT\n",
      "print 'Particle Size(mm)\\tAverage rate constant(m/s)\\tTime for complete reaction(min)'\n",
      "i=0;\n",
      "while i<n:\n",
      "    print '%f\\t\\t%f\\t\\t\\t%.2f'%(dp[i],kbar[i],tou[i]/60.0);\n",
      "    i=i+1;\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Particle Size(mm)\tAverage rate constant(m/s)\tTime for complete reaction(min)\n",
        "2.000000\t\t0.014118\t\t\t91.49\n",
        "0.100000\t\t0.019592\t\t\t3.30\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2, Page 457\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "xA=0.08;   #Fraction of oxygen in stream\n",
      "dp=1;      #Particle diameter in mm\n",
      "rhos=2200; #Density of catalyst in kg/m**3\n",
      "kc=0.2;    #Reaction rate constant in m/s\n",
      "mC=0.012;  #Molecular weight of carbon in kg/mol\n",
      "P=10**5;   #Pressure in bar\\\n",
      "R=8.314;   #Universal gas constant\n",
      "T=900;     #Temperature in degree C\n",
      "\n",
      "#CALCULATION\n",
      "b=1;#Stoichiometric coefficient of C in the reaction equation\n",
      "CA=xA*P/(R*(T+273));#Concentration of Oxygen\n",
      "rhob=rhos/mC;#Molar density of pure solid reactant\n",
      "tou=rhob*10**-3/(2*b*kc*CA);#Time required for complete reaction in seconds\n",
      "\n",
      "#OUTPUT\n",
      "print 'The time required for complete combustion:%.1fmins'%(tou/60);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The time required for complete combustion:9.3mins\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 3, Page 462\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from scipy.optimize import fsolve \n",
      "import math \n",
      "from numpy import zeros\n",
      "\n",
      "\n",
      "#INPUT\n",
      "dp = 110.;#Particle size in micrometer\n",
      "T = 900.;#Temperature of roaster in degree C\n",
      "tbar1 = [3.,10.,30.,50.];#Reported average time in min\n",
      "XBbarr = [0.840,0.940,0.985,0.990];#Reported value of average conversion\n",
      "tbar = 3.;\n",
      "XBbar = 0.840;#Average conversion for tbar  =  3 mins\n",
      "\n",
      "#CALCULATION\n",
      "#Uniform-Reaction Model\n",
      "x = (1./tbar)*(1./(1-XBbar)-1);#Term KrCA of Eqn.(20)\n",
      "n = len(tbar1);\n",
      "i = 0;\n",
      "XBbar1 = zeros(n)\n",
      "while i<  n:\n",
      "    XBbar1[i] = 1-1./(1+x*tbar1[i]);#Average conversion umath.sing calculated value of KrCA from Eqn.(20)\n",
      "    i = i+1;\n",
      "\n",
      "#Shrinking-Core, Rection Control\n",
      "touguess = 2;#Guess value of tou\n",
      "def solver_func(tou):#Function defined for solving the system\n",
      "    return (1-XBbar)-(0.25*tou/tbar)+(0.05*(tou/tbar)**2)-((1./120)*(tou/tbar)**3);\n",
      "\n",
      "tou = fsolve(solver_func,touguess)\n",
      "i = 0;\n",
      "XBbar2 = zeros(n)\n",
      "while i<n:\n",
      "    XBbar2[i] = 1-(0.25*tou/tbar1[i])+(0.05*(tou/tbar1[i])**2)-((1./120)*(tou/tbar1[i])**3);#Average conversion umath.sing calculated value of tou from Eqn.(23)\n",
      "    i = i+1;\n",
      "\n",
      "#Shrinking-Core, Diffusion Control\n",
      "touguess1 = 2;#Guess value of tou\n",
      "def solver_func1(tou):      #Function defined for solving the system\n",
      "    fn = (1-XBbar)-(1./5*tou/tbar)+(19./420*(tou/tbar)**2)-(41./4620*(tou/tbar)**3)+(0.00149*(tou/tbar)**4);\n",
      "\n",
      "tou1 = fsolve(solver_func1,touguess1)\n",
      "i = 0;\n",
      "XBbar3 = zeros(n)\n",
      "while i< n:\n",
      "    #Average conversion umath.sing calculated value of tou from Eqn.(23)\n",
      "    XBbar3[i] = 1-(1./5*tou1/tbar1[i])+(19./420*(tou1/tbar1[i])**2)-(41./4620*(tou1/tbar1[i])**3)+(0.00149*(tou1/tbar)**4);\n",
      "    i = i+1;\n",
      "\n",
      "#OUTPUT\n",
      "print '\\t\\t\\t\\tXBbar calculated for Models';\n",
      "print 'Reported Data';\n",
      "print 'tbarmin)\\tXBbar\\tUniform Reaction\\tShrinking-Core%( Rection Control\\t\\tShrinking-Core, Diffusion Control'\n",
      "i = 0\n",
      "while i< n:\n",
      "    print '%f\\t%f\\t%f\\t\\t%f\\t\\t\\t\\t%f'%(tbar1[i],XBbarr[i],XBbar1[i],XBbar2[i],XBbar3[i]);\n",
      "    i = i+1;\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\t\t\t\tXBbar calculated for Models\n",
        "Reported Data\n",
        "tbarmin)\tXBbar\tUniform Reaction\tShrinking-Core%( Rection Control\t\tShrinking-Core, Diffusion Control\n",
        "3.000000\t0.840000\t0.840000\t\t0.840000\t\t\t\t0.884437\n",
        "10.000000\t0.940000\t0.945946\t\t0.947234\t\t\t\t0.962033\n",
        "30.000000\t0.985000\t0.981308\t\t0.981898\t\t\t\t0.987159\n",
        "50.000000\t0.990000\t0.988701\t\t0.989075\t\t\t\t0.992366\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:227: RuntimeWarning: The iteration is not making good progress, as measured by the \n",
        "  improvement from the last ten iterations.\n",
        "  warnings.warn(msg, RuntimeWarning)\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 4, Page 462\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from scipy.optimize import fsolve \n",
      "import math \n",
      "from numpy import zeros\n",
      "\n",
      "\n",
      "#INPUT\n",
      "W = 1;          #Bed weight in kg\n",
      "F1 = 0.01;      #Solid feed rate in kg/min\n",
      "dp = [200.,600.];           #Particle size in micrometer\n",
      "XBbar = [0.85,0.64];        #Average conversion for corresponding particle sizes\n",
      "rhos = 2500.;               #Density of solid in kg/m**3\n",
      "ephsilonm = 0.4;            #Void fracton of fixed bed\n",
      "F11 = 4.;                   #Feed rate of solids in tons/hr\n",
      "XBbar1 = 0.98;\n",
      "dp1 = 600.;\n",
      "pi = 3.14;\n",
      "\n",
      "#CALCULATION\n",
      "#Shrinking-Core, Rection Control\n",
      "n = len(dp);\n",
      "i = 0;\n",
      "touguess = 2;#Guess value of tou\n",
      "tou = zeros(n)\n",
      "while i< n:\n",
      "    def solver_func2(t):  #Function defined for solving the system\n",
      "        return  (1-XBbar[i])-(0.25*t/107)+(0.05*(t/107.)**2)-((1./120)*(t/107.)**3)\n",
      "    tou[i] = fsolve(solver_func2,touguess)\n",
      "    i = i+1;\n",
      "\n",
      "tou1 = tou[1];\n",
      "#For a math.single stage fluidized roaster\n",
      "tbar1 = 0.25*(tou1/(1-XBbar1))/60.;          #Mean residence time of solids in reactor in hr from Eqn.(24)\n",
      "W1 = F11*tbar1;\n",
      "dtguess = 2.;                    #Guess value of tou\n",
      "def solver_func3(dt):           #Function defined for solving the system\n",
      "    return  W1*10**3-(pi/4.)*dt**2*0.5*dt*rhos*(1-ephsilonm);#Since Lm = 0.5dt\n",
      "\n",
      "dt = fsolve(solver_func3,dtguess)\n",
      "Lm = dt/2.;#Length of bed required\n",
      "\n",
      "#For a two-stage fluidized roaster\n",
      "tbar2 = tou1*math.sqrt(1./(20*(1-XBbar1)))/60;      #Mean residence time of solids in reactor in hr from Eqn.(30)\n",
      "W2 = F11*tbar2;\n",
      "dtguess1 = 2;                   #Guess value of tou\n",
      "def solver_func4(dt):           #Function defined for solving the system\n",
      "    return W2*10**3-(pi/4.)*dt**2*0.5*dt*rhos*(1-ephsilonm);       #Since Lm = 0.5dt\n",
      "\n",
      "dt1 = fsolve(solver_func4,dtguess)\n",
      "Lm1 = dt1/2.;           #Length of bed required\n",
      "\n",
      "#OUTPUT\n",
      "print 'Single stage fluidized roaster';\n",
      "print '\\tWeight of bed needed:%ftons'%(W1);\n",
      "print '\\tDiameter of reactor:%fm'%(dt);\n",
      "print '\\tLength of bed:%fm'%(Lm);\n",
      "print 'Two-stage fluidized roaster';\n",
      "print '\\tWeight of bed needed:%ftons'%(W2);\n",
      "print '\\tDiameter of reactor:%fm'%(dt1);\n",
      "print '\\tLength of bed:%fm'%(Lm1);\n",
      "print 'These results show that this operation can be accomplished in a math.single bed of %ftons or in two beds of %f tons each.'%(W1,W2);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Single stage fluidized roaster\n",
        "\tWeight of bed needed:174.370805tons\n",
        "\tDiameter of reactor:6.665728m\n",
        "\tLength of bed:3.332864m\n",
        "Two-stage fluidized roaster\n",
        "\tWeight of bed needed:22.056356tons\n",
        "\tDiameter of reactor:3.346064m\n",
        "\tLength of bed:1.673032m\n",
        "These results show that this operation can be accomplished in a math.single bed of 174.370805tons or in two beds of 22.056356 tons each.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 5, Page 468\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from scipy.optimize import fsolve \n",
      "import math \n",
      "from numpy import zeros\n",
      "\n",
      "#INPUT\n",
      "T = 900;                #Temperature in roaster in degree C\n",
      "P = 101325;             #Pressure in Pa\n",
      "R = 8.314;              #Universal gas consmath.tant\n",
      "dpbar = 150;            #Average particle size in micrometer\n",
      "rhosbar = 4130;         #Average particle density in kg/m**3\n",
      "kc = 0.015              #Rate consmath.tant in m/s for reaction which follows shrinking core model\n",
      "Ds = 8E-6;              #Diffusion coefficient of solid in m**2/s\n",
      "uo = 0.6;               #Superficial gas velocity in m/s\n",
      "D = 2.3E-4;             #Diffusion coefficient of gas in m**2/s\n",
      "Lm = 1;                 #Length of fixed bed in m\n",
      "dte = 0.4;              #Equivalent diameter of bed\n",
      "umf = 0.025;            #Velocity at minimum fluidization condition in m/s\n",
      "ephsilonm = 0.45;       #Void fraction of fixed bed\n",
      "ephsilonmf = 0.50;      #Void fraction at minimum fluidized condition\n",
      "db = 0.2;               #Estimated bubble size in m\n",
      "gammab = 0.005;         #Ratio of volume of print ersed solids to that of bubble phase\n",
      "Fo = 2;                 #Feed rate of solids in kg/s\n",
      "XA = 0.6677;            #Conversion of Oxygen\n",
      "xA = 0.21;              #Mole fraction of oxygen in feed\n",
      "mB = 0.09744;           #Molecular weight of ZnS\n",
      "F = 0.85;               #Fraction of open area\n",
      "g = 9.81;               #Acceleration due to gravity in square m/s**2\n",
      "pi = 3.14;\n",
      "\n",
      "#CALCULATION\n",
      "#(a)Extreme Calculation\n",
      "a = 3./2;#Stoichiometric coefficient of Oxygen in the reaction equation\n",
      "At = (Fo/mB)*(a)/(uo*(273./(T+273))*(XA*xA)/0.0224);\n",
      "dt = math.sqrt(At/F*4/pi);\n",
      "\n",
      "#(b)The Three-Step Procedure\n",
      "#Step 1. Conversion of gas\n",
      "ubr = 0.711*(g*db)**0.5;                                #Rise velocity of bubble from Eqn.(6.7)\n",
      "ub = 1.6*((uo-umf)+1.13*db**0.5)*dte**1.35+ubr;         #Bubble rise velocity for Geldart B particle\n",
      "\n",
      "delta = uo/ub;#Fraction of bed in bubbles from Eqn.(6.29)\n",
      "ephsilonf = 1-(1-delta)*(1-ephsilonmf);                 #Void fraction of fixed bed from Eqn.(6.20)\n",
      "\n",
      "fw = 0.15;#Wake volume to bubble volume from Fig.(5.8)\n",
      "gammac = (1-ephsilonmf)*((3/(ubr*ephsilonmf/umf-1))+fw);        #Volume of solids in cloud to that of the bubble from Eqn.(6.36)\n",
      "gammae = ((1-ephsilonmf)*((1-delta)/delta))-gammab-gammac;      #Volume of solids in emulsion to that of the bubble from Eqn.(6.35)\n",
      "Kbc = 4.5*(umf/db)+5.85*((D**0.5*g**0.25)/db**(5./4));           #Gas interchange coefficient between bubble and cloud from Eqn.(10.27)\n",
      "Kce = 6.77*((D*ephsilonmf*0.711*(g*db)**0.5)/db**3)**0.5;       #Gas interchange coefficient between emulsion and cloud from Eqn.(10.34)\n",
      "x = delta*Lm*(1-ephsilonm)/((1-ephsilonf)*uo);                  #Term Lf/ub of Eqn.(12.16) from Eqn.(6.19)\n",
      "CAi = xA*P/(R*(T+273));                                         #Initial concentration of oxygen\n",
      "\n",
      "#Step 2.Conversion of solids\n",
      "rhob = rhosbar/mB;                                              #Density of ZnS\n",
      "kbar = (kc**-1+(dpbar*10**-6/(12*Ds))**-1)**-1;                 #Modified rate consmath.tant from Eqn.(11)\n",
      "tbar = At*Lm*(1-ephsilonm)*rhosbar/Fo;                          #Mean residence time of solids\n",
      "Krguess = 2;                                                    #Guess value of Kr\n",
      "def solver_func(Kr):                #Function defined for solving the system\n",
      "    Kf = gammab*Kr+1/((1./Kbc)+(1./(gammac*Kr+1/((1./Kce)+(1./(gammae*Kr))))));            #Reaction rate for fluidized bed from Eqn.(14)\n",
      "    XA = 1-math.exp(-x*Kf);                                                         #Conversion of oxygen from Eqn.(42)\n",
      "    CAbar = (CAi*XA*uo)/(Kr*Lm*(1-ephsilonm));                                      #Average concentration of oxygen from Eqn.(43)\n",
      "    tou = rhob*dpbar*10**-6*a/(2*kbar*CAbar);                                       #Time for complete reaction from Eqn.(9)\n",
      "    y = tbar/tou;#Term tbar/tou\n",
      "    XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1/y));                                   #Average conversion of ZnS from Eqn.(22)\n",
      "    #Step 3. Material balance of both streams\n",
      "    return (Fo/mB)*XBbar-(At*uo*CAi*XA/a);                                          #From Eqn.(44b)\n",
      "\n",
      "Kr = fsolve(solver_func,Krguess)\n",
      "Kf = gammab*Kr+1/((1/Kbc)+(1/(gammac*Kr+1/((1/Kce)+(1/(gammae*Kr))))));             #Reaction rate for fluidized bed from Eqn.(14)\n",
      "XA = 1-math.exp(-x*Kf);                                                             #Conversion of oxygen from Eqn.(42)\n",
      "CAbar = (CAi*XA*uo)/(Kr*Lm*(1-ephsilonmf));                                         #Average concentration of oxygen from Eqn.(43)\n",
      "tou = rhob*dpbar*10**-6*a/(2*kbar*CAbar);                                           #Time for complete reaction from Eqn.(9)\n",
      "y = tbar/tou;                                                                       #Term tbar/tou\n",
      "XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1/y));                                       #Average conversion of ZnS from Eqn.(22)\n",
      "\n",
      "\n",
      "#(c) For other feed rates of solids\n",
      "F1 = [2,2.5,3,3.5];#Various feed rates of solids in kg/s\n",
      "n = len(F1)\n",
      "i = 0;\n",
      "tbar1 = zeros(n)\n",
      "Kr1 = zeros(n)\n",
      "XA1 = zeros(n)\n",
      "y1 = zeros(n)\n",
      "tou1 = zeros(n)\n",
      "XBbar1 = zeros(n)\n",
      "Kf1 = zeros(n)\n",
      "CAbar1 = zeros(n)\n",
      "Krguess1 = 2;           #Guess value of Kr\n",
      "while i<  n:\n",
      "    tbar1[i] = At*Lm*(1-ephsilonm)*rhosbar/F1[i];#Mean residence time of solids\n",
      "    def solver_func1(Kr):               #Function defined for solving the system\n",
      "        Kf1 = gammab*Kr+1/((1/Kbc)+(1/(gammac*Kr+1/((1/Kce)+(1/(gammae*Kr))))));#Reaction rate for fluidized bed from Eqn.(14)\n",
      "        XA1 = 1-math.exp(-x*Kf1);#Conversion of oxygen from Eqn.(42)\n",
      "        CAbar1 = (CAi*XA1*uo)/(Kr*Lm*(1-ephsilonm));#Average concentration of oxygen from Eqn.(43)\n",
      "        tou1 = rhob*dpbar*10**-6*a/(2*kbar*CAbar1);#Time for complete reaction from Eqn.(9)\n",
      "        y1[i] = tbar1[i]/tou1;#Term tbar/tou\n",
      "        XBbar1[i] = 3*y1[i]-6*y1[i]**2+6*y1[i]**3*(1-math.exp(-1/y1[i]));#Average conversion of ZnS from Eqn.(22)\n",
      "        #Step 3. Material balance of both streams\n",
      "        return (F1[i]/mB)*XBbar1[i]-(At*uo*CAi*XA1/a);#From Eqn.(44b)\n",
      "\n",
      "    Kr1[i] = fsolve(solver_func1,Krguess1)\n",
      "    Kf1[i] = gammab*Kr1[i]+1/((1/Kbc)+(1/(gammac*Kr1[i]+1/((1/Kce)+(1/(gammae*Kr1[i]))))));#Reaction rate for fluidized bed from Eqn.(14)\n",
      "    XA1[i] = 1-math.exp(-x*Kf1[i]);#Conversion of oxygen from Eqn.(42)\n",
      "    CAbar1[i] = (CAi*XA1[i]*uo)/(Kr1[i]*Lm*(1-ephsilonmf));#Average concentration of oxygen from Eqn.(43)\n",
      "    tou1[i] = rhob*dpbar*10**-6*a/(2*kbar*CAbar1[i]);#Time for complete reaction from Eqn.(9)\n",
      "    y1[i] = tbar1[i]/tou1[i];#Term tbar/tou\n",
      "    XBbar1[i] = 3*y1[i]-6*y1[i]**2+6*y1[i]**3*(1-math.exp(-1/y1[i]));#Average conversion of ZnS from Eqn.(22)\n",
      "    i = i+1;\n",
      "\n",
      "#OUTPUT\n",
      "print 'Extreme Calculation';\n",
      "print '\\tDiameter of tube with all its internals:%fm'%(dt);\n",
      "print 'Three step procedure';\n",
      "print '\\tConversion of ZnS:%f'%(XBbar);\n",
      "print 'For other feed rates of solids';\n",
      "print '\\tFeedkg/s\\ttbars\\t\\tXBbar/XA\\tKrbars**-1\\tCAbar/CAi\\ttous\\t\\tXA\\t\\tXB';\n",
      "i = 0;\n",
      "while i<  n:\n",
      "    print '\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f'%(F1[i],tbar1[i],XBbar1[i]/XA1[i],Kr1[i],CAbar1[i]/CAi,tou1[i],XA1[i],XBbar1[i]);\n",
      "    i = i+1;\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extreme Calculation\n",
        "\tDiameter of tube with all its internals:7.265465m\n",
        "Three step procedure\n",
        "\tConversion of ZnS:0.992491\n",
        "For other feed rates of solids\n",
        "\tFeedkg/s\ttbars\t\tXBbar/XA\tKrbars**-1\tCAbar/CAi\ttous\t\tXA\t\tXB\n",
        "\t2.000000\t40003.518104\t1.498777\t6.529973\t0.121691\t1208.748626\t0.662201\t0.992491\n",
        "\t2.500000\t32002.814483\t1.201348\t23.149964\t0.041993\t3502.838402\t0.810111\t0.973225\n",
        "\t3.000000\t26669.012069\t1.007581\t76.183481\t0.014228\t10338.227251\t0.903294\t0.910141\n",
        "\t3.500000\t22859.153202\t0.871565\t146.263086\t0.007742\t18998.458994\t0.943693\t0.822490\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 6, Page 471\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from scipy.optimize import fsolve \n",
      "import math \n",
      "\n",
      "\n",
      "#INPUT\n",
      "T = 900;                #Temperature in roaster in degree C\n",
      "P = 101325;             #Pressure in Pa\n",
      "R = 8.314;              #Universal gas consmath.tant\n",
      "dp = 750;               #Particle size in micrometer5\n",
      "Fo = 2.5;               #Feed rate of solids in kg/s\n",
      "uo = 0.6;               #Superficial gas velocity in m/s\n",
      "W = 80140;              #Weight of bed in kg\n",
      "ephsilonmf = 0.50;      #Void fraction at minimum fluidized condition\n",
      "umf = 0.5;              #Velocity at minimum fluidization condition in m/s\n",
      "db = 0.2;               #Estimated bubble size in m\n",
      "g = 9.81;               #Acceleration due to gravity in square m/s**2\n",
      "Lm = 1;                 #Length of fixed bed in m\n",
      "ephsilonm = 0.45;       #Void fraction of fixed bed\n",
      "xA = 0.21;              #Mole fraction of oxygen in feed\n",
      "kc = 0.015              #Rate consmath.tant in m/s for reaction which follows shrinking core model\n",
      "Ds = 8E-6;              #Diffusion coefficient of solid in m**2/s\n",
      "rhosbar = 4130;         #Average particle density in kg/m**3\n",
      "mB = 0.09744;           #Molecular weight of ZnS\n",
      "a = 3./2;               #Stoichiometric coefficient of Oxygen in the reaction equation\n",
      "\n",
      "#CALCULATION\n",
      "#Selection of models to represent reactor\n",
      "ubr = 0.711*(g*db)**0.5;        #Rise velocity of bubble from Eqn.(6.7)\n",
      "f = ubr/(umf/ephsilonmf);\n",
      "\n",
      "#Step 1.\n",
      "ub = uo-umf+ubr;            #Rise velocity of bubbles from Eqn.(6.8)\n",
      "delta = (uo-umf)/(ub+2*umf);        #Fraction of the bed in bubbles from Eqn.(6.26)\n",
      "Krguess = 2;                        #Guess value of Kr\n",
      "x = Lm*(1-ephsilonm)*umf*(1-delta)/uo**2;\n",
      "CAi = xA*P/(R*(T+273));             #Initial concentration of oxygen\n",
      "\n",
      "#Step 2.\n",
      "kbar = (kc**-1+(dp*10**-6/(12*Ds))**-1)**-1;            #Modified rate consmath.tant from Eqn.(11)\n",
      "tbar = W/Fo;                    #Mean residence time of solids from Eqn.(14.2)\n",
      "rhob = rhosbar/mB;              #Density of ZnS\n",
      "def solver_func1(Kr):           #Function defined for solving the system\n",
      "    XA = 1-math.exp(-x*Kr);     #Conversion from Eqn.(42)\n",
      "    CAbar = (CAi*XA*uo**2)/(Kr*Lm*(1-ephsilonm)*umf*(1-delta));         #Average concentration of oxygen from Eqn.(43)\n",
      "    tou = rhob*dp*10**-6*a/(2*kbar*CAbar);          #Time for complete reaction from Eqn.(9)\n",
      "    y = tbar/tou;               #Term tbar/tou\n",
      "    XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1./y));          #Average conversion of ZnS from Eqn.(22)\n",
      "    return XBbar-1.2*XA;        #From Table E5, for Fo = 2.5kg/s\n",
      "\n",
      "Kr = fsolve(solver_func1,Krguess)\n",
      "XA = 1-math.exp(-x*Kr);         #Conversion from Eqn.(42)\n",
      "CAbar = (CAi*XA*uo**2)/(Kr*Lm*(1-ephsilonm)*umf*(1-delta))      #Average concentration of oxygen from Eqn.(43)\n",
      "tou = rhob*dp*10**-6*a/(2*kbar*CAbar);          #Time for complete reaction from Eqn.(9)\n",
      "y = tbar/tou;                   #Term tbar/tou\n",
      "XBbar = 3*y-6*y**2+6*y**3*(1-math.exp(-1./y));  #Average conversion of ZnS from Eqn.(22)\n",
      "\n",
      "#OUTPUT\n",
      "print 'Selection of models to represent reactor';\n",
      "print '\\tSince ratio ubr/umf/ephsilonmf) =  %f <1 the reactor is operating in slow bubble regime'%(f);\n",
      "print '\\tSince particle size  = %f micrometer they react according to shrinking-core model'%(dp);\n",
      "print '\\tConversion obtained for %f micrometer particle:%f'%(dp,XBbar);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Selection of models to represent reactor\n",
        "\tSince ratio ubr/umf/ephsilonmf) =  0.995908 <1 the reactor is operating in slow bubble regime\n",
        "\tSince particle size  = 750.000000 micrometer they react according to shrinking-core model\n",
        "\tConversion obtained for 750.000000 micrometer particle:0.988127\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}