Scilab Textbook Companion for Chemical Reaction Engineering by O. Levenspiel

Scilab Textbook Companion for Chemical Reaction Engineering by O. Levenspiel1 Created by Priyam Saraswat Chemical Engine

Views 110 Downloads 0 File size 307KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

Scilab Textbook Companion for Chemical Reaction Engineering by O. Levenspiel1 Created by Priyam Saraswat Chemical Engineering Chemical Engineering Indian Institute of Technology,Guwahati College Teacher Prof.Prakash Kotecha Cross-Checked by

July 30, 2019

1 Funded

by a grant from the National Mission on Education through ICT, http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilab codes written in it can be downloaded from the ”Textbook Companion Project” section at the website http://scilab.in

Book Description Title: Chemical Reaction Engineering Author: O. Levenspiel Publisher: Wiley India, New Delhi Edition: 3 Year: 2008 ISBN: 978-81-265-1000-9

1

Scilab numbering policy used in this document and the relation to the above book. Exa Example (Solved example) Eqn Equation (Particular equation of the above book) AP Appendix to Example(Scilab Code that is an Appednix to a particular Example of the above book) For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means a scilab code whose theory is explained in Section 2.3 of the book.

2

Contents List of Scilab Codes

4

1 Overview of Chemical Reaction Engineering

5

2 Kinetics of Homogeneous Reactions

7

3 Interpretation of Batch Reactor Data

9

4 Introduction to Reactor Design

14

5 Ideal Reactors for a Single Reaction

15

6 Design for Single Reactions

20

7 Design for Parallel Reactions

24

8 Potpourri of Multiple Reactions

28

9 Temperature and Pressure Effects

30

10 Choosing the Right Kind of Reactor

35

11 Basics of Non Ideal Flow

37

12 Compartment Models

42 3

13 The Dispersion Model

44

14 The Tanks In Series Model

47

16 Earliness of Mixing Segregation and RTD

50

17 Heterogeneous Reactions

52

18 Solid Catalyzed Reactions

54

19 The Packed Bed Catalytic Reactor

62

20 Reactors with Suspended Solid Catalyst Fluidized Reactors of Various Types

65

21 Deactivating Catalysts

67

22 GL Reactions on Solid Catalysts

71

23 Fluid Fluid Reactions Kinetics

74

24 Fluid Fluid Reactors Design

76

26 Fluid Particle Reactors Design

81

29 Substrate Limiting Microbial Fermentation

84

30 Product Limiting Microbial Fermentation

86

4

List of Scilab Codes Exa Exa Exa Exa

1.1 1.2 2.1 2.2

Exa 2.3 Exa 3.1 Exa 3.2 Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa

3.4 4.1 5.1 5.2 5.3 5.4 5.5 5.6 6.1 6.2 6.3 7.1 7.2 7.3

Exa 7.4 Exa 8.1

The Rocket Engine . . . . . . . . . . . . . . The Living Person . . . . . . . . . . . . . . Search for the reactiom mechanism . . . . . Search for a mechanism for the enzyme substrate reaction . . . . . . . . . . . . . . . . . Search for the activation energy of a pasteurization process . . . . . . . . . . . . . . . . Find a rate equation using the integral method Find a rate equation to fit a set of data using the differential method . . . . . . . . . . . . Correct and Incorrect E values . . . . . . . A balance from Stoichiometry . . . . . . . . Reaction rate in a mixed flow reactor . . . . Kinetics from a mixed flow reactor . . . . . Mixed flow reactor performance . . . . . . . Plug flow reactor performance . . . . . . . . Plug flow reactor volume . . . . . . . . . . . Test of a kinetic equation in a plug flow reactor Operating a number of plug flow reactors . . Mixed flow reactor in series . . . . . . . . . Finding the best reactor set up . . . . . . . Contacting patterns for reactions in parallel Product distribution for parallel reactions . Good operating conditions for parallel reactions . . . . . . . . . . . . . . . . . . . . . . Best operating conditions for parallel reactions Favorable contacting patterns for any set of irreversible reactions in series . . . . . . . . 5

5 6 7 7 7 9 11 12 14 15 16 17 18 19 19 20 20 21 24 24 25 26 28

Exa Exa Exa Exa

8.2 8.3 9.1 9.2

Exa 9.3

Exa 9.4 Exa 9.5 Exa 9.6 Exa 9.7 Exa 10.1 Exa 10.2 Exa 11.1 Exa 11.2 Exa 11.3 Exa 11.4 Exa Exa Exa Exa Exa Exa Exa

11.5 12.1 12.2 13.1 13.2 13.3 13.4

Exa Exa Exa Exa

14.1 14.2 14.3 14.4

Kinetics of series parallel reaction . . . . . . 28 Evaluate the kinetics from a batch experiment 28 AHr AT VARIOUS TEMPERATURES . . . 30 EQUILIBRIUM CONVERSION AT DIFFERENT TEMPERATURES . . . . . . . . . . . 31 CONSTRUCTION OF THE RATE CONVERSIONTEMPERATURE CHART FROM KINETIC DATA . . . . . . . . . . . . . . . . 31 PERFORMANCE FOR THE OPTIMAL TEMPERATURE PROGRESSION . . . . . . . . 32 OPTIMUM MIXED FLOW REACTOR PERFORMANCE . . . . . . . . . . . . . . . . . 33 ADIABATIC PLUG FLOW REACTOR PERFORMANCE . . . . . . . . . . . . . . . . . 34 ADIABATIC PLUG FLOW REACTOR WITH RECYCLE I Repeat . . . . . . . . . . . . . 34 THE TRAMBOUZE REACTIONS . . . . . 35 TEMPERATURE PROGRESSION FOR MULTIPLE REACTIONS . . . . . . . . . . . . . 35 FINDING THE RTD BY EXPERIMENT . 37 FINDING THE E CURVE FOR LIQUID FLOWING THROUGH A VESSEL . . . . . . . . 38 CONVOLUTION . . . . . . . . . . . . . . . 39 CONVERSION IN REACTORS HAVING NON IDEAL FLOW . . . . . . . . . . . . . . . . 40 REACTION OF A MACROFLUID . . . . . 40 BEHAVIOR OF A G L CONTACTOR . . . 42 MISBEHAVING REACTOR . . . . . . . . 42 DluL FROM A C CURVE . . . . . . . . . . 44 DuL FROM AN F CURVE . . . . . . . . . 45 DuL FROM A ONE SHOT INPUT . . . . . 45 CONVERSION FROM THE DISPERSION MODEL . . . . . . . . . . . . . . . . . . . . 46 MODIFICATIONS TO A WINERY . . . . 47 A FABLE ON RIVER POLLUTION . . . . 47 F LOW MODELS FROM RTD CURVES . 48 FINDING THE VESSEL E CURVE USING A SLOPPY TRACER INPUT . . . . . . . . 48 6

Exa 16.1 Exa 17.1 Exa 17.2 Exa 17.3 Exa 17.4 Exa 18.1 Exa 18.2 Exa 18.3 Exa 18.4 Exa 18.5 Exa 18.6 Exa 18.7 Exa 19.1 Exa 19.2 Exa 20.1 Exa 21.1

Exa 21.2 Exa 22.1 Exa 22.2 Exa 23.1 Exa 24.1

EFFECT OF SEGREGATION AND EARLINESS OF MIXING ON CONVERSION . 50 THE BURNING OF A CARBON PARTICLE IN AIR . . . . . . . . . . . . . . . . . 52 AEROBIC FERMENTATION . . . . . . . . 52 OVERALL RATE FOR A LINEAR PROCESS . . . . . . . . . . . . . . . . . . . . . 52 OVERALL RATE FOR A NONLINEAR PROCESS . . . . . . . . . . . . . . . . . . . . . 53 SEARCH OF THE RATE CONTROLLING MECHANISM . . . . . . . . . . . . . . . . 54 THE RATE EQUATION FROM A DIFFERENTIAL REACTOR . . . . . . . . . . . . . 56 THE RATE EQUATION FROM AN INTEGRAL REACTOR . . . . . . . . . . . . . . 57 PLUG FLOW REACTOR SIZE FROM A RATE EQUATION . . . . . . . . . . . . . . 59 PLUG FLOW REACTOR SIZE FROM RATE CONCENTRATION DATA . . . . . . . . . 59 MIXED FLOW REACTOR SIZE . . . . . . 60 MASS TRANSFER RESISTANCES . . . . 61 DESIGN OF A SINGLE ADIABATIC PACKED BED SYSTEM . . . . . . . . . . . . . . . . 62 DESIGN OF A TWO ADIABATIC PACKED BED SYSTEM . . . . . . . . . . . . . . . . 63 First Order Catalytic Reaction in a BFB . . 65 INTERPRETING KINETIC DATA IN THE PRESENCE OF PORE DIFFUSION RESISTANCE AND DEACTIVATION . . . . . . 67 DEACTIVATION IN A PACKED BED REACTOR . . . . . . . . . . . . . . . . . . . . 69 HYDROGENATION OF ACETONE IN A PACKED BUBBLE COLUMN . . . . . . . 71 HYDROGENATION OF A BATCH OF BUTYNEDIOL IN A SLURRY REACTOR . . 72 FINDING THE RATE OF A GL REACTION 74 TOWERS FOR STRAIGHT ABSORPTION 76

7

Exa 24.2 Exa 24.3 Exa 24.4 Exa 24.5 Exa 24.6 Exa 26.1 Exa 26.2 Exa 26.3 Exa 26.4 Exa 29.1 Exa 29.2 Exa 29.3 Exa 30.1

TOWERS FOR HIGH CONCENTRATION OF LIQUID REACTANT . . . . . . . . . . TOWERS FOR LOW CONCENTRATION OF LIQUID REACTANT CASE A . . . . . TOWERS FOR INTERMEDIATE CONCENTRATIONS OF LIQUID REACTANT . . . REDO EXAMPLE 24 2 BY THE GENERAL METHOD . . . . . . . . . . . . . . . . . . . REACTION OF A BATCH OF LIQUID . . CONVERSION OF A SIZE MIXTURE IN PLUG FLOW . . . . . . . . . . . . . . . . . CONVERSION OF A SINGLE SIZED FEED IN A MIXED FLOW REACTOR . . . . . . CONVERSION OF A FEED MIXTURE IN A MIXED FLOW REACTOR . . . . . . . . FINDING THE SIZE OF A FLUIDIZED BED MIXED REACTORS FOR MONOD KINETICS . . . . . . . . . . . . . . . . . . . . . . PLUG FLOW REACTOR FOR MONOD KINETICS . . . . . . . . . . . . . . . . . . . . GLUCOSE FOR E COLI BACTERIA . . . FRUIT FLY COCKTAIL . . . . . . . . . .

8

77 77 78 78 79 81 82 82 83 84 84 84 86

Chapter 1 Overview of Chemical Reaction Engineering

Scilab code Exa 1.1 The Rocket Engine 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

clear clc // l =75 cm , d=60 cm , H20 Produced =108 kg / s l =0.75; d =0.6; V =(3.14* d * d * l ) /4; //H2+0.5∗O2=H2O // M o l e c u l a r wt o f H2O=18 M =18; //H2O P roduced i n kmol / s H20_produced =108/ M ; //H2 u s e d H2_used = H20_produced ; //O2 Used O2_used =0.5* H20_produced ; // Rate o f r e a c t i o n // Rate o f r e a c t i o n o f H2 ( mol /mˆ 3 . s ) r_H2 =( H2_used / V ) *1000; // Rate o f r e a c t i o n o f O2 ( mol /mˆ 3 . s ) r_O2 =( O2_used / V ) *1000; 9

printf ( ” \nRESULT\n ” ) printf ( ” r a t e o f r e a c t i o n o f H2 ( mol /mˆ 3 . s ) i s %f\n ” , r_H2 ) 22 printf ( ” \ n r a t e o f r e a c t i o n o f O2 ( mol /mˆ 3 . s ) i s %f\n ” , r_O2 ) 20 21

Scilab code Exa 1.2 The Living Person 1 clear 2 clc 3 // Assuming d e n s i t y o f a p e r s o n =1000 kg /m3 4 d =1000; 5 mass =75; 6 V = mass / d ; 7 // m o l e s o f O2 consumed p e r day 8 O2_used =(6000/2816) *6; 9 // Rate o f r e a c t i o n ( mol /m3 . s ) 10 r_O2 =( O2_used / V ) /(24*3600) ; 11 printf ( ” \nRESULT\n ” ) 12 printf ( ” r a t e o f r e a c t i o n o f O2 ( mol /mˆ 3 . s ) i s %f\n ” ,

r_O2 )

10

Chapter 2 Kinetics of Homogeneous Reactions

Scilab code Exa 2.1 Search for the reactiom mechanism 1 clear 2 clc 3 // T h e o r o t i c a l Q u e s t i o n s 4 printf ( ” I t s a t h e o r o t i c a l

Question ”)

Scilab code Exa 2.2 Search for a mechanism for the enzyme substrate reaction 1 clear 2 clc 3 // T h e o r o t i c a l Q u e s t i o n s 4 printf ( ” I t s a t h e o r o t i c a l

Question ”)

Scilab code Exa 2.3 Search for the activation energy of a pasteurization process

11

1 2 3 4 5 6 7 8 9 10 11 12

clear clc // Given // t 1 =30 min ; T1=336 k ; // t 2 =15 s e c ; T2=347 k ; // C o n v e r t i n g t 2 i n min t1 =30; T1 =336; t2 =0.25; T2 =347 R =8.314; // l o g ( t 1 / t 2 )=E( 1 / T1−1/T2 ) /R E =( log ( t1 / t2 ) * R ) /(1/ T1 -1/ T2 ) ; printf ( ” \nRESULT\n ” ) printf ( ”E( J / mol ) i s %f ” ,E )

12

Chapter 3 Interpretation of Batch Reactor Data

Scilab code Exa 3.1 Find a rate equation using the integral method 1 clear 2 clc 3 function [ coefs ]= regress (x , y ) 4 coefs =[] 5 if ( type ( x ) 1) |( type ( y ) < >1) then error ( msprintf

6 7

8

9 10 11 12 13

( gettext ( ”%s : Wrong t y p e f o r i n p u t a r g u m e n t s : N u m e r i c a l e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end lx = length ( x ) if lx < > length ( y ) then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r b o t h i n p u t a r g u m e n t s : same s i z e e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end if lx ==0 then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r i n p u t argument #%d : Must be > %d . \ n ” ) , ” r e g r e s s ” , 1 , 0) ) , end x = matrix (x , lx ,1) y = matrix (y , lx ,1) xbar = sum ( x ) / lx ybar = sum ( y ) / lx coefs (2) = sum (( x - xbar ) .*( y - ybar ) ) / sum (( x - xbar ) .^2) 13

14 coefs (1) = ybar - coefs (2) * xbar 15 endfunction 16 // Given 17 t =[0 20 40 60 120 180 300]; 18 C_A =[10 8 6 5 3 2 1]; 19 CAo =10; 20 // G u e s s i n g 1 s t o r d e r k i n e t i c s 21 // T h i s means l o g (CAo/C A ) v s t s h o u l d g i v e a

straight line 22 for i =1:7 23 k ( i ) = log ( CAo / C_A ( i ) ) ; 24 CA_inv ( i ) =1/ C_A ( i ) ; 25 end 26 // p l o t ( t , k ) 27 // T h i s doesn ’ t g i v e s t r a i g h t l i n e . 28 // G u e s s i n g 2 nd Order K i n e t i c s s o 29 // 1/C A v s t s h o u l d g i v e a s t r a i g h t l i n e 30 // p l o t ( t , CA inv ) 31 // Again t h i s doesn ’ t g i v e a s t r a i g h t l i n e 32 // G u e s s i n g nth o r d e r k i n e t i c s and u s i n g f r a c t i o n a l

l i f e method w i t h F=80% 33 // l o g Tf=l o g ( 0 . 8 ˆ ( 1 − n ) −1/( k ( n −1) ) ) +(1−n ) logCAo 34 // p l o t ( t , C A ) 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

// P i c k i n g d i f f e r e n t v a l u e s o f CAo // Time n e e d e d f o r 3 r u n s , , from g r a p h T =[18.5;23;35]; CAo =[10;5;2]; for i =1:3 CA ( i ) =0.8* CAo ( i ) ; log_Tf ( i ) = log10 ( T ( i ) ) ; log_CAo ( i ) = log10 ( CAo ( i ) ) ; end plot ( log_CAo , log_Tf ) xlabel ( ’ l o g CAo ’ ) ; ylabel ( ’ l o g t ’ ) ; coeff1 = regress ( log_CAo , log_Tf ) ; n =1 - coeff1 (2) ; printf ( ”From g r a p h we g e t s l o p e and i n t e r c e p t f o r 14

c a l c u l a t i n g r a t e eqn ” ) 50 k1 =((0.8^(1 - n ) ) -1) *(10^(1 - n ) ) /(18.5*( n -1) ) ; 51 printf ( ” \n The r a t e e q u a t i o n i s g i v e n by %f ” , k1 ) 52 printf ( ”CAˆ 1 . 4 mol / l i t r e . s e c ” )

Scilab code Exa 3.2 Find a rate equation to fit a set of data using the differenti 1 clear 2 clc 3 function [ coefs ]= regress (x , y ) 4 coefs =[] 5 if ( type ( x ) 1) |( type ( y ) < >1) then error ( msprintf

6 7

8

9 10 11 12 13 14 15 16 17 18 19 20 21

( gettext ( ”%s : Wrong t y p e f o r i n p u t a r g u m e n t s : N u m e r i c a l e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end lx = length ( x ) if lx < > length ( y ) then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r b o t h i n p u t a r g u m e n t s : same s i z e e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end if lx ==0 then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r i n p u t argument #%d : Must be > %d . \ n ” ) , ” r e g r e s s ” , 1 , 0) ) , end x = matrix (x , lx ,1) y = matrix (y , lx ,1) xbar = sum ( x ) / lx ybar = sum ( y ) / lx coefs (2) = sum (( x - xbar ) .*( y - ybar ) ) / sum (( x - xbar ) .^2) coefs (1) = ybar - coefs (2) * xbar endfunction CA =[10;8;6;5;3;2;1]; // mol / l i t r e T =[0;20;40;60;120;180;300]; // s e c // p l o t (T , CA) // x l a b e l ( ’ Time ( s e c ) ’ ) ; y l a b e l ( ’CA( mol / l i t r e ) ’ ) ; // From g r a p h y=−dCA/ d t a t d i f f e r e n t p o i n t s a r e y =[ -0.1333; -0.1031; -0.0658; -0.0410; -0.0238; -0.0108; -0.0065]; 15

// G u e s s i n g nth r a t e o r d e r // rA=kCAˆ n // l o g (−dCA/ d t )=l o g k+nlogCA for i =1:7 log_y ( i ) = log10 ( y ( i ) ) ; log_CA ( i ) = log10 ( CA ( i ) ) ; end plot ( log_CA , log_y ) xlabel ( ’ logCA ’ ) ; ylabel ( ’ l o g (−dCA/ d t ) ’ ) coeff1 = regress ( log_CA , log_y ) ; n = coeff1 (2) ; k = -10^( coeff1 (1) ) ; printf ( ” \n A f t e r d o i n g l i n e a r r e g r e s s i o n , t h e s l o p e and i n t e r c e p t o f t h e g r a p h i s %f , %f ” , coeff (2) , coeff (1) ) 35 printf ( ” \n The r a t e e q u a t i o n i s t h e r e f o r e g i v e n by %f ” ,k ) 36 printf ( ”CAˆ 1 . 3 7 5 mol / l i t r e . s e c ” ) 37 disp ( ’ The a n s w e r s l i g h t l y d i f f e r s from t h o s e g i v e n i n book a s r e g r e s s f n i s u s e d f o r c a l c u l a t i n g s l o p e and i n t e r c e p t ’ ) 22 23 24 25 26 27 28 29 30 31 32 33 34

Scilab code Exa 3.4 Correct and Incorrect E values 1 2 3 4 5 6 7 8 9 10

clear clc // At 400 k , −rA =2.3∗pAˆ2 // At 500 k , −rA =2.3∗pAˆ2 k1 =2.3; k2 =2.3; T1 =400; T2 =500; //R=82.06∗10ˆ −6 m3 . atm / mol . k R =82.06*10^ -6; R1 =8.314; //m3 . pa / mol . k E =( log ( k2 / k1 ) * R ) /(1/ T1 -1/ T2 ) printf ( ” \nRESULT\n ” ) 16

11 printf ( ”E( J / mol ) u s i n g p r e s s u r e u n i t s i s %f ” ,E ) 12 //pA=CA∗RT 13 //−rA = 2 . 3 (RT) ˆ2∗CAˆ2 14 k1 =2.3*( R * T1 ) ^2 15 k2 =2.3*( R * T2 ) ^2 16 E =( log ( k2 / k1 ) * R1 ) /(1/ T1 -1/ T2 ) 17 printf ( ” \nE ( J / mol ) u s i n g c o n c e n t r a t i o n u n i t s i s %f ” ,E

)

17

Chapter 4 Introduction to Reactor Design

Scilab code Exa 4.1 A balance from Stoichiometry 1 clear 2 clc 3 // A+3∗B g i v e s 6C 4 a =1; b =3; c =6 5 // I n i t i a l c o n c e n t r a t i o n s 6 CAo =100; CBo =200; Cio =100 7 // F i n a l c o n c e n t r a t i o n s 8 CA =40; 9 // Find CB, XA, XB 10 ea =(6 -4) /4; 11 XA =( CAo - CA ) /( CAo + ea * CA ) ; 12 eb =( ea * CBo ) /( b * CAo ) ; 13 XB = b * CAo * XA / CBo ; 14 CB = CBo *(1 - XB ) /(1+ eb * XB ) ; 15 printf ( ” \nRESULT\n ” ) 16 printf ( ” The f i n a l c o n c e n t r a t i o n o f B(CB) 17 printf ( ” \n XA and XB a r e %f , %f ” ,XA , XB )

18

i s %f ” , CB )

Chapter 5 Ideal Reactors for a Single Reaction

Scilab code Exa 5.1 Reaction rate in a mixed flow reactor 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

clear clc // Given // C o n c e n t r a t i o n s i n mol / l i t r e CAo =0.1; CBo =0.01; Cco =0; CAf =0.02; CBf =0.03; Ccf =0.04; // Volume i n l i t r e V =1; // V o l u m e t r i c f l o w r a t e ( l / min ) v =1; // For mixed f l o w r e a c t o r CA = CAf ; CB = CBf ; Cc = Ccf ; // Rate o f r e a c t i o n ( mol / l i t r e . min ) rA =( CAo - CA ) /( V / v ) ; rB =( CBo - CB ) /( V / v ) ; rc =( Cco - Cc ) /( V / v ) ; printf ( ” \nRESULT\n ” ) printf ( ” r a t e o f r e a c t i o n o f A( mol / l i t r e . min ) i s %f\n ” , rA ) 18 printf ( ” \ n r a t e o f r e a c t i o n o f B( mol / l i t r e . min ) i s %f 19

\n ” , rB ) 19 printf ( ” \ n r a t e o f r e a c t i o n o f C( mol / l i t r e . min ) i s %f \n ” , rc )

Scilab code Exa 5.2 Kinetics from a mixed flow reactor 1 clear 2 clc 3 function [ coefs ]= regress (x , y ) 4 coefs =[] 5 if ( type ( x ) 1) |( type ( y ) < >1) then error ( msprintf

6 7

8

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

( gettext ( ”%s : Wrong t y p e f o r i n p u t a r g u m e n t s : N u m e r i c a l e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end lx = length ( x ) if lx < > length ( y ) then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r b o t h i n p u t a r g u m e n t s : same s i z e e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end if lx ==0 then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r i n p u t argument #%d : Must be > %d . \ n ” ) , ” r e g r e s s ” , 1 , 0) ) , end x = matrix (x , lx ,1) y = matrix (y , lx ,1) xbar = sum ( x ) / lx ybar = sum ( y ) / lx coefs (2) = sum (( x - xbar ) .*( y - ybar ) ) / sum (( x - xbar ) .^2) coefs (1) = ybar - coefs (2) * xbar endfunction // Given // V o l u m e t r i c f l o w r a t e s ( l i t r e / h r ) vo =[10;3;1.2;0.5]; // C o n c e n t r a t i o n s ( m i l l i m o l / l i t r e ) CA =[85.7;66.7;50;33.4]; CAo =100; // Volume ( l i t r e ) V =0.1; 20

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

// For t h e s t o i c h i o m e t r y 2A−−&g t ; R // E x p a n s i o n f a c t o r i s e =(1 -2) /2; // I n i t i a l i z a t i o n XA = zeros (4 ,1) ; rA = zeros (4 ,1) ; // R e l a t i o n b e t w e e n c o n c e n t r a t i o n and c o n v e r s i o n for i =1:4 XA ( i ) =(1 - CA ( i ) / CAo ) /(1+ e * CA ( i ) / CAo ) ; // Rate o f r e a c t i o n i s g i v e n by rA ( i ) = vo ( i ) * CAo * XA ( i ) / V ; // T e s t i n g nth o r d e r k i n e t i c s //−rA=k ∗CAˆ n // l o g (−rA )=l o g k+n l o g (CA) m ( i ) = log10 ( CA ( i ) ) ; n ( i ) = log10 ( rA ( i ) ) ; end // For nth o r d e r p l o t b e t w e e n n & ; m s h o u l d g i v e a straight line plot (m , n ) coefs = regress (m , n ) ; printf ( ” I n t e r c e p t o f t h e g r a p h i s %f\n ” , coefs (1) ) printf ( ” S l o p e o f t h e g r a p h i s %f\n ” , coefs (2) ) k =10^ coefs (1) n = coefs (2) printf ( ” \n Taking n =2 , r a t e o f e q u a t i o n ( m i l l i m o l / l i t r e . h r ) i s %f ” ,k ) printf ( ”CAˆ2 \n ” ) disp ( ’ The s o l s l i g h t l y d i f f e r from t h a t g i v e n i n book b e c a u s e r e g r e s s f n i s u s e d t o c a l c u l a t e t h e slope ’)

Scilab code Exa 5.3 Mixed flow reactor performance 1

clear 21

2 clc 3 // C o n c e n t r a t i o n ( mol / l i t r e ) o f c o m p o n e n t s i n t h e 4 5 6 7 8 9 10 11 12 13 14 15 16 17

mixed f e e d s t r e a m i s CAo =1.4; CBo =0.8; CRo =0; // Volume ( l i t r e ) V =6; // For 75% c o n v e r s i o n o f B // From s t o i c h i o m e t r y o f e q u a t i o n A+2B−−>R CA =1.4 -(0.75*0.8) /2; CB =0.8 -(0.75*0.8) ; CR =(0.75*0.8) /2; // From t h e Given r a t e e q u a t i o n ( mol / l i t r e . min ) rB =2*(12.5* CA * CB * CB -1.5* CR ) ; // V o l u m e t r i c f l o w r a t e i s g i v e n by v = V * rB /( CBo - CB ) ; printf ( ” \n v o l u m e t r i c f l o w r a t e ( l i t r e / min ) i n t o and o u t o f t h e r e a c t o r i s %f \n ” ,v ) disp ( ’ The s o l v a r i e s from book a s t h e v a l u e o f CB t a k e n i n book a t end i s wrong ’ )

Scilab code Exa 5.4 Plug flow reactor performance 1 clear 2 clc 3 // With 50% i n e r t 2 v o l o f 4 5 6 7 8 9 10 11 12

f e e d would g i v e 4 v o l o f completely converted gas // E x p a n s i o n f a c t o r i s eA =(4 -2) /2; // I n i t i a l c o n c e n t r a t i o n o f A( mol / l i t r e ) CAo =0.0625; // For 80% c o n v e r s i o n xAo =0; xAf =0.8; k =0.01; // For p l u g f l o w s p a c e t i m e ( t ) i s g i v e n by // t=CAo∗ i n t e g r a l ( dxA/−rA ) X = integrate ( ’ s q r t ((1+xA ) /(1 −xA ) ) ’ , ’ xA ’ ,xAo , xAf ) ; 22

13 t = sqrt ( CAo ) * X / k ; 14 printf ( ” \n S p a c e t i m e ( s e c ) n e e d e d

i s %f \n ” ,t )

Scilab code Exa 5.5 Plug flow reactor volume 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

clear clc // Given // T e m p e r a t u r e ( k e l v i n ) T =922; // P r e s s u r e ( P a s c a l ) P =460000; // L e t A=PH3 , R=P4 , S=H2 FAo =40; // mol / h r k =10; // ( / h r ) R =8.314; CAo = P /( R * T ) ; // mol /m3 e =(7 -4) /4; XA =0.8; // The volume o f p l u g f l o w r e a c t o r i s g i v e n by V = FAo *[(1+ e ) * log (1/(1 - XA ) ) -e * XA ]/( k * CAo ) ; printf ( ” \n volume (m3) o f r e a c t o r i s %f \n ” ,V )

Scilab code Exa 5.6 Test of a kinetic equation in a plug flow reactor 1 clear 2 clc 3 // T h i s i s a t h e o r o t i c a l Qn 4 printf ( ” I t s a t h e o r o t i c a l Q u e s t i o n ” )

23

Chapter 6 Design for Single Reactions

Scilab code Exa 6.1 Operating a number of plug flow reactors 1 clear 2 clc 3 V1 =50; V2 =30; V3 =40; 4 // Branch D c o n s i s t s 5 6 7 8 9 10 11

o f 2 r e a c t o r i n s e r i e s , can be c o n s i d e r e d a s i n g l e r e a c t o r o f volume VD = V1 + V2 ; VE = V3 ; // For R e a c t o r i n p a r a l l e l , V/F must be same f o r same conversion //FE/FD=VE/VD; FD/F=1/(1+VE/VD) m = VE / VD fr_D =1/(1+ m ) ; printf ( ” \n F r a c t i o n o f f e e d g o i n g t o b r a n c h D i s %f \n ” , fr_D )

Scilab code Exa 6.2 Mixed flow reactor in series 1

clear 24

2 clc 3 // For s i n g l e r e a c t o r and 90% C o n v e r s i o n 4 // From f i g 6 . 6 5 kCot =90; 6 // For 2 r e a c t o r s p a c e t i m e i s d o u b l e d and from f i g 7 kCot =180; 8 // From g r a p h X=97.4% 9 X =97.4; 10 printf ( ” \n P a r t a ” ) 11 printf ( ” \n The c o n v e r s i o n i n p e r c e n t a g e i s %f \n ” ,X ) 12 // For 90% C o n v e r s i o n & N=2. from g r a p h 13 kCot =27.5; 14 // Comparing t h e r e a c t i o n r a t e g r o u p f o r N=1 and N=2 , 15 16 17 18 19 20

We g e t // ( V2/ v2 ) / ( V1/ v1 ) = 2 7 . 5 / 9 0 //V2=2V1 // R a t i o o f f l o w r a t e s ratio =90*2/27.5; printf ( ” \n P a r t b ” ) printf ( ” \n Treatment r a t e can be i n c r e a s e d by ” , ratio )

Scilab code Exa 6.3 Finding the best reactor set up 1 2 3 4 5 6 7 8 9 10

clear clc CAo =[2;5;6;6;11;14;16;24]; // mmol/m3 CA =[0.5;3;1;2;6;10;8;4]; // mmol/m3 t =[30;1;50;8;4;20;20;4]; // min vo =0.1; //m3/ min for i =1:8 inv_rA ( i ) = t ( i ) /( CAo ( i ) - CA ( i ) ) ; end // S o r t i n g CA and a c c o r d i n g l y c h a n g i n g −1/rA f o r p l o t t i n g g r a p h b e t w e e n CA and −1/rA 25

%f \n

11 for i =1:8 12 for j = i :8 13 if CA ( i ) > CA ( j ) 14 temp = CA ( i ) ; 15 CA ( i ) = CA ( j ) ; 16 CA ( j ) = temp ; 17 temp1 = inv_rA ( i ) ; 18 inv_rA ( i ) = inv_rA ( j ) ; 19 inv_rA ( j ) = temp1 ; 20 end 21 end 22 end 23 plot ( CA , inv_rA ) 24 xlabel ( ’CA( mmol/m3) ’ ) ; ylabel ( ’ −1/rA (m3 . min /m mol ) ’ ) ; 25 disp ( ’ From t h e graph , we can s e e t h a t we s h o u l d u s e 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

plug flow with r e c y c l e ’ ) // From f i g CAin =6.6; // mmol/m3 R =(10 -6.6) /(6.6 -1) ; //V=t ∗ vo=a r e a ∗ vo V =(10 -1) *1.2* vo ; vr = vo * R ; printf ( ” \n P a r t a ” ) printf ( ” \n The v o l o f r e a c t o r i s %f ” ,V ) printf ( ”m3 \n The r e c y c l e f l o w r a t e i s %f ” , vr ) printf ( ”m3/ min ” ) // P a r t b , from f i g t =(10 -1) *10; t1 =(10 -2.6) *0.8; t2 =(2.6 -1) *10; // For 1 t a n k V = t * vo ; // For 2 t a n k V1 = t1 * vo ; V2 = t2 * vo ; Vt = V1 + V2 ; printf ( ” \n P a r t b ” ) printf ( ” \n For 1 t a n k volume i s %f ” ,V ) 26

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

printf ( ”m3 \n For 2 t a n k t h e volume i s %f ” , Vt ) printf ( ”m3” ) printf ( ” \n P a r t c ” ) disp ( ’We s h o u l d u s e mixed f l o w f o l l o w e d by p l u g f l o w ’) // For MFR tm =(10 -4) *0.2; Vm = tm * vo ; // For PFR tp =5.8; // by g r a p h i c a l i n t e g r a t i o n Vp = tp * vo ; Vtotal = Vp + Vm ; printf ( ” \n For MFR volume (m3) i s %f ” , Vm ) printf ( ” \n For PFR volume (m3) i s %f ” , Vp ) printf ( ” \n T o t a l volume i s %f ” , Vtotal ) printf ( ”m3” )

27

Chapter 7 Design for Parallel Reactions

Scilab code Exa 7.1 Contacting patterns for reactions in parallel 1 clear 2 clc 3 // T h e o r o t i c a l Q u e s t i o n s 4 printf ( ” I t s a t h e o r o t i c a l

Question ”)

Scilab code Exa 7.2 Product distribution for parallel reactions 1 clear 2 clc 3 // I n i t i a l 4 5 6 7 8 9

C o n c e n t r a t i o n ( mol / l i t r e ) e a c t a n t i n combined f e e d CAo =10; CBo =10; // For 90% C o n v e r s i o n XA =0.9; CAf = CAo *(1 - XA ) ; // I n s t a n t a n e o u s f r a c t i o n a l y i e l d o f d e s i r e d compound is //Q(R/A)=dCR/ (dCR+dCS )=CA/ (CA+CB ˆ 1 . 5 ) 28

10 // But CA=CB s o Q(R/A)=CA/ (CA+CAˆ 1 . 5 ) 11 // For Plug Flow 12 // O v e r a l l F r a c t i o n a l Y i e l d (Qp) i s 13 CA = CAf ; 14 Qp =( -1/( CAo - CAf ) ) * integrate ( ’ 1/(1+CAˆ 0 . 5 ) ’ , ’CA ’ ,CAo , 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

CAf ) ; CRf =9* Qp ; printf ( ” \n P a r t a ” ) printf ( ” \n For Plug Flow ” ) printf ( ” \n C o n c e n t r a t i o n o f R( mol / l i t r e ) i n t h e p r o d u c t s t r e a m i s %f \n ” , CRf ) // Mixed Flow // O v e r a l l F r a c t i o n a l Y i e l d (Qm) i s Qm = CA /( CA + CA ^1.5) ; CRf =9* Qm ; printf ( ” \n P a r t b ” ) printf ( ” \n For Mixed Flow ” ) printf ( ” \n C o n c e n t r a t i o n o f R( mol / l i t r e ) i n t h e p r o d u c t s t r e a m i s %f \n ” , CRf ) // Plug f l o w A, Mixed f l o w B CAo =19; CB =1; Q = -1/( CAo - CAf ) * integrate ( ’CA/ (CA+CB ˆ 1 . 5 ) ’ , ’CA ’ ,CAo , CAf ) ; CRf =9* Q ; printf ( ” \n P a r t c ” ) printf ( ” \n For Plug f l o w A, Mixed f l o w B” ) printf ( ” \n C o n c e n t r a t i o n o f R( mol / l i t r e ) i n t h e p r o d u c t s t r e a m i s %f \n ” , CRf ) disp ( ’ The r e s u l t f o r p l u g f l o w v a r i e s a s t h e r e s e e m s t o be t y p o g r a p h i c a l e r r o r i n i n t e g r a t i o n done i n book ’ )

Scilab code Exa 7.3 Good operating conditions for parallel reactions 1

clear 29

2 clc 3 CAo =2; 4 // S i n c e S i s t h e d e s i r e d P r o d u c t 5 //Q( S /A) =2CA/(1+CA) ˆ2 6 // P a r t a 7 // C s f =(CAo−CA) ∗2∗CA/(1+CA) ˆ2 8 // on d i f f e r e n t i a t i n g t h i s t o g e t max Csf , we g e t max 9 10 11 12 13 14 15 16 17 18 19 20 21 22

23 24 25 26 27 28

value at CA =0.5; Csf =( CAo - CA ) *2* CA /(1+ CA ) ^2; printf ( ” \n P a r t a ” ) printf ( ” \n For Mixed Flow R e a c t o r ” ) printf ( ” \n Maximum e x p e c t e d Cs i s %f ” , Csf ) // For Plug Flow R e a c t o r // P r o d u c t i o n o f s i s max a t 100% C o n v e r s i o n o f A CAf =0; Csf = -1* integrate ( ’ 2∗CA/(1+CA) ˆ2 ’ , ’CA ’ ,CAo , CAf ) ; printf ( ” \n P a r t b ” ) printf ( ” \n For Plug Flow ” ) printf ( ” \n Maximum e x p e c t e d c o n c e n t r a t i o n o f S i s %f \n ” , Csf ) // P a r t C // S i n c e no r e a c t a n t l e a v e s t h e s y s t e m u n c o n v e r t e d , what i s i m p o r t a n t i s t o o p e r a t e a t c o n d i t i o n o f highest fractional yield // i e . a t CA=1 where Q( S/A) =0.5 CA =1; Csf =( CAo - CA ) *2* CA /(1+ CA ) ^2; printf ( ” P a r t c ” ) printf ( ” \n For MFR w i t h s e p a r a t i o n and r e c y c l e ” ) printf ( ” \n C o n c e n t r a t i o n o f C s f i s %f ” , Csf )

Scilab code Exa 7.4 Best operating conditions for parallel reactions 1

clear 30

2 3 4 5 6 7 8 9 10 11 12

clc // Mixed f l o w f o l l o w e d by p l u g f l o w would be b e s t // From ex 7 . 3 // For mixed f l o w CAo =2; CA =1; Q =0.5; Cs1 = Q *( CAo - CA ) ; // For p l u g f l o w Cs2 = -1* integrate ( ’ 2∗CA/(1+CA) ˆ2 ’ , ’CA ’ ,1 ,0) ; // T o t a l amount o f CS f o r m e d i s Cs = Cs1 + Cs2 ; printf ( ” Mixed f l o w f o l l o w e d by p l u g f l o w would be best ”) 13 printf ( ” \n T o t a l amount o f CS f o r m e d ( mol / l i t r e ) i s %f \n ” , Cs )

31

Chapter 8 Potpourri of Multiple Reactions

Scilab code Exa 8.1 Favorable contacting patterns for any set of irreversible reac 1 clear 2 clc 3 // T h e o r o t i c a l Q u e s t i o n s 4 printf ( ” I t s a t h e o r o t i c a l

Question ”)

Scilab code Exa 8.2 Kinetics of series parallel reaction 1 clear 2 clc 3 disp ( ’ Data i s

not provided , only graph i s provided ’ )

Scilab code Exa 8.3 Evaluate the kinetics from a batch experiment 1

clear 32

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

clc CAo =185; CA =100; t =30; // As A d i s a p p e a r s by 1 s t Order k i n e t i c s // l n (CAo/CA)=K123t K123 = log ( CAo / CA ) / t ; // From t h e i n i t i a l r a t e o f f o r m a t i o n o f R //dCR/ d t (m1)=k2 ∗CAo m1 =2; k2 = m1 / CAo ; // // From t h e i n i t i a l r a t e o f f o r m a t i o n o f R m2 =1.3; k1 = m2 / CAo ; k3 = K123 - k1 - k2 ; // L o o k i n g a t t h e maxima o f S and T c u r v e s // For S , CSmax/CAo=( k1 / k123 ) ∗ ( k123 / k4 ) ˆ ( k4 / ( k4−k123 ) ) // t r i a l and e r r o r for k4 =0.0001:0.0001:0.1 Csmax = CAo *( k1 / K123 ) *(( K123 / k4 ) ^( k4 /( k4 - K123 ) ) ) ; if Csmax >31.8 & Csmax 9.95 & Ctmax 0 then printf ( ” R e a c t i o n i s E x o t h e r m i c ” ) else printf ( ” R e a c t i o n i s E n d o t h e r m i c ” ) end

34

Scilab code Exa 9.2 EQUILIBRIUM CONVERSION AT DIFFERENT TEMPERATURES 1 clear 2 clc 3 // S t a n d a r d h e a t o f 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

r e a c t i o n ( J / mol ) and Gibbs f r e e

e n e r g y ( J / mol ) Ho = -75300; Go = -14130; R =8.3214; T1 =298; // With a l l s p e c i f i c h e a i s a l i k e , dCp=0 Hr = - Ho ; K298 = exp ( - Go /( R * T1 ) ) ; // Taking d i f f e r e n t v a l u e s o f T T1 =[2;15;25;35;45;55;65;75;85;95]; // d e g r e e c e l c i u s T = [2 78 ;2 8 8; 29 8; 30 8 ;3 18 ;3 2 8; 33 8; 3 48 ;3 58 ;3 6 8] ; // k e l v i n for i =1:10 K = K298 * exp (( Hr / R ) *((1/ T ( i ) ) -(1/298) ) ) ; XAe ( i ) = K /( K +1) ; end plot ( T1 , XAe ) xlabel ( ’ T e m p e r a t u r e (C) ’ ) ylabel ( ’ XAe ’ ) disp ( ” From t h e g r a p h we s e e temp must s t a y b e l o w 78 C i f c o n v e r s i o n o f 75% o r a b o v e i s e x p e c t e d ” )

Scilab code Exa 9.3 CONSTRUCTION OF THE RATE CONVERSIONTEMPERATURE CHART FROM KINE 1 2 3 4 5 6 7 8 9

clear clc // At 338 k XA =0.581; t =1; // min // From ex 9 . 2 a t 65 d e g r e e c e l c i u s XAe =0.89; // For a b a t c h r e a c t o r , k 1 t /XAe=−l n (1−XA/ Xae ) k1_338 = -( XAe / t ) * log (1 -( XA / XAe ) ) ; 35

// At 25 d e g r e e c e l c i u s XAe1 =0.993; T1 =338; T2 =298; R =8.314; // At 298 k XA1 =0.6; t1 =10; // min k1_298 = -( XAe1 / t1 ) * log (1 -( XA1 / XAe1 ) ) ; E1 =( R * log ( k1_338 / k1_298 ) ) *( T1 * T2 ) /( T1 - T2 ) ko = k1_338 /( exp ( - E1 /( R * T1 ) ) ) // k1=ko ∗ exp (−E1/RT) // k2=k1 / k printf ( ” \n The r a t e c o n s t a n t s a r e k=exp [ ( 7 5 3 0 0 /RT) − 2 4 . 7 ] min−1” ) 23 printf ( ” \n k1=exp [ 1 7 . 2 − ( 4 8 9 0 0 /RT) ] min−1” ) 24 printf ( ” \n k2=exp [ 4 1 . 9 − ( 1 2 3 8 0 0 /RT) ] min−1 ” ) 10 11 12 13 14 15 16 17 18 19 20 21 22

Scilab code Exa 9.4 PERFORMANCE FOR THE OPTIMAL TEMPERATURE PROGRESSION 1 clear 2 clc 3 CAo =4; // mol / l i t r e 4 FAo =1000; // mol / min 5 // Drawing l o c u s o f max r a t e s on c o n v e r s i o n −temp 6 7 8 9 10 11 12 13 14

graph // t g e n d r a w i n g optimum p a t h f o r t h i s s y s t e m // i n t e g r a t i n g g r a p h i c a a l y , we g e r A =0.405; // l i t r e / mol . min t = CAo * A ; V = FAo * A ; printf ( ” \n P a r t a ” ) printf ( ” \n The s p a c e t i m e n e e d e d i s %f ” ,t ) printf ( ” min \n The Volume n e e d e d i s %f ” ,V ) printf ( ” l i t r e s ” )

36

Scilab code Exa 9.5 OPTIMUM MIXED FLOW REACTOR PERFORMANCE 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

clear clc // C o n c e n t r a t i o n o f A( mol / l i t r e ) CAo =4; // Flow r a t e o f A( mol / min ) FAo =1000; XA =0.8; Cp =250; // c a l /molA . K Hr =18000; // c a l /molA // U s i n g Xa v s T c h a r t o f f i g 9 . 3 a t 80% c o n v e r s i o n // R e a c t i o n Rate h a s t h e v a l u e 0 . 4 mol / min . l i t r e rA =0.4; // From t h e p e r f o r m a n c e eqn f o r mixed f l o w , Volume ( l ) is V = FAo * XA / rA ; printf ( ” \n P a r t a ” ) printf ( ” \n The s i z e o f r e a c t o r ( l i t r e s ) n e e d e d i s %f ” ,V ) slope = Cp / Hr ; // U s i n g g r a p h Qab1 = Cp *20; // c a l /molA Qab = Qab1 *1000; // c a l / min Qab = Qab *0.000070; //KW printf ( ” \n P a r t b ” ) printf ( ” \n Heat Duty (KW) o f p r e c o o l e r i s %f ” , Qab ) Qce1 = Cp *37; // c a l /molA f e d Qce = Qce1 *1000; // c a l / min Qce = Qce *0.000070; //KW printf ( ” \n Heat Duty (KW) o f p o s t c o o l e r i s %f ” , Qce )

37

Scilab code Exa 9.6 ADIABATIC PLUG FLOW REACTOR PERFORMANCE 1 clear 2 clc 3 FAo =1000; // mol / min 4 // Drawing t r i a l o p e r a t i n g 5 6 7 8 9

l i n e s with a s l o p e o f 1/72 and f o r e a c h e v a l u a t i n g i n t e g r a l dXA/−rA // From g r a p h Area =1.72; V = FAo * Area ; printf ( ” \n The volume o f a d i a b a t i c p l u g f l o w r e a c t o r i s %f ” ,V ) printf ( ” l i t r e s ” )

Scilab code Exa 9.7 ADIABATIC PLUG FLOW REACTOR WITH RECYCLE I Repeat 1 clear 2 clc 3 // U s i n g ex 9 . 6 and f i n d i n g optimum r e c y c l e 4 FAo =1000; // mol / min 5 Area =(0.8 -0) *1.5; 6 V = FAo * Area ; 7 printf ( ” \n The volume r e q u i r e d i s %f ” ,V ) 8 printf ( ” l i t r e ” )

38

area

Chapter 10 Choosing the Right Kind of Reactor

Scilab code Exa 10.1 THE TRAMBOUZE REACTIONS 1 2 3 4 5 6 7 8 9 10 11

clear clc CAo =1; CA =0.25; v =100 // l i t r e / min ko =.025; k1 =0.2; k2 =0.4; rA = ko + k1 * CA + k2 * CA ^2; // Volume ( l i t r e s ) p e r MFR i s V =( v /4) *( CAo - CA ) / rA ; // For 4 R e a c t o r System Vt =4* V ; printf ( ” \n The T o t a l volume ( l i r e s ) o f 4 r e a c t o r s y s t e m i s %f ” , Vt )

Scilab code Exa 10.2 TEMPERATURE PROGRESSION FOR MULTIPLE REACTIONS 1

clear 39

2 clc 3 printf ( ” For I n t e r m e d i a t e R i s d e s i r e d ” ) 4 // we want s t e p 1 f a s t t h a n 2 and s t e p 1 f a s t t h a n 3 5 printf ( ” \n E1E5 s o u s e a f a l l i n g t e m p e r a t u r e and p l u g f l o w \n ” ) printf ( ” For I n t e r m e d i a t e U i s d e s i r e d ” ) //We want s t e p 1 f a s t t h a n 2 and s t e p 3 f a s t t h a n 5 printf ( ” \n E2>E1 , E3>E5 s o u s e a r i s i n g t e m p e r a t u r e and p l u g f l o w \n ” )

40

Chapter 11 Basics of Non Ideal Flow

Scilab code Exa 11.1 FINDING THE RTD BY EXPERIMENT 1 clear 2 clc 3 // Given Time ( min ) and T r a c e r Output C o n c e n t r a t i o n ( g / 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

litre ) T =[0;5;10;15;20;25;30;35]; Cpulse =[0;3;5;5;4;2;1;0]; dt =5; // Mean R e s i d e n c e t i m e ( t ) sum1 =0; sum2 =0; Area =0; // I n i t i a l i z a t i o n for i =1:8 sum1 = sum1 + T ( i ) * Cpulse ( i ) * dt ; sum2 = sum2 + Cpulse ( i ) * dt ; // Area Under C o n c e n t r a t i o n −Time Curve Area = Area + Cpulse ( i ) * dt ; end t = sum1 / sum2 ; printf ( ” \n The mean r e s i d e n c e t i m e ( min ) i s %f \n ” ,t ) for j =1:8 E ( j ) = Cpulse ( j ) / Area ; 41

21 end 22 plot (T , E ) 23 xlabel ( ’ t i m e ( min ) ’ ) 24 ylabel ( ’E( min ˆ −1) ’ ) 25 title ( ’ E x i t a g e d i s t r i b u t i o n E v s t i m e ’ )

Scilab code Exa 11.2 FINDING THE E CURVE FOR LIQUID FLOWING THROUGH A VESSEL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

clear clc M =150; // M o l e c u l a r mass (gm) v =5; // l i t r e / s e c v =5*60; // l i t r e / min V =860; // l i t r e s // From M a t e r i a l B a l a n c e Area1 = M / v ; //gm . min / l i t r e // From t h e t r a c e r c u r v e A1 =0.375; Area2 = A1 *(1 +1/4 +1/1 6+1/ 64+ 1/25 6+1/ 1024 +1/ 4096 ) ; // Taking S i g n i f i c a n t A r e a s printf ( ” \n From m a t e r i a l b a l a n c e Area (gm . min / l i t r e ) i s %f ” , Area1 ) printf ( ” \n From T r a c e r Curve Area (gm . min / l i t r e ) i s %f ” , Area2 ) printf ( ” \n P a r t a ” ) printf ( ” \n As t h e two a r e a s a r e e q u a l , t h i s i s a p r o p e r l y done e x p e r i m e n t \n ” ) // For t h e l i q u i d , c a l c u l a t i n g t sum1 =0; for i =1:10 sum1 = sum1 +2* i * A1 /(4^( i -1) ) ; t = sum1 / Area1 ; end // l i q u i d volume i n v e s s e l Vl = t * v ; 42

24 // F r a c t i o n o f l i q u i d 25 f = Vl / V ; 26 printf ( ” \n P a r t b ” ) 27 printf ( ” \n F r a c t i o n o f l i q u i d i s %f ” ,f ) 28 //E=C p u l s e /M/ v 29 printf ( ” \n P a r t c ” ) 30 printf ( ” \n The E c u r v e i s 1 . 5 C” ) 31 printf ( ” \n P a r t d ” ) 32 printf ( ” \n The v e s s e l h a s a strong r e c i r c u l a t i o n

of l i q u i d , p r o b a b l y i n d u c e d by t h e r i s i n g b u b b l e s ” )

Scilab code Exa 11.3 CONVOLUTION 1 clear 2 clc 3 // From t h e g i v e n g r a p h 4 Cin (1) =0; Cin (2) =8; Cin (3) =4; Cin (4) =6; Cin (5) =0; 5 E (5) =0; E (6) =0.05; E (7) =0.5; E (8) =0.35; E (9) =0.1; E (10) 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

=0; for t =8:14 sum1 =0; for p =5: t -1 if p >10 |( t - p ) >5 h =2; else sum1 = sum1 + Cin (t - p ) * E ( p ) ; Cout ( t ) = sum1 ; end end end t =[1:1:14]; Cout = Cout ’; t Cout plot (t , Cout ) 43

22

xlabel ( ’ t ’ ) ; ylabel ( ’ Cout ’ )

Scilab code Exa 11.4 CONVERSION IN REACTORS HAVING NON IDEAL FLOW 1 clear 2 clc 3 k =0.307; 4 // Given mean r e s i d e n c e t i m e ( min ) 5 t =15; 6 // For p l u g f l o w w i t h n e g l i g i b l e d e n s i t y 7 fr_unconverted = exp ( - k * t ) ; 8 printf ( ” \n The f r a c t i o n o f r e a c t a n t u n c o n v e r t e d i n a 9 10 11 12 13 14 15 16 17

p l u g f l o w r e a c t o r i s %f ” , fr_unconverted ) // For t h e r e a l r e a c t o r T =[5;10;15;20;25;30]; // g i v e n t i m e E = [0.03;0.05;0.05;0.04;0.02;0.01]; // g i v e n dt =5; sum1 =0; for i =1:6 sum1 = sum1 + exp ( - k * T ( i ) ) * E ( i ) * dt ; end printf ( ” \n The f r a c t i o n o f r e a c t a n t u n c o n v e r t e d i n a r e a l r e a c t o r i s %f ” , sum1 )

Scilab code Exa 11.5 REACTION OF A MACROFLUID 1 2 3 4 5 6 7

clear clc k =0.5; // l i t r e / mol . min CAo =2; // mol / l i t r e // From t h e b a t c h eqn //CA/CAo=1/(1+kCAo∗ t ) to =1; t1 =3; 44

8 E =0.5; 9 // U s i n g eqn 13 10 XA_avg =1 -( E * integrate ( ’ 1/(1+ t ) ’ , ’ t ’ ,to , t1 ) ) ; 11 printf ( ” \n A v e r a g e c o n c e n t r a t i o n o f A r e m a i n i n g i n

t h e d r o p l e t i s %f ” , XA_avg )

45

Chapter 12 Compartment Models

Scilab code Exa 12.1 BEHAVIOR OF A G L CONTACTOR 1 clear 2 clc 3 // F i r s t 4 5 6 7 8 9 10 11 12 13

c a l c u l a t i n g t g and t l from t h e t r a c e r c u r v e s ( f i g E12 . 1 ) tg =(8*(9 -6) *(0.5) +11*(15 -9) *(0.5) ) /((15 -6) *0.5) ; // sec tl =40; // s e c vg =0.5; vl =0.1; Vg = tg * vg ; Vl = tl * vl ; // I n t e r m s o f v o i d f r a c t i o n %G = Vg *10; %L = Vl *10; %Stagnant =(100 - %G - %L ) ; printf ( ” \n f r a c t i o n o f g a s i s %f ” , %G ) printf ( ” \n f r a c t i o n o f l i q u i d i s %f ” , %L ) printf ( ” \n f r a c t i o n o f S t a n g n a n t l i q u i d i s %f ” , %Stagnant )

Scilab code Exa 12.2 MISBEHAVING REACTOR 46

1 2 3 4 5 6 7 8 9 10 11

clear clc CAo =1; XA =0.75; // p r e s e n t CA =1 - XA ; // For mixed f l o w r e a c t o r kt1 =( CAo - CA ) / CA ; // A f t e r new s e t u p kt2 =3* kt1 ; // volume i s r e d u c e d by 1/3 CA_unconverted =1/( kt2 +1) ; XA =1 - CA_unconverted ; //New XA a f t e r r e p l a c i n g t h e stirrer 12 printf ( ” \n New C o n v e r s i o n E x p e c t e d i s %f ” , XA )

47

Chapter 13 The Dispersion Model

Scilab code Exa 13.1 DluL FROM A C CURVE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

clear clc // Time i n min T =[0;5;10;15;20;25;30;35]; // T r a c e r C o n c e n t r a t i o n i n gm/ l i t r e Cpulse =[0;3;5;5;4;2;1;0]; // I n i t i a l i z a t i o n sum1 =0; sum2 =0; sum3 =0; for i =1:8 sum1 = sum1 + Cpulse ( i ) ; sum2 = sum2 + Cpulse ( i ) * T ( i ) ; sum3 = sum3 + Cpulse ( i ) * T ( i ) * T ( i ) ; end // /Mean ( min ) o f c o n t i n u o u s d i s t r i b u t i o n t = sum2 / sum1 ; // V a r i a n c e ( min ˆ 2 ) o f c o n t i n u o u s d i s t r i b u t i o n sigma_sqr =( sum3 / sum1 ) -(( sum2 / sum1 ) ) ^2; sigmatheta_sqr = sigma_sqr / t ^2; // C a l c u l a t i n g v e s s e l d i s p e r s i o n number // U s i n g eqn 1 3 . l e t d /uL=m 48

22 for m =0.1:0.001:0.2 23 sigmat_sqr =2* m -2*( m ^2) *(1 - exp ( -(1/ m ) ) ) ; 24 if sigmat_sqr >= sigmatheta_sqr 25 break ; 26 end 27 end 28 printf ( ” \n The v e s s e l d i s p e r s i o n number i s %f ” ,m )

Scilab code Exa 13.2 DuL FROM AN F CURVE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

clear clc // l e n g t h o f column (mm) l =1219; // V e l o c i t y (mm/ s ) u =0.0067; // U s i n g t h e p r o b a b i l i t y g r a p h // 16 t h p e r c e n t i l e p o i n t f a l l a t t1 =178550; // 84 t h p e r c e n t i l e p o i n t f a l l a t t2 =187750; // s t a n d a r d d e v i a t i o n sigma =( t2 - t1 ) /2; t=l/u; sigma_theta = sigma / t ; // V e s s e l d i s p e r s i o n number d = sigma_theta ^2/2; printf ( ” \n The v e s s e l d i s p e r s i o n number i s %f ” ,d )

Scilab code Exa 13.3 DuL FROM A ONE SHOT INPUT 1 clear 2 clc

49

3 4 5 6 7 8 9 10 11 12 13 14 15 16

// Bed v o i d a g e v =0.4; // S u p e r f i c i a l v e l o c i t y o f f l u i d ( cm/ s ) u =1.2; l =90; // l e n g t h ( cm ) // V a r i a n c e ( s e c ˆ 2 ) o f o u t p u t s i g n a l s sigma1_sqr =39; sigma2_sqr =64; dsigma_sqr = sigma2_sqr - sigma1_sqr ; // I n d i m e n s i o n l e s s form t=l*v/u; sigmatheta_sqr = dsigma_sqr / t ^2; // D i s p e r s i o n number d = sigmatheta_sqr /2; printf ( ” \n The v e s s e l d i s p e r s i o n number i s %f ” ,d )

Scilab code Exa 13.4 CONVERSION FROM THE DISPERSION MODEL 1 clear 2 clc 3 disp ( ” A l l t h e v a l u e s have t o be r e a d from t h e g i v e n

graph ”)

50

Chapter 14 The Tanks In Series Model

Scilab code Exa 14.1 MODIFICATIONS TO A WINERY 1 clear 2 clc 3 // O r i g i n a l and new l e n g t h (m) 4 L1 =32; L2 =50; 5 sigma1 =8; 6 // For s m a l l d e v i a q t i o n from p l u g f l o w , s i g m a s q r 7 8

is

d i r e c t l y p r o p o r t i o n a l to L sigma2 = sigma1 * sqrt ( L2 / L1 ) ; printf ( ” \n No o f b o t t l e s o f r o s e e x p e c t e d i s %f ” , sigma2 )

Scilab code Exa 14.2 A FABLE ON RIVER POLLUTION 1 clear 2 clc 3 sigma1 =14; sigma2 =10.5; 4 L1 =119; 5 // s p r e a d o f c u r v e i s d i r e c t l y

o f d i s t a n c e from o r i g i n 51

p r o p o r t i o n a l to s q r t

6 L = sigma1 ^2* L1 /( sigma1 ^2 - sigma2 ^2) ; 7 printf ( ” \n The dumping o f t o x i c p h e n o l must have

o c c u r e d w i t h i n %f ” ,L ) 8 printf ( ” m i l e s u p s t r e a m o f c i n c i n n a t i ” )

Scilab code Exa 14.3 F LOW MODELS FROM RTD CURVES 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

clear clc vo =1; t1 =1/6; t2 =1; t3 =11/6; w =1/10; // R a t i o o f a r e a s o f t h e f i r s t 2 p e a k s A2_by_A1 =0.5; R = A2_by_A1 /(1 - A2_by_A1 ) ; // From t h e l o c a t i o n o f 1 s t peak V1 =( R +1) * vo * t1 ; // From t h e t i m e b e t w e e n p e a k s V2 =( R * vo ) *(( t2 - t1 ) -( t1 ) ) ; // From f i g 1 4 . 3 N =1+(2*( t1 / w ) ) ^2; printf ( ” \n The r e f l u x r a t i o i s %f ” ,R ) printf ( ” \n The volume o f 1 s t t a n k i s %f ” , V1 ) printf ( ” \n The volume o f 2 nd t a n k i s %f ” , V2 ) printf ( ” \n The number o f t a n k s a r e %f ” ,N )

Scilab code Exa 14.4 FINDING THE VESSEL E CURVE USING A SLOPPY TRACER INPUT 1 clear 2 clc 3 // from f i g E14 . 4 a

52

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

t2 =280; t1 =220; sigma1_sqr =100; sigma2_sqr =1000; dt = t2 - t1 ; dsigma_sqr = sigma2_sqr - sigma1_sqr ; N = dt ^2/ dsigma_sqr ; for t =1:200 // For N t a n k i n s e r i e s E ( t ) =(( t ^( N -1) ) *( N ^ N ) * exp ( - t * N / dt ) ) /(( factorial (N -1) ) *( dt ^ N ) ) ; end for i =1:200 t(i)=i; end plot (t , E ) xlabel ( ’ t i m e ( s e c ) ’ ) ylabel ( ’E( s e c ˆ −1) ’ ) title ( ’ Shape o f E c u r v e ’ )

53

Chapter 16 Earliness of Mixing Segregation and RTD

Scilab code Exa 16.1 EFFECT OF SEGREGATION AND EARLINESS OF MIXING ON CONVERSION 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

clear clc Co =1; k =1; t =1; // g i v e n // Scheme A // For mixed f l o w r e a c t o r // t =(Co−C1 ) /KC1ˆ2 C1 =( -1+ sqrt (1 -4* t *( - Co ) ) ) /2* t ; // For t h e p l u g f l o w r e a c t o r // t =1/k ( 1 / C2−1/C1 ) C2 = C1 /(1+ k * t * C1 ) ; printf ( ” \n C o n v e r s i o n f o r f l o w scheme A i s %f ” , C2 ) // Scheme B // For p l u g f l o w C3 = Co /(1+ k * t * Co ) ; // For mixed f l o w r e a c t o r C4 =( -1+ sqrt (1 -4* t *( - C3 ) ) ) /2* t ; printf ( ” \n C o n v e r s i o n f o r f l o w scheme B i s %f ” , C4 ) // Scheme C , D, E // U s i n g e x i t a g e d i s t r i b u t i o n f n f o r 2 e q u a l p l u g − 54

20 21 22 23

mixed f l o w r e a c t o r system , u s i n g f i g 1 2 . 1 t_bar =2; in =1000; C5 = integrate ( ’ ( 2 / t b a r ) ∗ ( exp (1 −2∗ t / t b a r ) ) /(1+Co∗ k ∗ t ) ’ , ’ t ’ , t_bar /2 , in ) ; printf ( ” \n C o n v e r s i o n f o r f l o w scheme C , D, E i s %f ” , C5 )

55

Chapter 17 Heterogeneous Reactions

Scilab code Exa 17.1 THE BURNING OF A CARBON PARTICLE IN AIR 1 clear 2 clc 3 printf ( ” \n I t s a t h e o r o t i c a l

q u e s t i o n ”)

Scilab code Exa 17.2 AEROBIC FERMENTATION 1 clear 2 clc 3 printf ( ” \n I t s a t h e o r o t i c a l

q u e s t i o n ”)

Scilab code Exa 17.3 OVERALL RATE FOR A LINEAR PROCESS 1 clear 2 clc 3 printf ( ” \n I t s a t h e o r o t i c a l

56

q u e s t i o n ”)

Scilab code Exa 17.4 OVERALL RATE FOR A NONLINEAR PROCESS 1 clear 2 clc 3 printf ( ” \n I t s a t h e o r o t i c a l

57

q u e s t i o n ”)

Chapter 18 Solid Catalyzed Reactions

Scilab code Exa 18.1 SEARCH OF THE RATE CONTROLLING MECHANISM 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

clear clc dp =2.4*(10^ -3) ; L = dp /6; // E f f e c t i v e mass c o n d u c t i v i t y (m3/ h r . mcat ) De =5*10^ -5; // E f f e c t i v e t h e r m a l c o n d u c t i v i t y ( KJ/ h r . mcat .K) Keff =1.6; // For t h e g a s f i l m s u r r o u n d i n g t h e p e l l e t h =160; // h e a t t r a n s f e r c o e f f i c i e n t ( KJ/ h r . m2cat .K) kg =300; // mass t r a n s f e r c o e f f i c i e n t (m3/ h r . m2cat ) // For t h e r e a c t i o n Hr = -160; //KJ/molA CAg =20; // mol /m3 rA_obs =10^5; // mol / h r . m3cat kobs = rA_obs / CAg ; Vp =3.14*( dp ^3) /6; S =3.14*( dp ^2) ; // O b s e r v e d r a t e / r a t e i f f i l m r e s i s t a n c e c o n t r o l s ratio = kobs * Vp /( kg * S ) ; printf ( ” \n P a r t a ” ) if ratio 4 31 printf ( ” \n Pore d i f f u s i o n

i s i n f l u e n c i n g and h e n c e strong pore d i f f u s i o n ”)

32 33

else printf ( ” \n Pore d i f f u s i o n i s not i n f l u e n c i n g and h e n c e weak p o r e d i f f u u s i o n ” )

34 end 35 //Temp v a r i a t i o n w i t h i n p e l l e t 36 dt_max_pellet = De *( CAg -0) *( - Hr ) / Keff ; 37 //Temp v a r i a t i o n A c r o s s t h e g a s f i l m 38 dt_max_film = L * rA_obs *( - Hr ) / h ; 39 printf ( ” \n P a r t c ” ) 40 printf ( ” \n dTmax , p e l l e t i s %f ” , dt_max_pellet ) 41 printf ( ” d e g r e e C \n dTmax , f i l m i s %f ” , dt_max_film ) 42 printf ( ” d e g r e e C” ) 43 if dt_max_pellet length ( y ) then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r b o t h i n p u t a r g u m e n t s : same s i z e e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end if lx ==0 then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r i n p u t argument #%d : Must be > %d . \ n ” ) , ” r e g r e s s ” , 1 , 0) ) , end x = matrix (x , lx ,1) y = matrix (y , lx ,1) xbar = sum ( x ) / lx ybar = sum ( y ) / lx coefs (2) = sum (( x - xbar ) .*( y - ybar ) ) / sum (( x - xbar ) .^2) coefs (1) = ybar - coefs (2) * xbar endfunction // P r e s s u r e ( atm ) PAo =3.2; R =0.082; // l i t r e . atm / mol . k T =390; // k v =20; // l i t r e / h r W =0.01; // / kg CA_in =[0.1;0.08;0.06;0.04]; CA_out =[0.084;0.07;0.055;0.038]; CAo = PAo /( R * T ) ; 60

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

FAo = CAo * v ; eA =3; for i =1:4 XA_in ( i ) =(1 - CA_in ( i ) / CAo ) /(1+ eA * CA_in ( i ) / CAo ) ; XA_out ( i ) =(1 - CA_out ( i ) / CAo ) /(1+ eA * CA_out ( i ) / CAo ) ; dXA ( i ) = XA_out ( i ) - XA_in ( i ) ; rA ( i ) = dXA ( i ) /( W / FAo ) ; CA_avg ( i ) =( CA_in ( i ) + CA_out ( i ) ) /2; end plot ( CA_avg , rA ) xlabel ( ’CA( mol / l i t r e ) ’ ) ylabel ( ’−rA ( mol / h r . kg ) ’ ) coeff1 = regress ( CA_avg , rA ) k = coeff1 (2) printf ( ” \n The r a t e o f r e a c t i o n ( mol / h r . kg ) i s %f ” ,k ) printf ( ”CA” ) disp ( ’ The a n s w e r s l i g h t l y d i f f e r s from t h o s e g i v e n i n book a s r e g r e s s f n i s u s e d f o r c a l c u l a t i n g s l o p e and i n t e r c e p t ’ )

Scilab code Exa 18.3 THE RATE EQUATION FROM AN INTEGRAL REACTOR 1 clear 2 clc 3 function [ coefs ]= regress (x , y ) 4 coefs =[] 5 if ( type ( x ) 1) |( type ( y ) < >1) then error ( msprintf

6 7

8

( gettext ( ”%s : Wrong t y p e f o r i n p u t a r g u m e n t s : N u m e r i c a l e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end lx = length ( x ) if lx < > length ( y ) then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r b o t h i n p u t a r g u m e n t s : same s i z e e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end if lx ==0 then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r i n p u t argument #%d : Must be > %d . \ n ” ) , 61

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

” r e g r e s s ” , 1 , 0) ) , end x = matrix (x , lx ,1) y = matrix (y , lx ,1) xbar = sum ( x ) / lx ybar = sum ( y ) / lx coefs (2) = sum (( x - xbar ) .*( y - ybar ) ) / sum (( x - xbar ) .^2) coefs (1) = ybar - coefs (2) * xbar endfunction CAo =0.1; // mol / l i t r e FAo =2; // mol / h r eA =3; CA =[0.074;0.06;0.044;0.029]; // mol / l i t r e W =[0.02;0.04;0.08;0.16]; // kg // G u s s i n g 1 s t o r d e r , p l u g f l o w r x n // (1+eA ) ∗ l o g (1/(1 −XA) )−eA∗XA=k ∗ (CAo∗W/FAo ) for i =1:4 XA ( i ) =( CAo - CA ( i ) ) /( CAo + eA * CA ( i ) ) ; y ( i ) =(1+ eA ) * log (1/(1 - XA ( i ) ) ) - eA * XA ( i ) ; x ( i ) = CAo * W ( i ) / FAo ; W_by_FAo ( i ) = W ( i ) / FAo ; CAout_by_CAo ( i ) = CA ( i ) / CAo ; XA1 ( i ) =(1 - CAout_by_CAo ( i ) ) /(1+ eA * CAout_by_CAo ( i ) ) ; end plot (x , y ) coeff3 = regress (x , y ) ; xlabel ( ’CAoW/FAo ’ ) , ylabel ( ’ 4 l n (1/1 −XA) −3XA ’ ) k = coeff3 (2) ; printf ( ” \n P a r t a , u s i n g i n t e g r a l method o f a n a l y s i s ” ) printf ( ” \n The r a t e o f r e a c t i o n ( mol / l i t r e ) i s %f ” ,k ) printf ( ”CA” ) // P a r t b // p l o t t i n g W by FAo v s XA1 , t h e c a l c u l a t i n g rA=dXA/ d ( W/FAo ) f o r l a s t 3 p o i n t s , we g e t rA =[5.62;4.13;2.715]; coeff2 = regress ( CA (2:4) , rA ) ; printf ( ” \n P a r t b , u s i n g d i f f e r e n t i a l method o f a n a l y s i s ”) 62

printf ( ” \n The r a t e o f r e a c t i o n ( mol / l i t r e ) i s %f ” , coeff2 (2) ) 44 printf ( ”CA” ) 43

Scilab code Exa 18.4 PLUG FLOW REACTOR SIZE FROM A RATE EQUATION 1 2 3 4 5 6 7 8

clear clc XA =0.35; FAo =2000; // mol / h r eA =3; k =96; CAo =0.1; W =((1+ eA ) * log (1/(1 - XA ) ) - eA * XA ) *( FAo /( k * CAo ) ) ; printf ( ” \n The amount o f c a t a l y s t ( kg ) n e e d e d i n a p a c k e d bed r e a c t o r i s %f ” ,W )

Scilab code Exa 18.5 PLUG FLOW REACTOR SIZE FROM RATE CONCENTRATION DATA 1 2 3 4 5 6 7 8 9 10 11 12 13 14

clear clc CAo =0.1; eA =3; rA =[3.4;5.4;7.6;9.1]; CA =[0.039;0.0575;0.075;0.092]; XA = zeros (4 ,1) ; inv_rA = zeros (4 ,1) ; for i =1:4 XA ( i ) =(1 - CA ( i ) / CAo ) /(1+ eA * CA ( i ) / CAo ) ; inv_rA ( i ) =1/ rA ( i ) ; end //W=FAo∗ i n t e g r a l (dXA/−rA ) from 0 t o 0 . 3 5 // U s i n g T r a p e z o i d a l r u l e t o f i n d a r e a ,XA must be i n increasing order 63

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

// S o r t i n g XA and a c c o r d i n g l y i n v r A for i =1:4 small = XA ( i ) ; for j = i :4 next = XA ( j ) ; if small > next temp = XA ( i ) ; XA ( i ) = XA ( j ) ; XA ( j ) = temp ; temp1 = inv_rA ( i ) ; inv_rA ( i ) = inv_rA ( j ) ; inv_rA ( j ) = temp1 ; end end end plot ( XA , inv_rA ) xlabel ( ’XA ’ ) ; ylabel ( ’ −1/rA ’ ) ; // e x t e n d i n g p o i n t s t o i n c l u d e XA=0.35 XA (5) =0.35; inv_rA (5) =0.34; Area = inttrap ( XA , inv_rA ) ; W = Area *2000; printf ( ”Amount o f c a t a l y s t n e e d e d ( kg ) i s %f ” ,W ) disp ( ’ The a n s w e r s l i g h t l y d i f f e r s from t h o s e g i v e n i n book a s t r a p e z o i d a l r u l e i s u s e d f o r c a l c u l a t i n g area ’)

Scilab code Exa 18.6 MIXED FLOW REACTOR SIZE 1 2 3 4 5 6 7

clear clc XA =0.35; FAo =2000; // mol / h r CAo =0.1 // mol / l i t r e eA =3; k =96; CA = CAo *((1 - XA ) /(1+ eA * XA ) ) 64

8 rA = k * CA ; 9 // For mixed f l o w 10 W = FAo * XA / rA ; 11 printf ( ” The amount o f

c a t a l y s t n e e d e d ( kg ) i s %f ” ,W )

Scilab code Exa 18.7 MASS TRANSFER RESISTANCES 1 clear 2 clc 3 printf ( ” I t s a t h e o r o t i c a l qn ” )

65

Chapter 19 The Packed Bed Catalytic Reactor

Scilab code Exa 19.1 DESIGN OF A SINGLE ADIABATIC PACKED BED SYSTEM 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

clear clc Cp =40; // J / mol . k Hr =80000; // J / mol . k FAo =100; // mol / s nA =1; nB =7; n = nA + nB ; T1 =300; // k T2 =600; // k T3 =800; // k // S l o p e o f a d i a b a t i c i s m = Cp / Hr ; // Drawing v a r i o u s a d i a b a t i c s on g r a p h g i v e n i n F i g 1 9 . 1 1 , we g e t XA =[ 0.8;0.78 ;0.7;0.6 6;0.5;0. 26;0.1;0] ; inv_rA =[20;10;5;4.4;5;10;20;33]; plot ( XA , inv_rA ) xlabel ( ’XA ’ ) ; ylabel ( ’ i n v r A ’ ) ; disp ( ’ From t h e p l o t we can s a y t h a t a r e c y c l e 66

19 20 21 22 23 24 25 26 27 28

r e a c t o r s h o u l d be u s e d ’ ) W = FAo * XA (1) *6; // From P l o t R =1; Q1 = n * FAo * Cp *( T2 - T1 ) ; Q2 = n * FAo * Cp *( T1 - T3 ) ; printf ( ” \n The w e i g h t o f c a t a l y s t printf ( ” kg \n The R e c y c l e R a t i o printf ( ” \n The h e a t e x c h a n g e f o r /10^6) printf ( ” MW \n The h e a t e x c a h n g e %f ” , Q2 /10^6) printf ( ” MW” )

n e e d e d i s % f ” ,W ) i s %f ” ,R ) f e e d i s %f ” , Q1 f o r the product i s

Scilab code Exa 19.2 DESIGN OF A TWO ADIABATIC PACKED BED SYSTEM 1 2 3 4 5 6 7 8

9 10 11 12 13 14 15

clear clc Cp =40; Hr =80000; m = Cp / Hr ; FAo =100; // mol / s // Drawing v a r i o u s a d i a b a t i c s on g r a p h g i v e n i n F i g 19.11 , //We s e e from f i g E 1 9 . 2 a , t h a t t h i s g i v e s v e r y s h a l l o w a d i a b a t i c , As r a t e c o n t i n u a l l y i n c r e a s e a s you move a l o n g h t i s a d i a b a t i c disp ( ’We s h o u l d u s e a mixed f l o w r e a c t o r o p e r a t i n g a t optimum ’ ) XA =[0.85; 0.785;0.715;0.66;0.58 ;0.46]; inv_rAopt =[20;10;5;3.6;2;1]; plot ( XA , inv_rAopt ) xlabel ( ’XA ’ ) ; ylabel ( ’ rAˆ−1 ’ ) ; // U s i n g method o f m a x i m i z a t i o n o f r e c t a n g l e s area1 =0.66*3.6; 67

16 area2 =(0.85 -0.66) *20; 17 W1 = FAo * area1 ; 18 W2 = FAo * area2 ; 19 printf ( ” \n The w e i g h t o f 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

c a t a l y s t n e e d e d f o r 1 s t bed i s %f ” , W1 ) printf ( ” kg \n The w e i g h t o f c a t a l y s t n e e d e d f o r 2 ndbed i s %f ” , W2 ) printf ( ” kg ” ) // Heat e x c h a n g e // For t h e f i r s t r e a c t o r //To go t o 66% c o n v e r s i o n a t 820 d e g r e e C , t h e amount o f h e a t n e e d e d p e r mol o f A i s Q =(820 -300) * Cp +0.66*( - Hr ) ; // For 100 mol / s Q1 = FAo * Q /10^6; //MW printf ( ” \n The amount o f h e a t e x c h a n g e d f o r 1 s t r e a c t o r i s %f ” , Q1 ) printf ( ”MW” ) // For 2 nd r e a c t o r //To go from XA=0.66 a t 820 k t o XA=0.85 a t 750 k Q2 = FAo *((750 -820) * Cp +(0.85 -0.66) *( - Hr ) ) ; Q2 = Q2 /10^6; printf ( ” \n The amount o f h e a t e x c h a n g e d f o r 2 nd r e a c t o r i s %f ” , Q2 ) printf ( ”MW” ) // For t h e e x c h a n g e r n e e d e d t o c o o l t h e e x i t s t r e a m from 750 k t o 300 k Q3 = FAo * Cp *(300 -750) ; Q3 = Q3 /10^6; //MW printf ( ” \n The amount o f h e a t e x c h a n g e d f o r e x c h a n g e r i s %f ” , Q3 ) printf ( ”MW” )

68

Chapter 20 Reactors with Suspended Solid Catalyst Fluidized Reactors of Various Types

Scilab code Exa 20.1 First Order Catalytic Reaction in a BFB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

clear clc uo =0.3; umf =0.03; //m/ s vo =0.3*3.14159; //m3/ s d =2; //m db =0.32; // d i a o f b u b b l e (m) emf =0.5; W =7000; // kg CAo =100; // mol /m3 D =20*10^ -6; //m2/ s density =2000; // kg /m3 k =0.8; alpha =0.33; g =9.8; //m/ s 2 // U s i n g b u b b l i n g bed model // R i s e v e l o c i t y o f b u b b l e s ubr =0.711* sqrt ( g * db ) ; 69

18 19 20 21 22 23 24 25 26 27 28 29

30 31 32 33 34 35 36 37 38

ub = uo - umf + ubr ; delta = uo / ub ; ef =1 -(1 - emf ) *(1 - delta ) ; Kbc =4.5*( umf / db ) +5.85*( D ^0.5) *( g ^0.25) /( db ^1.25) ; Kce =6.77* sqrt ( emf * D * ubr / db ^3) ; fb =0.001; fc = delta *(1 - emf ) *((3* umf / emf ) /( ubr - umf / emf ) + alpha ) ; fe =(1 - emf ) *(1 - delta ) -fc - fb ; ft = fb + fe + fc ; A =3.14* d * d /4; Hbfb = W /(( density * A ) *(1 - ef ) ) ; XA =1 - inv ( exp ( fb * k +(1/((1/( delta * Kbc ) ) +1/(( fc * k ) +(1/((1/( delta * Kce ) ) +(1/( fe * k ) ) ) ) ) ) ) *( Hbfb * ft / uo ) / ft ) ) ; XA1 =100* XA ; // i n p e r c e n t a g e printf ( ” \n P a r t a ” ) printf ( ” \n C o n v e r s i o n o f r e a c t a n t i s %f ” , XA1 ) CA_avg = CAo * XA * vo * density /( k * W ) ; printf ( ” \n P a r t b ” ) printf ( ” \n The p r o p e r mean c o n c e n t r a t i o n ( mol /m3) o f A s e e n by s o l i d i s %f ” , CA_avg ) XA1 =1 - inv ( exp ( k * ft * Hbfb / uo ) ) ; printf ( ” \n P a r t c ” ) printf ( ” \n C o n v e r s i o n o f r e a c t a n t f o r p a c k e d bad i s %f ” , XA1 )

70

Chapter 21 Deactivating Catalysts

Scilab code Exa 21.1 INTERPRETING KINETIC DATA IN THE PRESENCE OF PORE DIFFUSION R 1 clear 2 clc 3 function [ coefs ]= regress (x , y ) 4 coefs =[] 5 if ( type ( x ) 1) |( type ( y ) < >1) then error ( msprintf

6 7

8

9 10 11 12 13 14 15

( gettext ( ”%s : Wrong t y p e f o r i n p u t a r g u m e n t s : N u m e r i c a l e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end lx = length ( x ) if lx < > length ( y ) then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r b o t h i n p u t a r g u m e n t s : same s i z e e x p e c t e d . \ n ” ) ,” r e g r e s s ” ) ) , end if lx ==0 then error ( msprintf ( gettext ( ”%s : Wrong s i z e f o r i n p u t argument #%d : Must be > %d . \ n ” ) , ” r e g r e s s ” , 1 , 0) ) , end x = matrix (x , lx ,1) y = matrix (y , lx ,1) xbar = sum ( x ) / lx ybar = sum ( y ) / lx coefs (2) = sum (( x - xbar ) .*( y - ybar ) ) / sum (( x - xbar ) .^2) coefs (1) = ybar - coefs (2) * xbar endfunction 71

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

t =[0;2;4;6]; XA =[0.75;0.64;0.52;0.39]; t1 =4000; // kg . s /m3 density_s =1500; // kg /m3 De =5*10^ -10; d =2.4*10^ -3; // Assuming −rA=kCA∗ a ,− da / d t=kd ∗ a // For t h i s r a t e a p l o t o f l n (CAo/CA−1) v s t s h o u l d give a straight line for i =1:4 y ( i ) = log ((1/(1 - XA ( i ) ) ) -1) ; end plot (y , t ) xlabel ( ’ t ’ ) ylabel ( ’ l n (CAo/CA−1) ’ ) // G u e s s i n g No I n t r u s i o n o f D i f f u s i o n a l R e s i s t a n c e // l n (CAo/CA−1)=l n ( k ∗ t 1 )−kd ∗ t coeff = regress (t , y ) ; kd = coeff (2) ; k = exp ( coeff (1) ) / t1 ; L = d /6; Mt = L * sqrt ( k * density_s / De ) ; // Assuming Runs w e r e made i n r e g i m e o f s t r o n g r e s i s t a n c e to pore d i f f u s i o n k1 =(( exp ( coeff (1) ) ) ^2) *( L ^2) * density_s /( t1 * t1 * De ) ; kd1 = -2* coeff (2) ; Mt = L * sqrt ( k1 * density_s / De ) ; printf ( ” \n Rate e q u a t i o n ( mol / kg . s ) i n d i f f u s i o n f r e e r e g i m e w i t h d e a c t i v a t i o n i s %f ” , k1 ) printf ( ”CA∗ a w i t h \n −da / d t ( hr −1) i s %f ” , kd1 ) printf ( ” a ” ) // I n s t r o n g p o r e d i f f u s i o n k2 = k1 * sqrt ( De /( k1 * density_s ) ) ; printf ( ” \n Rate e q u a t i o n ( mol / kg . s ) i n s t r o n g p o r e d i f f u s i o n r e s i s t a n c e regime with d e a c t i v a t i o n i s %f ” , k2 ) printf ( ”CA∗ a ˆ 0 . 5 / L w i t h \n −da / d t ( hr −1) i s %f ” , kd1 ) printf ( ” a ” ) 72

Scilab code Exa 21.2 DEACTIVATION IN A PACKED BED REACTOR 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

clear clc PAo =3; // atm R =82.06*10^ -6; //m3 . atm / mol . k T =730; // k W =1000; // kg FAo =5000; // mol / h r CAo = PAo /( R * T ) ; tau = W * CAo / FAo ; i =0; for t =0:5:120 i = i +1; // P a r t a a ( i ) =1 -(8.3125*10^ -3) * t ; XA ( i ) =( tau ^2) * a ( i ) /(1+( tau ^2) * a ( i ) ) ; // P a r t b a1 ( i ) = exp ( -0.05* t ) ; XA1 ( i ) =( tau ^2) * a1 ( i ) /(1+( tau ^2) * a1 ( i ) ) ; // P a r t c a2 ( i ) =1/(1+3.325* t ) ; XA2 ( i ) =( tau ^2) * a2 ( i ) /(1+( tau ^2) * a2 ( i ) ) ; // P a r t d a3 ( i ) =1/( sqrt (1+1333* t ) ) ; XA3 ( i ) =( tau ^2) * a3 ( i ) /(1+( tau ^2) * a3 ( i ) ) ; end t =[0:5:120]; plot (t , XA ,t , XA1 ,t , XA2 ,t , XA3 ) xlabel ( ’ Time ( d a y s ) ’ ) ylabel ( ’XA ’ ) legend ( ’ Z e r o Order ’ , ’ 1 s t Order ’ , ’ 2 nd Order ’ , ’ 3 r d Order ’ ) ; 31 XA_avg =(1/120) * integrate ( ’ ( 1 0 0 ∗ ( 1 − ( 8 . 3 1 2 5 ∗ 1 0 ˆ − 3 ) ∗ t ) ) 73

32 33 34 35 36 37 38

/ ( 1 + 1 0 0 ∗ ( 1 − ( 8 . 3 1 2 5 ∗ 1 0 ˆ − 3 ) ∗ t ) ) ’ , ’ t ’ ,0 ,120) ; XA1_avg =(1/120) * integrate ( ’ ( 1 0 0 ∗ exp ( − 0 . 0 5 ∗ t ) ) /(1+100∗ exp ( − 0 . 0 5 ∗ t ) ) ’ , ’ t ’ ,0 ,120) ; XA2_avg =(1/120) * integrate ( ’ ( 1 0 0 ∗ ( 1 / ( 1 + 3 . 3 2 5 ∗ t ) ) ) / ( 1 + 1 0 0 ∗ ( 1 / ( 1 + 3 . 3 2 5 ∗ t ) ) ) ’ , ’ t ’ ,0 ,120) ; XA3_avg =(1/120) * integrate ( ’ ( 1 0 0 ∗ 1 / ( s q r t (1+1333∗ t ) ) ) / ( 1 + 1 0 0 ∗ ( 1 / s q r t (1+1333∗ t ) ) ) ’ , ’ t ’ ,0 ,120) ; printf ( ” \n f o r d =0 , t h e mean c o n v e r s i o n i s % f ” , XA_avg ) printf ( ” \n f o r d =1 , t h e mean c o n v e r s i o n i s % f ” , XA1_avg ) printf ( ” \n f o r d =2 , t h e mean c o n v e r s i o n i s % f ” , XA2_avg ) printf ( ” \n f o r d =3 , t h e mean c o n v e r s i o n i s % f ” , XA3_avg )

74

Chapter 22 GL Reactions on Solid Catalysts

Scilab code Exa 22.1 HYDROGENATION OF ACETONE IN A PACKED BUBBLE COLUMN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

clear clc PA =101325; // Pa HA =36845; //PA . m3 . l / mol CBo =1000; // mol /m3 v =10^ -4; //m3∗ l / s h =5; //m A =0.1; //m2 CA = PA / HA ; FBo = v * CBo ; Vr = A * h ; dp =5*10^ -3; // mcat d_solid =4500; // kg / m3cat De =8*10^ -10; // m3l / mcat . s n =0.5; b =1; k =2.35*10^ -3; L = dp /6; kai_overall =0.02; 75

20 21 22 23 24 25

kac_ac =0.05; f =0.6; // For a h a l f −o r d e r r e a c t i o n Mt = L * sqrt (( n +1) *( k * d_solid *( CA ) ^( n -1) ) /(2* De ) ) ; E =1/ Mt ; rA =(1/((1/( kai_overall ) ) +(1/( kac_ac ) ) +(1/( k * b *( CA ^( n -1) ) * E * f * d_solid ) ) ) ) *( PA / HA ) ; 26 // From M a t e r i a l B a l a n c e 27 XB = b * rA * Vr / FBo ; 28 printf ( ” \n The c o n v e r s i o n o f a c e t o n e i s %f ” , XB )

Scilab code Exa 22.2 HYDROGENATION OF A BATCH OF BUTYNEDIOL IN A SLURRY REACTOR 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

clear clc PA =14.6*101325; // Pa HA =148000; Vr =2; Vl = Vr ; b =1; fs =0.0055; k =5*10^ -5; // m6l / kg . m o l c a t . s dp =5*10^ -5; // mcat kac =4.4*10^ -4; kai =0.277; // m3l /m3 . r . s density =1450; // kg /m3 De =5*10^ -10; // m3l / mcat . s L = dp /6; // f o r s p h e r i c a l p a r t i c l e CA = PA / HA ; X =0.9; CBo =2500; // mol /m3 . l CB = CBo *(1 - X ) ; ac =6* fs / dp ;; K = kac * ac ; // G u e s s i n g d i f f e r e n t v a l u e s o f CB CB =[2500;1000;250]; 76

23 e =[0.19;0.29;0.5]; 24 for i =1:3 25 Mt ( i ) = L * sqrt ( k * CB ( i ) * density / De ) ; 26 rA ( i ) = CA /((1/ kai ) +(1/ K ) +(1/( k * density * e ( i ) * fs * CB

(i)))) inv_rA ( i ) =1/ rA ( i ) ;

27 28 end 29 plot ( CB , inv_rA ) 30 xlabel ( ’CB ’ ) ; ylabel ( ’ −1/rA ’ ) 31 // R e a c t i o n t i m e i s g i v e n by ( Vl /b∗Vr ) ∗ i n t e g r a l (dCB/− 32 33 34 35 36 37

rA ) // G r a p h i c a l l y i n t e g r a t i n g Area =3460; t = Vl * Area /( b * Vr ) ; t = t /60; // min printf ( ” \n The t i m e r e q u i r e d f o r 90 p e r c e n t a g e c o n v e r s i o n o f r e a c t a n t i s %f ” ,t ) printf ( ” min ” )

77

Chapter 23 Fluid Fluid Reactions Kinetics

Scilab code Exa 23.1 FINDING THE RATE OF A GL REACTION 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

clear clc k =10^6; Kag_a =0.01; fl =0.98; Kal =1; HA =10^5; DAl =10^ -6; DBl = DAl ; PA =5*10^3; // Pa CB =100; // mol /m3 b =2; a =20; //m2/m3 Mh = sqrt ( DAl * k * CB * CB ) / Kal ; Ei =1+( DBl * CB * HA /( b * DAl * PA ) ) ; E =100; printf ( ” \n P a r t a ” ) res_total =(((1/( Kag_a ) ) +( HA /( Kal * a * E ) ) +( HA /( k * CB * CB * fl ) ) ) ) ; // T o t a l R e s i s t a n c e 18 f_gas =(1/( Kag_a ) ) / res_total ; // f r a c t i o n o f r e s i s t a n c e in gas f i l m 19 f_liq =( HA /( Kal * a * E ) ) / res_total ; // f r a c t i o n o f 78

20 21 22 23 24 25 26

r e s i s t a n c e in l i q u i d film printf ( ” \n F r a c t i o n o f t h e r e s i s t a n c e i n t h e g a s f i l m i s %f ” , f_gas ) printf ( ” \n F r a c t i o n o f t h e r e s i s t a n c e i n t h e l i q u i d f i l m i s %f ” , f_liq ) printf ( ” \n P a r t b ” ) printf ( ” \n The r e a c t i o n z o n e i s i n t h e l i q u i d f i l m ” ) printf ( ” \n P a r t c ” ) if Ei >5* Mh printf ( ” \n We have p s e u d o 1 s t o r d e r r e a c t i o n i n the f i l m ”) end // From f i g 2 3 . 4

27 28 29 30 rA = PA /(((1/( Kag_a ) ) +( HA /( Kal * a * E ) ) +( HA /( k * CB * CB * fl ) )

)); 31 printf ( ” \n P a r t d ” ) 32 printf ( ” \n The r a t e o f r e a c t i o n ( mol /m3 . h r ) i s %f ” , rA )

79

Chapter 24 Fluid Fluid Reactors Design

Scilab code Exa 24.1 TOWERS FOR STRAIGHT ABSORPTION 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

clear clc kag_a =0.32; // mol / h r . m3 . Pa kal_a =0.1; // h r HA =12.5; // Pa . m3/ mol Fg =10^5; // mol / h r . m2 Fl =7*10^5; // mol / h r . m2 Ct =56000; // mol /m3 P =10^5; // Pa // pA3−pA1=( F l ∗P) ∗ ( CA3−CA1) / ( Fg∗CT) //CA3=0. 08 ∗PA3−1.6 inv_Kag_a = inv ( kag_a ) + HA /( kal_a ) ; Gfilm_res =( inv ( kag_a ) ) / inv_Kag_a ; Lfilm_res =( HA /( kal_a ) ) / inv_Kag_a ; Kag_a =1/ inv_Kag_a ; // d=PA−PA∗ // p=PA−HA∗ ( 0 . 0 8 ∗ PA− 1 . 6 ) ; d =20; h =( Fg /( P * Kag_a ) ) * integrate ( ’ 1 / 2 0 ’ , ’ dp ’ ,20 ,100) ; printf ( ” \n The h e i g h t o f t h e t o w e r r e q u i r e d f o r c o u n t e r c u r r e n t o p e r a r t i o n s i s % f ” ,h ) 80

21

printf ( ”m” )

Scilab code Exa 24.2 TOWERS FOR HIGH CONCENTRATION OF LIQUID REACTANT 1 2 3 4 5 6 7 8 9 10 11

clear clc Fg =10^5; P =10^5; Fg_by_Acs =10^5; // ( Fg/ Acs ) PA1 =20; PA2 =100; kag_a =0.32; // rA=k a g a ∗P // H e i g h t o f Tower // h =(( Fg/ Acs ) ∗ i n t e g r a l (dPA/ rA ) ) /P h =( Fg_by_Acs / P ) * integrate ( ’ 1 / ( 0 . 3 2 ∗PA) ’ , ’PA ’ ,PA1 , PA2 ); 12 printf ( ” \n The h e i g h t o f t h e t o w e r i s %f ” ,h ) 13 printf ( ”m” )

Scilab code Exa 24.3 TOWERS FOR LOW CONCENTRATION OF LIQUID REACTANT CASE A 1 2 3 4 5 6 7 8 9 10 11 12

clear clc Fg =10^5; P =10^5; PA1 =20; PA2 =100; HA =12.5; kaga =0.32; kla =0.1; //CB=(420−PA3 ) / 1 2 . 5 ; // rA =((HA∗CB)+pA ) / ( ( 1 / kaga ) +(HA/ k l a ) ) rA =420/((1/ kaga ) +( HA / kla ) ) ; h =( Fg / P ) * integrate ( ’ 1/ rA ’ , ’PA ’ ,PA1 , PA2 ) ; printf ( ” The h e i g h t o f t h e t o w e r i s %f ” ,h ) 81

13

printf ( ”m” )

Scilab code Exa 24.4 TOWERS FOR INTERMEDIATE CONCENTRATIONS OF LIQUID REACTANT 1 2 3 4 5 6 7 8 9 10 11 12 13

clear clc // U s i n g m a t e r i a l b a l a n c e , we have //PA3=1620 −12.5∗CB3 PA1 =20; PA2 =100; // Pa Fg_by_Acs =10^5; P =10^5; HA =12.5; kaga =0.32; kla =0.1; // Form o f r a t e eqn c h a n g e s a t PA=39.5 Pa PA =39.5; // Pa // h =(( Fg/ Acs ) ∗ i n t e g r a l (dPA/ rA ) ) /P h =( Fg_by_Acs / P ) *( integrate ( ’ 1 / ( kaga ∗P) ’ , ’P ’ ,PA1 , PA ) + integrate ( ’ ( ( 1 / kaga ) +(HA/ k l a ) ) / 1 6 2 0 ’ , ’PA ’ ,PA , PA2 ) ); 14 printf ( ” The h e i g h t o f t h e t o w e r i s %f ” ,h ) 15 printf ( ”m” )

Scilab code Exa 24.5 REDO EXAMPLE 24 2 BY THE GENERAL METHOD 1 2 3 4 5 6 7 8 9

clear clc Fg =10^5; P =10^5; Fg_by_Acs =10^5; // ( Fg/ Acs ) PA1 =20; PA2 =100; kag_a =0.32; // H e i g h t o f Tower // h =(( Fg/ Acs ) ∗ i n t e g r a l (dPA/ rA ) ) /P 82

10 // rA = ( 1 / ( 3 . 1 2 5 + 1 2 5 /E) ) ∗PA ; 11 // Taking E= i n f i n i t y , rA=pA / 3 . 1 2 5 12 h =( Fg_by_Acs / P ) * integrate ( ’ 1 / (PA/ 3 . 1 2 5 ) ’ , ’PA ’ ,PA1 , 13 14

PA2 ) ; printf ( ” \n The h e i g h t o f t h e t o w e r i s %f ” ,h ) printf ( ”m” )

Scilab code Exa 24.6 REACTION OF A BATCH OF LIQUID 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

clear clc kag_a =0.72; kal_a =144; HA =1000; Fg =9000; // mol / h r fl =0.9; b =1; Vr =1.62; //m3 DA =3.6*10^ -6; //m2/ h r a =100; //m2/m3 k =2.6*10^5; //m3/ mol . h r DB = DA ; P =10^5; PA =1000; // Pa kal = kal_a / a ; // At t h e s t a r t CBo =555.6; Mh =( sqrt ( DB * k * CBo ) ) / kal ; // Min v a l u e o f EAi Ei =1+( CBo * HA / PA ) ; if Ei > Mh E = Mh ; end rA1 = PA /(( P * Vr / Fg ) +(1/ kag_a ) +( HA /( kal_a * E ) ) +( HA /( k * fl * CBo ) ) ) ; 24 // At t h e end 25 CBf =55.6; 83

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

Mh =( sqrt ( DB * k * CBf ) ) / kal ; // Min v a l u e o f EAi Ei =1+( CBf * HA / PA ) ; if Ei > Mh E = Mh ; end rA2 = PA /(( P * Vr / Fg ) +(1/ kag_a ) +( HA /( kal_a * E ) ) +( HA /( k * fl * CBf ) ) ) ; // A v e r a g e r a t e o f r e a c t i o n rA_avg =( rA1 + rA2 ) /2; t =( fl / b ) * integrate ( ’ 1/ r A a v g ’ , ’CB ’ ,CBf , CBo ) ; printf ( ” \n P a r t a ” ) printf ( ” \n The run t i m e n e e d e d i s %f ” ,t ) printf ( ” h r ” ) // The min t i m e r e q u i r e d i s tmin = Vr *( CBo - CBf ) /( Fg *( PA /( P - PA ) ) ) ; printf ( ” \n The minimum t i m e r e q u i r e d i s %f ” , tmin ) printf ( ” h r ” ) // F r a c t i o n o f r e a c t a n t which p a s s e s t h r o u g h t h e t a n k unreacted i s f =( t - tmin ) / tmin ; printf ( ” \n P a r t b ” ) printf ( ” \n F r a c t i o n o f r e a c t a n t which p a s s e s t h r o u g h t h e t a n k u n r e a c t e d i s %f ” ,f )

84

Chapter 26 Fluid Particle Reactors Design

Scilab code Exa 26.1 CONVERSION OF A SIZE MIXTURE IN PLUG FLOW 1 clear 2 clc 3 // L e t s s a y F ( Ri ) /F=F r i 4 F_50 =0.3; F_100 =0.4; F_200 =0.3; 5 // The t i m e r e q u i r e d ( min ) f o r 3 s i z e o f p a r t i c l e s i s 6 t_50 =5; t_100 =10; t_200 =20; 7 // C o s i d e r i n g s o l i d s t o be i n p l u g f l o w w i t h t p=8 min 8 tp =8; 9 //1−XBavg=[1−XB( 5 0 um) ] F ( 5 0 um) /F+ [1 −XB( 1 0 0 um) ] F

( 1 0 0 um) /F + . . . . . . . 10 // B e c a u s e f o r 3 s i z e s o f p a r t i c l e s , R1 : R2 : R3=t 1 : t 2 : t 3 11 // From eqn 2 5 . 2 3 , [ 1 −XB( Ri ) ]=(1 − t p / t ( r i ) ) ˆ3 12 a =((1 -( tp / t_50 ) ) ^3) * F_50 ; b =((1 -( tp / t_100 ) ) ^3) * F_100 ; 13 14 15 16 17 18 19

c =((1 -( tp / t_200 ) ) ^3) * F_200 ; g =[ a ,b , c ]; sum1 =0; for p =1:3 if g ( p ) >0 sum1 = sum1 + g ( p ) ; end end 85

20 21

f_converted =1 - sum1 ; printf ( ” \n The f r a c t i o n o f s o l i d c o n v e r t e d e q u a l s %f ” , f_converted )

Scilab code Exa 26.2 CONVERSION OF A SINGLE SIZED FEED IN A MIXED FLOW REACTOR 1 clear 2 clc 3 t_avg =60; t =20; // min 4 // For c h e m i c a l r x n c o n t r o l l i n g , t =kR 5 unconverted =((1/4) *( t / t_avg ) ) -((1/20) *( t / t_avg ) ^2) 6 7 8 9

+((1/120) *( t / t_avg ) ^3) ; // For a s h l a y e r d i f f u s i o n c o n t r o l l i n g , t=k1R ˆ2 unconverted1 =((1/5) *( t / t_avg ) ) -((19/420) *( t / t_avg ) ^2) +((41/4620) *( t / t_avg ) ^3) ; c_avg =( unconverted + unconverted1 ) /2; printf ( ” F r a c t i o n o f o r i g i n a l s u l f i d e o r e r e m a i n u n c o n v e r t e d i s %f ” , c_avg )

Scilab code Exa 26.3 CONVERSION OF A FEED MIXTURE IN A MIXED FLOW REACTOR 1 clear 2 clc 3 F =1000; //gm/ min 4 W =10000; //gm 5 t_avg = W / F ; 6 F_50 =300; F_100 =400; F_200 =300; //gm/ min 7 t_50 =5; t_100 =10; t_200 =20; // min 8 unconverted =((((1/4) *( t_50 / t_avg ) ) -((1/20) *( t_50 /

t_avg ) ^2) +((1/120) *( t_50 / t_avg ) ^3) ) *( F_50 / F ) ) +((((1/4) *( t_100 / t_avg ) ) -((1/20) *( t_100 / t_avg ) ^2) +((1/120) *( t_50 / t_avg ) ^3) ) *( F_100 / F ) ) +((((1/4) *( 86

t_200 / t_avg ) ) -((1/20) *( t_200 / t_avg ) ^2) +((1/120) *( t_50 / t_avg ) ^3) ) *( F_200 / F ) ) ; 9 converted =1 - unconverted ; 10 printf ( ” The mean c o n v e r s i o n o f s o i l d i s %f ” , converted ) 11 printf ( ” \n The a n s w e r s l i g h t l y d i f f e r s from t h o s e g i v e n i n book a s we have c o n s i d e r e d o n l y s i g n i f i c a n t terms in i n f i n i t e s e r i e s ”)

Scilab code Exa 26.4 FINDING THE SIZE OF A FLUIDIZED BED 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

clear clc t1 =1; // h r // t=k ∗ ( 1 / CAo) // For e q u a l s t o i c h i o m e t r i c f e e d XA=XB=0.9 // CAf/CAo=0.1 t2 = t1 /0.1; // f i n d i n g t / t a v g which g i v e s XB=0.9 i e 1−XB=0.1 for a =0:0.0001:1; // x=1−XB x =(1/4) *( a ) -((1/20) *( a ) ^2) +((1/120) *( a ) ^3) ; if x >0.099 & x