1 | using "controllers/PIDs"; |
---|
2 | using "stage_separators/column"; |
---|
3 | |
---|
4 | FlowSheet Startup_ReactiveDistillation |
---|
5 | PARAMETERS |
---|
6 | PP as CalcObject(Brief="Physical Properties",File="vrpp"); |
---|
7 | NComp as Integer; |
---|
8 | |
---|
9 | SET |
---|
10 | PP.Components = [ "acetic acid", "ethanol", "ethyl acetate", "water"]; |
---|
11 | PP.LiquidModel = "UNIFAC"; |
---|
12 | PP.VapourModel = "Ideal"; |
---|
13 | PP.Derivatives = 1; |
---|
14 | NComp = PP.NumberOfComponents; |
---|
15 | |
---|
16 | DEVICES |
---|
17 | col as ReactiveDistillation; |
---|
18 | feed as streamTP; |
---|
19 | zero as stream; |
---|
20 | PIDLreb as PID_Ideal_AW; |
---|
21 | PIDLcond as PID_Ideal_AW; |
---|
22 | PIDTreb as PID_Ideal_AW; |
---|
23 | PIDTcond as PID_Ideal_AW; |
---|
24 | |
---|
25 | VARIABLES |
---|
26 | Lreb_ad as Real; |
---|
27 | Lrebmin as length; |
---|
28 | Lrebmax as length; |
---|
29 | Lcond_ad as Real; |
---|
30 | Lcondmin as length; |
---|
31 | Lcondmax as length; |
---|
32 | Treb_ad as Real; |
---|
33 | Trebmin as temperature; |
---|
34 | Trebmax as temperature; |
---|
35 | Tcond_ad as Real; |
---|
36 | Tcondmin as temperature; |
---|
37 | Tcondmax as temperature; |
---|
38 | |
---|
39 | CONNECTIONS |
---|
40 | feed to col.trays(5).Inlet; |
---|
41 | zero to col.reb.Inlet; |
---|
42 | zero to col.trays([1:4]).Inlet; |
---|
43 | zero to col.trays([6:col.NTrays]).Inlet; |
---|
44 | |
---|
45 | EQUATIONS |
---|
46 | "Equações do PID para controle de nível" |
---|
47 | Lreb_ad*(Lrebmax-Lrebmin)=col.reb.Level-Lrebmin; |
---|
48 | PIDLreb.Ports.input=Lreb_ad; |
---|
49 | Lcond_ad*(Lcondmax-Lcondmin)=col.cond.Level-Lcondmin; |
---|
50 | PIDLcond.Ports.input=Lcond_ad; |
---|
51 | "Equações do PID para controle de temperatura" |
---|
52 | Treb_ad*(Trebmax-Trebmin)=col.reb.OutletL.T-Trebmin; |
---|
53 | PIDTreb.Ports.input=Treb_ad; |
---|
54 | Tcond_ad*(Tcondmax-Tcondmin)=col.cond.OutletL.T-Tcondmin; |
---|
55 | PIDTcond.Ports.input=Tcond_ad; |
---|
56 | |
---|
57 | col.sp.frac = 0.1; |
---|
58 | |
---|
59 | col.sp.Outlet1.F = 0.5 * PIDLcond.Ports.output * "mol/s"; |
---|
60 | col.reb.OutletL.F = 1.736 * PIDLreb.Ports.output * "mol/s"; |
---|
61 | |
---|
62 | PIDTreb.Ports.setPoint= (367 * "K" - Trebmin)/(Trebmax-Trebmin); |
---|
63 | PIDTcond.Ports.setPoint= (344 * "K" - Trebmin)/(Trebmax-Trebmin); |
---|
64 | col.cond.Q = -1e2 * PIDTcond.Ports.output * "kJ/s"; |
---|
65 | |
---|
66 | #verificando a partida do refervedor |
---|
67 | if time < 200 * "s" then |
---|
68 | col.reb.startup = 1; |
---|
69 | else |
---|
70 | col.reb.startup = 0; |
---|
71 | end |
---|
72 | |
---|
73 | if col.reb.startup then |
---|
74 | col.reb.Q = 0 * PIDTreb.Ports.output * "kJ/s"; |
---|
75 | else |
---|
76 | col.reb.Q = 1e2 * PIDTreb.Ports.output * "kJ/s"; |
---|
77 | end |
---|
78 | |
---|
79 | "Reaction - Trays" |
---|
80 | col.trays.r = exp(-7150*"K"/col.trays.OutletL.T)* |
---|
81 | (4.85e4*col.trays.C(1)*col.trays.C(2) - 1.23e4*col.trays.C(3)*col.trays.C(4))*"l/mol/s"; |
---|
82 | "Reaction - Reboiler" |
---|
83 | col.reb.r = exp(-7150*"K"/col.reb.OutletL.T)*(4.85e4*col.reb.C(1)*col.reb.C(2) |
---|
84 | - 1.23e4*col.reb.C(3)*col.reb.C(4)) * "l/mol/s"; |
---|
85 | "Reaction - Condenser" |
---|
86 | col.cond.r = exp(-7150*"K"/col.cond.OutletL.T)*(4.85e4*col.cond.C(1)*col.cond.C(2) |
---|
87 | - 1.23e4*col.cond.C(3)*col.cond.C(4)) * "l/mol/s"; |
---|
88 | |
---|
89 | |
---|
90 | SPECIFY |
---|
91 | feed.F = 1.076 * "mol/s"; |
---|
92 | feed.T = 300 * "K"; |
---|
93 | feed.P = 1.0 * "atm"; |
---|
94 | feed.z = [0.4962, 0.4808, 0, 0.0229]; |
---|
95 | |
---|
96 | zero.F = 0 * "kmol/h"; |
---|
97 | zero.T = 353 * "K"; |
---|
98 | zero.P = 1 * "atm"; |
---|
99 | zero.z = [0.4962, 0.4808, 0, 0.0229]; |
---|
100 | zero.v = 0; |
---|
101 | zero.h = 0 * "J/mol"; |
---|
102 | |
---|
103 | col.p.dP = 0.95 * "atm" - col.sp.Outlet2.P; |
---|
104 | col.trays.Emv = 1; |
---|
105 | |
---|
106 | # Variáveis dos PID's especificadas |
---|
107 | PIDLreb.Parameters.tau = 1*"s"; |
---|
108 | PIDLreb.Parameters.tauSet=1*"s"; |
---|
109 | PIDLreb.Parameters.bias = 0; |
---|
110 | PIDLreb.Parameters.alpha=1; |
---|
111 | PIDLreb.Parameters.gamma=1; |
---|
112 | PIDLreb.Parameters.beta=1; |
---|
113 | PIDLreb.Parameters.gain=1; |
---|
114 | PIDLreb.Parameters.intTime=100*"s"; |
---|
115 | PIDLreb.Parameters.derivTime=1*"s"; |
---|
116 | PIDLreb.Options.action=-1; |
---|
117 | PIDLreb.Options.clip=1; |
---|
118 | PIDLreb.Options.autoMan=0; |
---|
119 | PIDLreb.Ports.setPoint=(0.5 * "m" - Lrebmin)/(Lrebmax-Lrebmin); |
---|
120 | |
---|
121 | PIDLcond.Parameters.tau = 1*"s"; |
---|
122 | PIDLcond.Parameters.tauSet=1*"s"; |
---|
123 | PIDLcond.Parameters.bias = 0; |
---|
124 | PIDLcond.Parameters.alpha=1; |
---|
125 | PIDLcond.Parameters.gamma=1; |
---|
126 | PIDLcond.Parameters.beta=1; |
---|
127 | PIDLcond.Parameters.gain=1; |
---|
128 | PIDLcond.Parameters.intTime=10*"s"; |
---|
129 | PIDLcond.Parameters.derivTime=1*"s"; |
---|
130 | PIDLcond.Options.action=-1; |
---|
131 | PIDLcond.Options.clip=1; |
---|
132 | PIDLcond.Options.autoMan=0; |
---|
133 | PIDLcond.Ports.setPoint=(0.5 * "m" - Lcondmin)/(Lcondmax-Lcondmin); |
---|
134 | |
---|
135 | PIDTreb.Parameters.tau = 1*"s"; |
---|
136 | PIDTreb.Parameters.tauSet=1*"s"; |
---|
137 | PIDTreb.Parameters.bias = 0.2; |
---|
138 | PIDTreb.Parameters.alpha=0.2; |
---|
139 | PIDTreb.Parameters.gamma=1; |
---|
140 | PIDTreb.Parameters.beta=1; |
---|
141 | PIDTreb.Parameters.gain=0.9; |
---|
142 | PIDTreb.Parameters.intTime=10*"s"; |
---|
143 | PIDTreb.Parameters.derivTime=1*"s"; |
---|
144 | PIDTreb.Options.action=1; |
---|
145 | PIDTreb.Options.clip=1; |
---|
146 | PIDTreb.Options.autoMan=0; |
---|
147 | |
---|
148 | PIDTcond.Parameters.tau = 1*"s"; |
---|
149 | PIDTcond.Parameters.tauSet=1*"s"; |
---|
150 | PIDTcond.Parameters.bias = 0.2; |
---|
151 | PIDTcond.Parameters.alpha=0.2; |
---|
152 | PIDTcond.Parameters.gamma=1; |
---|
153 | PIDTcond.Parameters.beta=1; |
---|
154 | PIDTcond.Parameters.gain=1; |
---|
155 | PIDTcond.Parameters.intTime=10*"s"; |
---|
156 | PIDTcond.Parameters.derivTime=1*"s"; |
---|
157 | PIDTcond.Options.action=-1; |
---|
158 | PIDTcond.Options.clip=1; |
---|
159 | PIDTcond.Options.autoMan=0; |
---|
160 | |
---|
161 | "Valores limites para normalizações" |
---|
162 | Lrebmax=0.8*"m"; |
---|
163 | Lrebmin=0.1*"m"; |
---|
164 | Lcondmax=0.8*"m"; |
---|
165 | Lcondmin=0.1*"m"; |
---|
166 | Trebmax=400*"K"; |
---|
167 | Trebmin=200*"K"; |
---|
168 | Tcondmax=380*"K"; |
---|
169 | Tcondmin=250*"K"; |
---|
170 | |
---|
171 | col.cond.OutletV.F = 0 * "kmol/h"; |
---|
172 | |
---|
173 | SET |
---|
174 | col.NTrays = 11; |
---|
175 | |
---|
176 | col.trays.stoic = [-1, -1, 1, 1]; |
---|
177 | col.cond.stoic = [-1, -1, 1, 1]; |
---|
178 | col.reb.stoic = [-1, -1, 1, 1]; |
---|
179 | col.cond.V = 6 * "l"; |
---|
180 | col.cond.Across = 6 * "l/m"; |
---|
181 | |
---|
182 | col.trays.V = 0.0961 * "m^3"; # 0.34* (3.14*0.6*0.6/4) |
---|
183 | col.trays.Ah = 0.04 * "m^2";#0.2 * "m^2"; |
---|
184 | col.trays.lw = 0.457 * "m"; |
---|
185 | col.trays.hw = 0.05 * "m"; |
---|
186 | col.trays.Q = 0 * "kW"; |
---|
187 | col.trays.beta = 0.8; |
---|
188 | col.trays.alfa = 5; |
---|
189 | col.trays.Ap = 0.07 * "m^2"; #0.24 * "m^2"; # 3.14*0.6*0.6/4 - 15% |
---|
190 | |
---|
191 | col.trays.Hr = 0 * "kJ/mol"; |
---|
192 | col.cond.Hr = 0 * "kJ/mol"; |
---|
193 | col.reb.Hr = 0 * "kJ/mol"; |
---|
194 | col.reb.V = 20 * "l"; |
---|
195 | col.reb.Across = 20 * "l/m"; |
---|
196 | |
---|
197 | col.reb.Pstartup = 1 * "atm"; |
---|
198 | col.trays.Pstartup = 1 * "atm"; |
---|
199 | col.cond.Pstartup = 1 * "atm"; |
---|
200 | |
---|
201 | INITIAL |
---|
202 | # condenser |
---|
203 | col.cond.OutletL.T = 300 *"K"; |
---|
204 | col.cond.Level = 0.1 * "m"; |
---|
205 | col.cond.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
206 | |
---|
207 | # reboiler |
---|
208 | col.reb.OutletL.T = 300 *"K"; |
---|
209 | col.reb.Level = 0.1 * "m"; |
---|
210 | col.reb.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
211 | |
---|
212 | # column trays |
---|
213 | col.trays.OutletL.T = 300 * "K"; |
---|
214 | col.trays.Level = 0.1 * col.trays.hw; |
---|
215 | col.trays.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
216 | |
---|
217 | OPTIONS |
---|
218 | relativeAccuracy = 1e-3; |
---|
219 | time = [0:200, 210:10:2000, 2100:100:20000]; |
---|
220 | end |
---|