source: trunk/sample/reactors/fogler/chap3/equilibrium_conversion.mso @ 961

Last change on this file since 961 was 574, checked in by Rafael de Pelegrini Soares, 15 years ago

Updated the models to work with some language constraints

  • Property svn:keywords set to Id
File size: 4.9 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* Equilibrium conversion
17*----------------------------------------------------------------------
18* Solved problem from Fogler (1999)
19* Problem number: 3-8a and 3-8b
20* Page: 91 (Brazilian edition, 2002)
21*----------------------------------------------------------------------
22*
23*   Description:
24*       Sample to calculate the equilibrium conversion for batch and
25*       continuous systems. Be considered the following reaction of
26*       decomposition:
27*               N2O4 <-> 2NO2
28*
29*   Assumptions:
30*       * steady-state
31*       * isotermic and isobaric system
32*       * gaseous phase
33*
34*       Specify:
35*               * the inlet stream (z,P,T)
36*               * the equilibrium constant
37*
38*   Flowsheets:
39*       * a batch system
40*       * a continuous system
41*
42*----------------------------------------------------------------------
43* Author: Christiano D. W. Guerra and Rodolfo Rodrigues
44* $Id: equilibrium_conversion.mso 574 2008-07-25 14:18:50Z rafael $
45*--------------------------------------------------------------------*#
46
47using "types";
48
49
50#*---------------------------------------------------------------------
51* Model of a stream
52*--------------------------------------------------------------------*#
53
54Model stream
55        PARAMETERS
56outer NComp     as Integer (Brief="Number of chemical components", Lower=1);
57       
58        VARIABLES
59        C(NComp)as conc_mol(Brief="Concentration", DisplayUnit='kmol/l', Lower=0);
60        z(NComp)as fraction(Brief="Molar fraction");
61end
62
63
64#*---------------------------------------------------------------------
65* Example 3-8a: In a batch system
66*--------------------------------------------------------------------*#
67
68FlowSheet batch
69        PARAMETERS
70        NComp   as Integer      (Brief="Number of chemical components", Lower=1);
71        R               as Real         (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082);
72        stoic(NComp) as Real(Brief="Stoichiometric coefficients");
73       
74        VARIABLES
75        Inlet   as stream; # Inlet stream
76        Outlet  as stream; # Outlet stream
77        X               as fraction     (Brief="Molar conversion");
78        Kc      as Real         (Brief="Equilibrium constant", Unit='mol/l');
79        C               as conc_mol     (Brief="Total outlet concentration", DisplayUnit='mol/l', Lower=0);
80        Co              as conc_mol     (Brief="Total inlet concentration", DisplayUnit='mol/l', Lower=0);
81        T               as temperature (Brief="Temperature");
82        P               as pressure     (Brief="Pressure");
83        Theta(NComp) as Real(Brief="Parameter Theta");
84       
85        EQUATIONS
86        "Inlet molar fraction"
87        Inlet.C = Inlet.z*Co;
88       
89        "Total inlet concentration"
90        Co = P/(R*T);
91       
92        "Outlet molar fraction"
93        Outlet.C = Outlet.z*sum(Outlet.C);
94       
95        "Total outlet concentration"
96        C = sum(Outlet.C);
97       
98        "Outlet concentration"
99        Outlet.C = Inlet.C(1)*(Theta + stoic*X);
100       
101        "Parameter Theta"
102        Theta = Inlet.z/Inlet.z(1);
103       
104        "Equilibrium constant"
105        Kc = Outlet.C(2)^2/Outlet.C(1);
106       
107        SET
108        NComp = 2; # A and B
109        stoic = [-1.0, 2.0]; # A <-> 2B
110       
111        SPECIFY
112        Inlet.z = [1.0, 0.0];
113        P = 2.0*'atm';
114        T = 340*'K';
115       
116        Kc = 0.1*'mol/l';
117       
118        OPTIONS
119        Dynamic = false;
120end
121
122
123#*---------------------------------------------------------------------
124* Example 3-8b: In a continuous system
125*--------------------------------------------------------------------*#
126
127FlowSheet continuous
128        PARAMETERS
129        NComp   as Integer      (Brief="Number of chemical components", Lower=1);
130        R               as Real         (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082);
131        stoic(NComp) as Real(Brief="Stoichiometric coefficients");
132       
133        VARIABLES
134        Inlet   as stream; # Inlet stream
135        Outlet  as stream; # Outlet stream
136        X               as fraction     (Brief="Molar conversion");
137        Kc      as Real         (Brief="Equilibrium constant", Unit='mol/l');
138        C               as conc_mol     (Brief="Total outlet concentration", DisplayUnit='mol/l', Lower=0);
139        Co              as conc_mol     (Brief="Total inlet concentration", DisplayUnit='mol/l', Lower=0);
140        T               as temperature (Brief="Temperatura");
141        P               as pressure     (Brief="Pressure");
142        Theta(NComp) as Real(Brief="Parameter Theta");
143        epsilon as Real         (Brief="Parameter epsilon");
144       
145        EQUATIONS
146        "Inlet molar fraction"
147        Inlet.C = Inlet.z*Co;
148       
149        "Total inlet concentration"
150        Co = P/(R*T);
151       
152        "Outlet molar fraction"
153        Outlet.C = Outlet.z*sum(Outlet.C);
154       
155        "Total outlet concentration"
156        C = sum(Outlet.C);
157       
158        "Outlet concentration"
159        Outlet.C = Inlet.C(1)*(Theta + stoic*X)/(1 + epsilon*X);
160       
161        "Parameter Theta"
162        Theta = Inlet.z/Inlet.z(1);
163       
164        "Parameter epsilon"
165        epsilon = Inlet.z(1)*sum(stoic);
166       
167        "Equilibrium constant"
168        Kc = Outlet.C(2)^2/Outlet.C(1);
169       
170        SET
171        NComp = 2; # A and B
172        stoic = [-1.0, 2.0]; # A <-> 2B
173       
174        SPECIFY
175        Inlet.z = [1.0, 0.0];
176
177        P = 2.0*'atm';
178        T = 340*'K';
179       
180        Kc = 0.1*'mol/l';
181       
182        OPTIONS
183        Dynamic = false;
184end
Note: See TracBrowser for help on using the repository browser.