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 | * Sample file for reaction column model |
---|
17 | *-------------------------------------------------------------------- |
---|
18 | * |
---|
19 | * This sample file needs VRTherm (www.vrtech.com.br) to run. |
---|
20 | * |
---|
21 | *---------------------------------------------------------------------- |
---|
22 | * Author: Paula B. Staudt |
---|
23 | * $Id: sample_columnReact.mso 574 2008-07-25 14:18:50Z rafael $ |
---|
24 | *--------------------------------------------------------------------*# |
---|
25 | using "controllers/PIDs"; |
---|
26 | using "stage_separators/column"; |
---|
27 | |
---|
28 | FlowSheet Startup_ReactiveDistillation |
---|
29 | PARAMETERS |
---|
30 | PP as Plugin(Brief="Physical Properties", Type="PP", |
---|
31 | Components = [ "acetic acid", "ethanol", "ethyl acetate", "water"], |
---|
32 | LiquidModel = "UNIFAC", |
---|
33 | VapourModel = "Ideal" |
---|
34 | ); |
---|
35 | NComp as Integer; |
---|
36 | |
---|
37 | SET |
---|
38 | NComp = PP.NumberOfComponents; |
---|
39 | |
---|
40 | DEVICES |
---|
41 | col as ReactiveDistillation; |
---|
42 | feed as source; |
---|
43 | zero as stream; |
---|
44 | PIDLreb as PID; |
---|
45 | PIDLcond as PID; |
---|
46 | PIDTreb as PID; |
---|
47 | PIDTcond as PID; |
---|
48 | |
---|
49 | VARIABLES |
---|
50 | Qc as energy_source(Brief="Condenser Heat supplied"); |
---|
51 | Qr as energy_source(Brief="Reboiler Heat supplied"); |
---|
52 | Qcmin as heat_rate (Brief="Condenser Heat supplied"); |
---|
53 | Qcmax as heat_rate (Brief="Condenser Heat supplied"); |
---|
54 | Qrmin as heat_rate (Brief="Reboiler Heat supplied"); |
---|
55 | Qrmax as heat_rate (Brief="Reboiler Heat supplied"); |
---|
56 | Fmin as flow_mol; |
---|
57 | Fmax as flow_mol; |
---|
58 | Frmin as flow_mol; |
---|
59 | Frmax as flow_mol; |
---|
60 | |
---|
61 | Lreb_ad as Real; |
---|
62 | Lrebmin as length; |
---|
63 | Lrebmax as length; |
---|
64 | Lcond_ad as Real; |
---|
65 | Lcondmin as length; |
---|
66 | Lcondmax as length; |
---|
67 | Treb_ad as Real; |
---|
68 | Trebmin as temperature; |
---|
69 | Trebmax as temperature; |
---|
70 | Tcond_ad as Real; |
---|
71 | Tcondmin as temperature; |
---|
72 | Tcondmax as temperature; |
---|
73 | |
---|
74 | CONNECTIONS |
---|
75 | feed.Outlet to col.trays(5).Inlet; |
---|
76 | zero to col.reb.Inlet; |
---|
77 | zero to col.trays([1:4]).Inlet; |
---|
78 | zero to col.trays([6:col.NTrays]).Inlet; |
---|
79 | Qc.OutletQ to col.cond.InletQ; |
---|
80 | Qr.OutletQ to col.reb.InletQ; |
---|
81 | |
---|
82 | EQUATIONS |
---|
83 | col.sp.frac = 0.09; |
---|
84 | |
---|
85 | #verificando a partida do refervedor |
---|
86 | if time < 400 * 's' then |
---|
87 | col.reb.startup = 1; |
---|
88 | else |
---|
89 | col.reb.startup = 0; |
---|
90 | end |
---|
91 | |
---|
92 | if col.reb.startup then |
---|
93 | Qc.OutletQ = 0 * PIDTcond.Ports.output * 'kJ/s'; |
---|
94 | Qr.OutletQ = 0 * PIDTreb.Ports.output * 'kJ/s'; |
---|
95 | |
---|
96 | PIDTreb.Ports.input = PIDTreb.Ports.setPoint; |
---|
97 | else |
---|
98 | Qc.OutletQ = Qcmin+(Qcmax-Qcmin)*PIDTcond.Ports.output; |
---|
99 | Qr.OutletQ = Qrmin+(Qrmax-Qrmin)*PIDTreb.Ports.output; |
---|
100 | |
---|
101 | PIDTreb.Ports.input=Treb_ad; |
---|
102 | end |
---|
103 | |
---|
104 | SET |
---|
105 | PIDLreb.tau = 1*'s'; |
---|
106 | PIDLreb.tauSet=1*'s'; |
---|
107 | PIDLreb.bias = 0; |
---|
108 | PIDLreb.alpha=1; |
---|
109 | PIDLreb.gamma=1; |
---|
110 | PIDLreb.beta=1; |
---|
111 | PIDLreb.gain=0.9; |
---|
112 | PIDLreb.intTime=20*'s'; |
---|
113 | PIDLreb.derivTime=0*'s'; |
---|
114 | PIDLreb.Action = "Direct"; |
---|
115 | PIDLreb.Clip = "Clipped"; |
---|
116 | PIDLreb.Mode = "Automatic"; |
---|
117 | |
---|
118 | |
---|
119 | PIDLcond.tau = 1*'s'; |
---|
120 | PIDLcond.tauSet=1*'s'; |
---|
121 | PIDLcond.bias = 0.5; |
---|
122 | PIDLcond.alpha=1; |
---|
123 | PIDLcond.gamma=1; |
---|
124 | PIDLcond.beta=1; |
---|
125 | PIDLcond.gain=1; |
---|
126 | PIDLcond.intTime=10*'s'; |
---|
127 | PIDLcond.derivTime=1*'s'; |
---|
128 | PIDLcond.Action = "Direct"; |
---|
129 | PIDLcond.Clip = "Clipped"; |
---|
130 | PIDLcond.Mode = "Automatic"; |
---|
131 | |
---|
132 | PIDTreb.tau = 1*'s'; |
---|
133 | PIDTreb.tauSet=1*'s'; |
---|
134 | PIDTreb.bias = 0.2; |
---|
135 | PIDTreb.alpha=0.2; |
---|
136 | PIDTreb.gamma=1; |
---|
137 | PIDTreb.beta=1; |
---|
138 | PIDTreb.gain=0.9; |
---|
139 | PIDTreb.intTime=100*'s'; |
---|
140 | PIDTreb.derivTime=1*'s'; |
---|
141 | PIDTreb.Action = "Direct"; |
---|
142 | PIDTreb.Clip = "Clipped"; |
---|
143 | PIDTreb.Mode = "Automatic"; |
---|
144 | |
---|
145 | PIDTcond.tau = 1*'s'; |
---|
146 | PIDTcond.tauSet=1*'s'; |
---|
147 | PIDTcond.bias = 0.5; |
---|
148 | PIDTcond.alpha=0.2; |
---|
149 | PIDTcond.gamma=1; |
---|
150 | PIDTcond.beta=1; |
---|
151 | PIDTcond.gain=0.9; |
---|
152 | PIDTcond.intTime=100*'s'; |
---|
153 | PIDTcond.derivTime=1*'s'; |
---|
154 | PIDTcond.Action = "Reverse"; |
---|
155 | PIDTcond.Clip = "Clipped"; |
---|
156 | PIDTcond.Mode = "Automatic"; |
---|
157 | |
---|
158 | |
---|
159 | SPECIFY |
---|
160 | feed.Outlet.F = 1.076 * 'mol/s'; |
---|
161 | feed.Outlet.T = 300 * 'K'; |
---|
162 | feed.Outlet.P = 3.0 * 'atm'; |
---|
163 | feed.Outlet.z = [0.4962, 0.4808, 0, 0.0229]; |
---|
164 | |
---|
165 | zero.F = 0 * 'kmol/h'; |
---|
166 | zero.T = 353 * 'K'; |
---|
167 | zero.P = 1 * 'atm'; |
---|
168 | zero.z = [0.4962, 0.4808, 0, 0.0229]; |
---|
169 | zero.v = 0; |
---|
170 | zero.h = 0 * 'J/mol'; |
---|
171 | |
---|
172 | col.p.dP = 2 * 'atm' - col.sp.Outlet2.P; |
---|
173 | col.trays.Emv = 1; |
---|
174 | |
---|
175 | EQUATIONS |
---|
176 | |
---|
177 | # Variáveis dos PID's especificadas |
---|
178 | PIDLreb.Ports.setPoint=(0.5 * 'm' - Lrebmin)/(Lrebmax-Lrebmin); |
---|
179 | Lreb_ad*(Lrebmax-Lrebmin)=col.reb.Level-Lrebmin; |
---|
180 | PIDLreb.Ports.input=Lreb_ad; |
---|
181 | col.reb.OutletL.F = Frmin + (Frmax-Frmin) * PIDLreb.Ports.output; |
---|
182 | |
---|
183 | PIDLcond.Ports.setPoint=(0.5 * 'm' - Lcondmin)/(Lcondmax-Lcondmin); |
---|
184 | Lcond_ad*(Lcondmax-Lcondmin)=col.cond.Level-Lcondmin; |
---|
185 | PIDLcond.Ports.input=Lcond_ad; |
---|
186 | col.sp.Outlet1.F = Fmin + (Fmax-Fmin) * PIDLcond.Ports.output; |
---|
187 | |
---|
188 | PIDTreb.Ports.setPoint= (366 * 'K' - Trebmin)/(Trebmax-Trebmin); |
---|
189 | Treb_ad*(Trebmax-Trebmin)=col.reb.OutletL.T-Trebmin; |
---|
190 | |
---|
191 | PIDTcond.Ports.setPoint= (346 * 'K' - Tcondmin)/(Tcondmax-Tcondmin); |
---|
192 | Tcond_ad*(Tcondmax-Tcondmin)=col.cond.OutletL.T-Tcondmin; |
---|
193 | PIDTcond.Ports.input=Tcond_ad; |
---|
194 | |
---|
195 | "Valores limites para normalizações" |
---|
196 | Lrebmax=0.8*'m'; |
---|
197 | Lrebmin=0.1*'m'; |
---|
198 | Lcondmax=0.8*'m'; |
---|
199 | Lcondmin=0.1*'m'; |
---|
200 | Trebmax=400*'K'; |
---|
201 | Trebmin=200*'K'; |
---|
202 | Tcondmax=380*'K'; |
---|
203 | Tcondmin=250*'K'; |
---|
204 | Qcmin = -100 * 'kJ/s'; |
---|
205 | Qcmax = 0 * 'kJ/s'; |
---|
206 | Qrmin = 0 * 'kJ/s'; |
---|
207 | Qrmax = 150 * 'kJ/s'; |
---|
208 | Fmin = 0 * 'kmol/h'; |
---|
209 | Fmax = 2 * 'kmol/h'; |
---|
210 | Frmin = 0 * 'kmol/h'; |
---|
211 | Frmax = 5 * 'kmol/h'; |
---|
212 | |
---|
213 | col.cond.OutletV.F = 0 * 'kmol/h'; |
---|
214 | |
---|
215 | SET |
---|
216 | PIDLreb.PID_Select = "Ideal_AW"; |
---|
217 | PIDLcond.PID_Select = "Ideal_AW"; |
---|
218 | PIDTreb.PID_Select = "Ideal_AW"; |
---|
219 | PIDTcond.PID_Select = "Ideal_AW"; |
---|
220 | |
---|
221 | col.NTrays = 11; |
---|
222 | |
---|
223 | col.trays.stoic = [-1, -1, 1, 1]; |
---|
224 | col.cond.stoic = [-1, -1, 1, 1]; |
---|
225 | col.reb.stoic = [-1, -1, 1, 1]; |
---|
226 | col.cond.V = 6 * 'l'; |
---|
227 | col.cond.Across = 6 * 'l/m'; |
---|
228 | |
---|
229 | col.trays.V = 0.0961 * 'm^3'; |
---|
230 | col.trays.Ah = 0.04 * 'm^2'; |
---|
231 | col.trays.lw = 0.457 * 'm'; |
---|
232 | col.trays.hw = 0.05 * 'm'; |
---|
233 | col.trays.Q = 0 * 'kW'; |
---|
234 | col.trays.beta = 0.8; |
---|
235 | col.trays.alfa = 30; |
---|
236 | col.alfacond = 100000; |
---|
237 | col.trays.Ap = 0.07 * 'm^2'; |
---|
238 | |
---|
239 | col.trays.Hr = 0 * 'kJ/mol'; |
---|
240 | col.cond.Hr = 0 * 'kJ/mol'; |
---|
241 | col.reb.Hr = 0 * 'kJ/mol'; |
---|
242 | col.reb.V = 20 * 'l'; |
---|
243 | col.reb.Across = 20 * 'l/m'; |
---|
244 | |
---|
245 | col.reb.Pstartup = 1 * 'atm'; |
---|
246 | col.trays.Pstartup = 1 * 'atm'; |
---|
247 | col.cond.Pstartup = 1 * 'atm'; |
---|
248 | |
---|
249 | INITIAL |
---|
250 | # condenser |
---|
251 | col.cond.OutletL.T = 300 *'K'; |
---|
252 | col.cond.Level = 0.4 * 'm'; |
---|
253 | col.cond.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
254 | |
---|
255 | # reboiler |
---|
256 | col.reb.OutletL.T = 300 * 'K'; |
---|
257 | col.reb.Level = 0.4 * 'm'; |
---|
258 | col.reb.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
259 | |
---|
260 | # column trays |
---|
261 | col.trays.OutletL.T = 300 * 'K'; |
---|
262 | col.trays.Level = 0.1 * col.trays.hw; |
---|
263 | col.trays.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
264 | |
---|
265 | OPTIONS |
---|
266 | TimeStep = 100; |
---|
267 | TimeEnd = 50000; |
---|
268 | end |
---|