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