source: branches/gui/sample/miscellaneous/tenprobs/prob09.mso @ 697

Last change on this file since 697 was 229, checked in by Rodolfo Rodrigues, 16 years ago

Fixed incompatible units

File size: 4.6 KB
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*       Concepts utilized:
28*               Design of a gas phase catalytic reactor with pressure drop for
29*       a first order reversible gas phase reaction.
30*
31*       Numerical method:
32*               * Simultaneous ODEs with known boundary conditions
33*
34*   Reference:
35*               * CUTLIP et al. A collection of 10 numerical problems in
36*       chemical engineering solved by various mathematical software
37*       packages. Comp. Appl. in Eng. Education. v. 6, 169-180, 1998.
38*       * More informations and a detailed description of all problems
39*       is available online in http://www.polymath-software.com/ASEE
40*
41*----------------------------------------------------------------------
42* Author: Rodolfo Rodrigues
43* GIMSCOP/UFRGS - Group of Integration, Modeling, Simulation,
44*                                       Control, and Optimization of Processes
45* $Id$
46*--------------------------------------------------------------------*#
47using "types";
48
49
50
51Model stream
52        PARAMETERS
53outer NComp     as Integer              (Brief="Number of components", Lower=1);
54        cp(NComp)       as cp_mol;
55       
56        SET
57        cp = [40, 80]*'J/mol/K';
58       
59        VARIABLES
60        C(NComp)        as conc_mol             (Brief="Molar concentration", Lower=0, DisplayUnit='mol/l');
61        T                       as temperature;
62        P                       as pressure;
63end
64
65
66
67FlowSheet reactor
68        PARAMETERS
69        NComp           as Integer              (Brief="Number of components", Lower=1);
70        NReac           as Integer              (Brief="Number of reactions");
71       
72        Tref            as temperature  (Brief="Reference temperature", Default=450);
73        Ta                      as temperature;
74       
75        ko(NReac)       as Real                 (Brief="Frequency factor at Treff", Unit='l^2/kg/min/mol');
76        Ko(NReac)       as Real                 (Unit='l/mol');
77        E(NReac)        as energy_mol   (Brief="Activation energy");
78        R                       as Real                 (Brief="Universal gas constant", Unit='J/mol/K', Default=8.314);
79       
80        DH(NReac)       as enth_mol;
81        U                       as Real                 (Unit='J/kg/K/min');
82        alpha           as Real                 (Unit='1/kg');
83       
84       
85        VARIABLES
86        Inlet           as stream;
87        Outlet          as stream;
88       
89        Fo(NComp)       as flow_mol             (Brief="Inlet molar flow");
90        X                       as fraction             (Brief="Molar conversion of A");
91        y                       as fraction             (Brief="Normalized pressure");
92        Tn                      as Real                 (Brief="Temperature by 1000", Lower=0.273);
93       
94       
95        r(NReac)        as Real                 (Brief="Mass rate of reaction", Unit='mol/kg/min');
96        k(NReac)        as Real                 (Brief="Specific rate of reaction", Unit='l^2/kg/min/mol');
97        K(NReac)        as Real                 (Brief="Equilibrium constant", Unit='l/mol');
98       
99        W                       as mass                 (Brief="Catalytic weight");
100       
101       
102        EQUATIONS
103        "Change time in W"
104        W = time*'kg/s';
105       
106        "Mole balance"
107        diff(X) = -r(1)/Fo(1)*'kg/s';
108       
109        "Rate of reaction"
110        -r = k*(Outlet.C(1)^2 - Outlet.C(2)/K);
111       
112       
113        "Specific rate of reaction"
114        k = ko*exp(E/R*(1/Tref - 1/Outlet.T));
115       
116        "Equilibrium constant"
117        K = Ko*exp(DH/R*(1/Tref - 1/Outlet.T));
118       
119       
120        "Molar concentration of A"
121        Outlet.C(1) = Inlet.C(1)*(1 - X)/(1 - 0.5*X)*y*(Inlet.T/Outlet.T);
122       
123        "Molar concentration of C"
124        Outlet.C(2) = 0.5*Inlet.C(1)*X/(1 - 0.5*X)*y*(Inlet.T/Outlet.T);
125       
126       
127        "Pressure drop"
128        diff(y) = -alpha*(1 - 0.5*X)/2/y*(Outlet.T/Inlet.T)*'kg/s';
129       
130        "Energy balance"
131        diff(Outlet.T) = (U*(Ta - Outlet.T) + r*DH)/(Fo(1)*Inlet.cp(1))*'kg/s';
132       
133       
134        "Normalized pressure"
135        y = Outlet.P/Inlet.P;
136       
137        "Temperature/1000"
138        Tn = Outlet.T/1e3/'K';
139       
140       
141        SET
142        NComp = 2; # A, and C
143       
144        DH(1) = -4e4*'J/mol';
145        ko(1) = 0.5*'l^2/kg/min/mol'; # at Tref
146        Ko(1) = 2.5e4*'l/mol'; # at Tref
147        E(1)  = 4.18e4*'J/mol';
148       
149        Ta = 500*'K';
150        U = 0.8*'J/kg/K/min';
151        alpha = 0.015/'kg';
152
153       
154        SPECIFY
155        Fo = [5, 0]*'mol/min';
156        Inlet.C = [0.271, 0]*'mol/l';
157        Inlet.T = 450*'K';
158        Inlet.P = 10*'atm';
159
160       
161        INITIAL
162        "Molar conversion"
163        X = 0;
164       
165        "Drop pressure"
166        y = 1;
167       
168        "Temperature"
169        Outlet.T = Inlet.T;
170
171
172        OPTIONS
173        TimeStart = 0;
174        TimeStep = 0.25;
175        TimeEnd = 20;
176       
177        TimeUnit = 's';
178end
Note: See TracBrowser for help on using the repository browser.