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 | * Author: Rafael de Pelegrini Soares |
---|
17 | * $Id: sample_methanol.mso 182 2007-03-06 00:02:04Z rafael $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | FLOWRATE as Real(Default=500, Lower=0, Upper=100000);#,Unit="kmol/h"); |
---|
21 | EXTENT as Real(Default=500, Lower=-1000000, Upper=1000000); |
---|
22 | MOLEFRACTION as Real(Default=0.2, Lower=0, Upper=1); |
---|
23 | PRESSURE as Real(Default=10, Lower=0, Upper=1000); #,Unit="bar"); |
---|
24 | |
---|
25 | Model MESEPARATOR |
---|
26 | PARAMETERS |
---|
27 | outer NoComp; |
---|
28 | VARIABLES |
---|
29 | in FLOWIN(NoComp) as FLOWRATE; |
---|
30 | out FLOWOUT1(NoComp) as FLOWRATE; |
---|
31 | out FLOWOUT2(NoComp) as FLOWRATE; |
---|
32 | TOTAL1 as FLOWRATE; |
---|
33 | TOTAL2 as FLOWRATE; |
---|
34 | X3 as MOLEFRACTION; X4 as MOLEFRACTION; |
---|
35 | Y3 as MOLEFRACTION; Y4 as MOLEFRACTION; |
---|
36 | EQUATIONS |
---|
37 | "Balanco Global" |
---|
38 | FLOWOUT1 + FLOWOUT2 = FLOWIN; |
---|
39 | "Total flows" |
---|
40 | TOTAL1 = sum (FLOWOUT1); |
---|
41 | TOTAL2 = sum (FLOWOUT2); |
---|
42 | "Fracoes molares" |
---|
43 | X3 * TOTAL1 = FLOWOUT1(3); |
---|
44 | X4 * TOTAL1 = FLOWOUT1(4); |
---|
45 | Y3 * TOTAL2 = FLOWOUT2(3); |
---|
46 | Y4 * TOTAL2 = FLOWOUT2(4); |
---|
47 | "Equilibrium fraction" |
---|
48 | Y3 = 3.8E-3 * X3; |
---|
49 | Y4 = 8.0E-4 * X4; |
---|
50 | |
---|
51 | FLOWOUT1([1,2,5,6,7]) = 0; |
---|
52 | end |
---|
53 | |
---|
54 | Model FEEDERMB # Feed stream definition (material balance only) |
---|
55 | PARAMETERS |
---|
56 | outer NoComp; |
---|
57 | VARIABLES |
---|
58 | out FLOWOUT(NoComp) as FLOWRATE; |
---|
59 | X(NoComp) as MOLEFRACTION; |
---|
60 | TOTAL as FLOWRATE; |
---|
61 | EQUATIONS |
---|
62 | # Total feed flow |
---|
63 | TOTAL = sum (FLOWOUT); |
---|
64 | # Material fractions of feed stream |
---|
65 | X * TOTAL = FLOWOUT; |
---|
66 | end |
---|
67 | |
---|
68 | Model MEREACTOR |
---|
69 | PARAMETERS |
---|
70 | outer NoComp; |
---|
71 | Temp as Real(Default=500, Lower=300); |
---|
72 | Pressure as Real(Default=100); |
---|
73 | VARIABLES |
---|
74 | in FLOWIN(NoComp) as FLOWRATE; |
---|
75 | out FLOWOUT(NoComp) as FLOWRATE; |
---|
76 | TOTAL as FLOWRATE; |
---|
77 | EXTENT1 as EXTENT; |
---|
78 | EXTENT2 as EXTENT; |
---|
79 | X(NoComp) as MOLEFRACTION; |
---|
80 | KJ1 as Real(Default=0.6); |
---|
81 | KJ2 as Real(Default=1); |
---|
82 | KX1; KX2; KP10; |
---|
83 | KP20; |
---|
84 | EQUATIONS |
---|
85 | # Definition of equilibrium constants |
---|
86 | KJ1 = 0.6 + 1.5E-3 * (Temp - 473); |
---|
87 | KP10 = 10.0^(9.218 + 3971/Temp - 7.492 * log(Temp) |
---|
88 | + 1.77E-3 * Temp - 3.11E-8 * Temp^2); |
---|
89 | KX1 = KP10/KJ1 * Pressure^2; |
---|
90 | KJ2 = 0.89 + 4.0E-4 * (Temp-463); |
---|
91 | KP20 = 10.0^(1.664 - 1850/(Temp+10)); |
---|
92 | KX2 = KP20/KJ2; |
---|
93 | # Outlet flows from extent and stoichiometry |
---|
94 | FLOWOUT(1) = FLOWIN(1) - EXTENT1 + EXTENT2; |
---|
95 | FLOWOUT(2) = FLOWIN(2) - 2 * EXTENT1 - EXTENT2; |
---|
96 | FLOWOUT(3) = FLOWIN(3) + EXTENT1; |
---|
97 | FLOWOUT(4) = FLOWIN(4) + EXTENT2; |
---|
98 | FLOWOUT(5) = FLOWIN(5) - EXTENT2; |
---|
99 | FLOWOUT(6) = FLOWIN(6); |
---|
100 | FLOWOUT(7) = FLOWIN(7); |
---|
101 | # Total outlet flow |
---|
102 | TOTAL = sum (FLOWOUT); |
---|
103 | # Mole fractions |
---|
104 | TOTAL * X = FLOWOUT; |
---|
105 | # Reaction equilibria |
---|
106 | X(3) = X(1) * X(2)^2 * KX1; |
---|
107 | X(1) * X(4) = X(5) * X(2) * KX2; |
---|
108 | end |
---|
109 | |
---|
110 | Model SPLITMB # TWO Stream SPLITTER (MATERIAL BALANCE ONLY) |
---|
111 | PARAMETERS |
---|
112 | outer NoComp; |
---|
113 | VARIABLES |
---|
114 | out FLOWOUT2(NoComp) as FLOWRATE; |
---|
115 | in FLOWIN(NoComp) as FLOWRATE; |
---|
116 | out FLOWOUT1(NoComp) as FLOWRATE; |
---|
117 | TOTAL1 as FLOWRATE; |
---|
118 | TOTAL2 as FLOWRATE; |
---|
119 | X1(NoComp) as MOLEFRACTION; |
---|
120 | X2(NoComp) as MOLEFRACTION; |
---|
121 | FRACTION as MOLEFRACTION; |
---|
122 | EQUATIONS |
---|
123 | # Stream split |
---|
124 | FLOWOUT1 = FLOWIN * FRACTION; |
---|
125 | # Component material balance |
---|
126 | FLOWIN = FLOWOUT1 + FLOWOUT2; |
---|
127 | # Total flows of output streams |
---|
128 | TOTAL1 = sum (FLOWOUT1); |
---|
129 | TOTAL2 = sum (FLOWOUT2); |
---|
130 | # Material fractions of output streams |
---|
131 | X1 * TOTAL1 = FLOWOUT1; |
---|
132 | X2 * TOTAL2 = FLOWOUT2; |
---|
133 | end |
---|
134 | |
---|
135 | Model MAKEUPMB # MIXER of TWO StreamS (MATERIAL BALANCE ONLY) |
---|
136 | PARAMETERS |
---|
137 | outer NoComp; |
---|
138 | VARIABLES |
---|
139 | out FLOWOUT(NoComp) as FLOWRATE; |
---|
140 | in FLOWIN1(NoComp) as FLOWRATE; |
---|
141 | in FLOWIN2(NoComp) as FLOWRATE; |
---|
142 | TOTAL as FLOWRATE; |
---|
143 | TOTALMAKE as FLOWRATE; |
---|
144 | TOTALR as FLOWRATE; |
---|
145 | X(NoComp) as MOLEFRACTION; |
---|
146 | RATIO as Real(Default=1e-3); |
---|
147 | EQUATIONS |
---|
148 | # Component material balances |
---|
149 | FLOWIN1 + FLOWIN2 = FLOWOUT; |
---|
150 | # Total flow of output stream |
---|
151 | TOTAL = sum (FLOWOUT); |
---|
152 | # Material fractions of output stream |
---|
153 | X * TOTAL = FLOWOUT; |
---|
154 | # Specification of recycle ratio |
---|
155 | TOTALMAKE = sum (FLOWIN1); |
---|
156 | TOTALR = sum (FLOWIN2); |
---|
157 | TOTALR = RATIO * TOTALMAKE; |
---|
158 | end |
---|
159 | |
---|
160 | FlowSheet MethanolProcess |
---|
161 | PARAMETERS |
---|
162 | NoComp as Integer(Brief="Number of Components"); |
---|
163 | DEVICES |
---|
164 | Mixer as MAKEUPMB; |
---|
165 | Feeder as FEEDERMB; |
---|
166 | Reactor as MEREACTOR; |
---|
167 | Purge as SPLITMB; |
---|
168 | Separator as MESEPARATOR; |
---|
169 | CONNECTIONS |
---|
170 | Feeder.FLOWOUT to Mixer.FLOWIN1; |
---|
171 | Mixer.FLOWOUT to Reactor.FLOWIN; |
---|
172 | Reactor.FLOWOUT to Separator.FLOWIN; |
---|
173 | Separator.FLOWOUT2 to Purge.FLOWIN; |
---|
174 | Purge.FLOWOUT2 to Mixer.FLOWIN2; |
---|
175 | SPECIFY |
---|
176 | Feeder.TOTAL = 6000; |
---|
177 | Feeder.X(2:NoComp) = [0.146, 0.720, 0, 0.001, 0.06, 0.032]; |
---|
178 | Purge.FRACTION = 0.08776; |
---|
179 | SET |
---|
180 | NoComp = 7; |
---|
181 | Reactor.Temp = 533.15; |
---|
182 | Reactor.Pressure = 120; |
---|
183 | OPTIONS |
---|
184 | Dynamic = false; |
---|
185 | end |
---|
186 | |
---|