Scilab Code for Elements of chemical Reaction Engineering PDF

Title Scilab Code for Elements of chemical Reaction Engineering
Author Samson Ayalew
Pages 105
File Size 421.6 KB
File Type PDF
Total Downloads 73
Total Views 257

Summary

Scilab Code for Elements of chemical Reaction Engineering by H. Scott Fogler1 Created by Santosh Kumar Dual Degree student B. tech + M. Tech (Chem. Engg.) Indian Institute of Technology, Bombay College Teacher and Reviewer Arun Sadashio Moharir Professor IIT Bombay IIT Bombay 17 October 2010 1 Funde...


Description

Scilab Code for Elements of chemical Reaction Engineering by H. Scott Fogler1 Created by Santosh Kumar Dual Degree student B. tech + M. Tech (Chem. Engg.) Indian Institute of Technology, Bombay College Teacher and Reviewer Arun Sadashio Moharir Professor IIT Bombay IIT Bombay 17 October 2010

1 Funded

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

Book Details Author: H. Scott Fogler Title: Elements of chemical Reaction Engineering Publisher: Prentice-Hall International, Inc., New Jersey Edition: Third Year: 2009 Place: New Jersey ISBN: 0-13-973785-5

1

Contents List of Scilab Code

4

1 Mole Balances 1.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

9 9 9

2 Conversion and Reactor Sizing 2.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

11 11 11

3 Rate Laws and Stoichiometry 3.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

17 17 17

4 Isothermal Reactor Design 4.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

19 19 19

5 Collection and Analysis of Rate Data 5.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

37 37 37

6 Multiple Reactions 6.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

40 40 40

7 Nonelementary Reaction Kinetics 7.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

45 45 45

2

8 Steady State Nonisothermal Reactor Design 8.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

50 50 50

9 Unsteady State Nonisothermal Reactor Design 9.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

69 69 69

10 Catalysis and Catalytic Reactors 10.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

86 86 86

11 External Diffusion Effects on Hetrogeneous Reactions 11.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

94 94 94

12 Diffusion and Reaction in Pours Catalysts 12.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

97 97 97

13 Distributions of Residence Times for Chemical Reactions 13.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . .

98 98 98

14 Models for Nonideal Reactors 102 14.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 14.2 Scilab Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

3

List of Scilab Code 1.3 1.3 2.1 2.1 2.2 2.2 2.3 2.3 2.4 2.4 2.5 2.5 2.6 2.6 2.7 2.7 3.5 3.5 4.1 4.1 4.2 4.2 4.4 4.4 4.5 4.5 4.6 4.6

1.3data.sci 1.3.sce . . 2.1data.sci 2.1.sce . . 2.2data.sci 2.2.sce . . 2.3data.sci 2.3.sce . . 2.4data.sci 2.4.sce . . 2.5data.sci 2.5.sce . . 2.6data.sci 2.6.sce . . 2.7data.sci 2.7.sce . . 3.5data.sci 3.5.sce . . 4.1data.sci 4.1.sce . . 4.2data.sci 4.2.sce . . 4.4data.sci 4.4.sce . . 4.5data.sci 4.5.sce . . 4.6data.sci 4.6.sce . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

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

4.7 4.7 4.8 4.8 4.9 4.9 4.10 4.10 4.11 4.11 5.2 5.2 5.3 5.3 5.4 5.4 6.6 6.6 6.8 6.8 7.7 7.7 7.8 7.8 7.9 7.9 8.3 8.3 8.4 8.4 8.6 8.6 8.7 8.7 8.8 8.8 8.10 8.11

4.7data.sci . 4.7.sce . . . 4.8data.sci . 4.8.sce . . . 4.9data.sci . 4.9.sce . . . 4.10data.sci 4.10.sce . . . 4.11data.sci 4.11.sce . . . 5.2data.sci . 5.2.sce . . . 5.3data.sci . 5.3.sce . . . 5.4data.sci . 5.4.sce . . . 6.6data.sci . 6.6.sce . . . 6.8data.sci . 6.8.sce . . . 7.7data.sci . 7.7.sce . . . 7.8data.sci . 7.8.sce . . . 7.9data.sci . 7.9.sce . . . 8.3data.sci . 8.3.sce . . . 8.4data.sci . 8.4.sce . . . 8.6data.sci . 8.6.sce . . . 8.7data.sci . 8.7.sce . . . 8.8data.sci . 8.8.sce . . . 8.10.sce . . . 8.11data.sci

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24 24 25 28 30 30 31 31 32 34 37 37 38 38 39 39 40 40 41 41 45 45 46 47 47 47 50 50 51 51 52 52 55 55 58 58 61 63

8.11 8.12 8.12 9.1 9.1 9.2 9.2 9.3 9.3 9.4 9.4 9.8 9.8 10.3 10.3 10.5 10.5 10.7 10.7 11.1 11.1 11.3 11.3 11.4 11.4 11.5 11.5 13.8 13.8 13.9 13.9 14.3

8.11.sce . . . 8.12data.sci 8.12.sce . . . 9.1data.sci . 9.1.sce . . . 9.2data.sci . 9.2.sce . . . 9.3data.sci . 9.3.sce . . . 9.4data.sci . 9.4.sce . . . 9.8data.sci . 9.8.sce . . . 10.3data.sci 10.3.sce . . . 10.5data.sci 10.5.sce . . . 10.7data.sci 10.7.sce . . . 11.1data.sci 11.1.sce . . . 11.3data.sci 11.3.sce . . . 11.4data.sci 11.4.sce . . . 11.5data.sci 11.5.sce . . . 13.8data.sci 13.8.sce . . . 13.9data.sci 13.9.sce . . . 14.3.sce . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

63 67 67 69 69 72 72 74 74 78 78 80 80 86 86 88 90 91 92 94 94 95 95 96 96 96 96 98 98 99 100 102

List of Figures 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8

Output Output Output Output Output Output Output Output

graph graph graph graph graph graph graph graph

. . . . . . . .

20 26 27 29 31 33 35 36

5.1

Output graph of S 5.2 . . . . . . . . . . . . . . . . . . . . .

38

6.1 6.2

Output graph of S 6.6 . . . . . . . . . . . . . . . . . . . . . Output graph of S 6.8 . . . . . . . . . . . . . . . . . . . . .

42 44

7.1 7.2

Output graph of S 7.7 . . . . . . . . . . . . . . . . . . . . . Output graph of S 7.9 . . . . . . . . . . . . . . . . . . . . .

46 49

8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 8.10

Output Output Output Output Output Output Output Output Output Output

. . . . . . . . . .

53 55 56 57 59 60 62 64 65 68

9.1 9.2

Output graph of S 9.1 . . . . . . . . . . . . . . . . . . . . . Output graph of S 9.1 . . . . . . . . . . . . . . . . . . . . .

70 71

graph graph graph graph graph graph graph graph graph graph

of of of of of of of of

of of of of of of of of of of

S S S S S S S S

S S S S S S S S S S

4.1 4.7 4.7 4.8 4.9 4.10 4.11 4.11

8.4 8.6 8.6 8.6 8.7 8.7 8.8 8.11 8.11 8.12

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

7

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . .

. . . . . . . . . .

9.3 9.4 9.5 9.6 9.7 9.8 9.9 9.10

Output Output Output Output Output Output Output Output

graph graph graph graph graph graph graph graph

of of of of of of of of

S S S S S S S S

9.2 9.3 9.3 9.4 9.4 9.4 9.8 9.8

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

73 75 76 80 81 82 84 85

10.1 10.2 10.3 10.4

Output Output Output Output

graph graph graph graph

of of of of

S S S S

10.5 10.5 10.5 10.7

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

88 89 91 93

14.1 Output graph of S 14.3 . . . . . . . . . . . . . . . . . . . . .

104

8

Chapter 1 Mole Balances 1.1

Discussion

When executing the code from the editor, use the ’Execute File into Scilab’tab and not the ’Load in Scilab’tab. The .sci files of the respective problems contain the input parameters of the question

1.2

Scilab Code

Example 1.3 1.3data.sci 1 k = 0.23; // minˆ−1 2 v0 = 10; //dmˆ3/ min

Example 1.3 1.3.sce 1 clc 2 clear all 3 exec ( ” 1 . 3 d a t a . s c i ” ) ; 4 5 //CA = 0 . 1 ∗ CA0 ; 6 V = ( v0 / k ) * log (1/0.1) ; 7 disp ( ”V =” ) 8 disp ( V ) 9 disp ( ”dmˆ3 ” )

9

10

Chapter 2 Conversion and Reactor Sizing 2.1

Discussion

When executing the code from the editor, use the ’Execute File into Scilab’tab and not the ’Load in Scilab’tab. The .sci files of the respective problems contain the input parameters of the question

2.2

Scilab Code

Example 2.1 2.1data.sci 1 2 3 4 5

P0 = 10; // atm yA0 = 0.5; T0 = 422.2; //K R = 0.082; // dm ˆ 3 . atm / mol . K v0 = 6; //dmˆ3/ s Example 2.1 2.1.sce

1 clc 2 clear all 3 exec ( ” 2 . 1 d a t a . s c i ” ) ; 4 CA0 =( yA0 * P0 ) /( R * T0 ) ; 5 FA0 = CA0 * v0 ; 6 disp ( ”CA0 =” )

11

7 8 9 10 11

disp ( CA0 ) disp ( ” mol /dmˆ3 ” ) disp ( ”FA0 =” ) disp ( FA0 ) disp ( ” mol / s ” ) Example 2.2 2.2data.sci

1 2 3 4 5 6 7

P0 = 10; // atm yA0 = 0.5; T0 = 422.2; //K R = 0.082; // dm ˆ 3 . atm / mol . K v0 = 6; //dmˆ3/ s X = 0.8; rA = -1/800; // 1/−rA = 8 0 0 / /dm ˆ 3 . s / mol Example 2.2 2.2.sce

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

clc clear all exec ( ” 2 . 2 d a t a . s c i ” ) ; CA0 =( yA0 * P0 ) /( R * T0 ) ; FA0 = CA0 * v0 ; V = FA0 * X *(1/ - rA ) disp ( ”FA0 =” ) disp ( FA0 ) disp ( ” mol / s ” ) disp ( ”V =” ) disp ( V ) disp ( ”dmˆ3 ” ) Example 2.3 2.3data.sci

1 P0 = 10; // atm 2 yA0 = 0.5; 3 T0 = 422.2; //K

12

4 5 6 7

R = 0.082; // dm ˆ 3 . atm / mol . K v0 = 6; //dmˆ3/ s X = [0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8] ’; p = [189 192 200 222 250 303 400 556 800]; // 1/−rA = 8 0 0 / /dm ˆ 3 . s / m o l s Example 2.3 2.3.sce

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

clc clear all exec ( ” 2 . 3 d a t a . s c i ” ) ; CA0 =( yA0 * P0 ) /( R * T0 ) ; FA0 = CA0 * v0 ; //V = FA0∗X∗(1/ − rA ) V = FA0 * inttrap (X , p ) disp ( ”FA0 =” ) disp ( FA0 ) disp ( ” mol / s ” ) disp ( ”V =” ) disp ( V ) disp ( ”dmˆ3 ” ) disp ( ” Answer i s s l i g h t l y d i f f e r e n n t from t h e book b e c a u s e i n t t r a p command o f SCILAB u s e s t r a p e z o i d a l i n t e g r a t i o n , w h i l e i n book i t h a s been c a l c u l a t e d u s i n g f i v e p o i n t f o r m u l a e . ”) Example 2.4 2.4data.sci

1 FA0 = 5; // mol / s 2 rAat = -(1/400) ; 3 4 X = [0 0.1 0.2 0.3 0.4 0.5 0.6] ’; 5 p = [189 192 200 222 250 303 400]; // 1/−rA = 8 0 0 / /dm

ˆ 3 . s / mols Example 2.4 2.4.sce 13

1 clc 2 clear all 3 exec ( ” 2 . 4 d a t a . s c i ” ) ; 4 5 6 VCSTR = FA0 * X (7) *(1/ - rAat ) ; 7 VPFR = FA0 * inttrap (X , p ) 8 disp ( ”VCSTR =” ) 9 disp ( VCSTR ) 10 disp ( ”dmˆ3 ” ) 11 disp ( ”VPFR =” ) 12 disp ( VPFR ) 13 disp ( ”dmˆ3 ” )

Example 2.5 2.5data.sci 1 2 3 4 5 6

FA0 = 0.867; // mol / s rA = -(1/250) ; rA2 = -(1/800) ; X = 0.8; X1 = 0.4; X2 = 0.8 Example 2.5 2.5.sce

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

clc clear all exec ( ” 2 . 5 d a t a . s c i ” ) ;

V1 = FA0 * X1 *(1/ - rA ) ; V2 = FA0 *( X2 - X1 ) *(1/ - rA2 ) ; V = FA0 * X *(1/ - rA2 ) ; disp ( ”V1 =” ) disp ( V1 ) disp ( ”dmˆ3 ” ) disp ( ”V2 =” ) disp ( V2 ) 14


Similar Free PDFs