Ticket #62: prob09.mso

File prob09.mso, 4.2 KB (added by Rodolfo Rodrigues, 15 years ago)

Problema 09

Line 
1#*---------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*----------------------------------------------------------------------
16* 9. Gas Phase Catalytic Reactor
17*----------------------------------------------------------------------
18*
19*   Description:
20*      This problem is part of a collection of 10 representative
21*       problems in Chemical Engineering for solution by numerical methods
22*       developed for Cutlip (1998).
23*
24*   Subject:
25*       * Reaction Engineering
26*
27*       Numerical method:
28*               * Simultaneous ODE’s with known boundary conditions
29*
30*   Reference:
31*               * CUTLIP et al. A collection of 10 numerical problems in
32*       chemical engineering solved by various mathematical software
33*       packages. Comp. Appl. in Eng. Education. v. 6, 169-180, 1998.
34*       * http://www.polymath-software.com/ASEE
35*
36*----------------------------------------------------------------------
37* Author: Rodolfo Rodrigues
38* $Id$
39*--------------------------------------------------------------------*#
40using "types";
41
42
43
44Model stream
45        PARAMETERS
46outer NComp     as Integer              (Brief="Number of components", Lower=1);
47        cp(NComp)       as cp_mol;
48       
49        SET
50        cp = [40, 80]*'J/mol/K';
51       
52        VARIABLES
53        C(NComp)        as conc_mol             (Brief="Molar concentration", Lower=0, DisplayUnit='mol/l');
54        T                       as temperature;
55        P                       as pressure;
56end
57
58
59
60FlowSheet reactor
61        PARAMETERS
62        NComp           as Integer              (Brief="Number of components", Lower=1);
63        NReac           as Integer              (Brief="Number of reactions");
64       
65        Tref            as temperature  (Brief="Reference temperature", Default=450);
66        Ta                      as temperature;
67       
68        ko(NReac)       as Real                 (Brief="Frequency factor at Treff", Unit='l^2/kg/min/mol');
69        Ko(NReac)       as Real                 (Unit='l/mol');
70        E(NReac)        as energy_mol   (Brief="Activation energy");
71        R                       as Real                 (Brief="Universal gas constant", Unit='J/mol/K', Default=8.314);
72       
73        DH(NReac)       as enth_mol;
74        U                       as Real                 (Unit='J/kg/K/min');
75        alpha           as Real                 (Unit='1/kg');
76       
77       
78        VARIABLES
79        Inlet           as stream;
80        Outlet          as stream;
81       
82        Fo(NComp)       as flow_mol             (Brief="Inlet molar flow");
83        X                       as fraction             (Brief="Molar conversion of A");
84        y                       as fraction             (Brief="Normalized pressure");
85        Tn                      as Real                 (Brief="Temperature by 1000", Lower=0.273);
86       
87       
88        r(NReac)        as Real                 (Brief="Mass rate of reaction", Unit='mol/kg/min');
89        k(NReac)        as Real                 (Brief="Specific rate of reaction", Unit='l^2/kg/min/mol');
90        K(NReac)        as Real                 (Brief="Equilibrium constant", Unit='l/mol');
91       
92        W                       as mass                 (Brief="Catalytic weight");
93       
94       
95        EQUATIONS
96        "Change time in W"
97        W = time*'kg/s';
98       
99        "Mole balance"
100        diff(X) = -r(1)/Fo(1)*'kg/s';
101       
102        "Rate of reaction"
103        -r = k*(Outlet.C(1)^2 - Outlet.C(2)/K);
104       
105       
106        "Specific rate of reaction"
107        k = ko*exp(E/R*(1/Tref - 1/Outlet.T));
108       
109        "Equilibrium constant"
110        K = Ko*exp(DH/R*(1/Tref - 1/Outlet.T));
111       
112       
113        "Molar concentration of A"
114        Outlet.C(1) = Inlet.C(1)*(1 - X)/(1 - 0.5*X)*y*(Inlet.T/Outlet.T);
115       
116        "Molar concentration of C"
117        Outlet.C(2) = 0.5*Inlet.C(1)*X/(1 - 0.5*X)*y*(Inlet.T/Outlet.T);
118       
119       
120        "Pressure drop"
121        diff(y) = -alpha*(1 - 0.5*X)/2/y*(Outlet.T/Inlet.T)*'kg/s';
122       
123        "Energy balance"
124        diff(Outlet.T) = (U*(Ta - Outlet.T) + r*DH)/(Fo(1)*Inlet.cp(1))*'kg/s';
125       
126       
127        "Normalized pressure"
128        y = Outlet.P/Inlet.P;
129       
130        "Temperature/1000"
131        Tn = Outlet.T/1e3*'K';
132       
133       
134        SET
135        NComp = 2; # A, and C
136       
137        DH(1) = -4e4*'J/mol';
138        ko(1) = 0.5*'l^2/kg/min/mol'; # at Tref
139        Ko(1) = 2.5e4*'l/mol'; # at Tref
140        E(1)  = 4.18e4*'J/mol';
141       
142        Ta = 500*'K';
143        U = 0.8*'J/kg/K/min';
144        alpha = 0.015/'kg';
145
146       
147        SPECIFY
148        Fo = [5, 0]*'mol/min';
149        Inlet.C = [0.271, 0]*'mol/l';
150        Inlet.T = 450*'K';
151        Inlet.P = 10*'atm';
152
153       
154        INITIAL
155        "Molar conversion"
156        X = 0;
157       
158        "Drop pressure"
159        y = 1;
160       
161        "Temperature"
162        Outlet.T = Inlet.T;
163
164
165        OPTIONS
166        TimeStart = 0;
167        TimeStep = 0.25;
168        TimeEnd = 20;
169       
170        TimeUnit = 's';
171end