[310] | 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 346 2007-08-20 01:32:18Z arge $ |
---|
| 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; |
---|
[313] | 79 | Qc.OutletQ to col.cond.InletQ; |
---|
| 80 | Qr.OutletQ to col.reb.InletQ; |
---|
[310] | 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 |
---|
[313] | 93 | Qc.OutletQ.Q = 0 * PIDTcond.Ports.output * 'kJ/s'; |
---|
| 94 | Qr.OutletQ.Q = 0 * PIDTreb.Ports.output * 'kJ/s'; |
---|
[310] | 95 | |
---|
| 96 | PIDTreb.Ports.input = PIDTreb.Ports.setPoint; |
---|
| 97 | else |
---|
[313] | 98 | Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*PIDTcond.Ports.output; |
---|
| 99 | Qr.OutletQ.Q = Qrmin+(Qrmax-Qrmin)*PIDTreb.Ports.output; |
---|
[310] | 100 | |
---|
| 101 | PIDTreb.Ports.input=Treb_ad; |
---|
| 102 | end |
---|
| 103 | |
---|
| 104 | SPECIFY |
---|
| 105 | feed.Outlet.F = 1.076 * 'mol/s'; |
---|
| 106 | feed.Outlet.T = 300 * 'K'; |
---|
[346] | 107 | feed.Outlet.P = 3.0 * 'atm'; |
---|
[310] | 108 | feed.Outlet.z = [0.4962, 0.4808, 0, 0.0229]; |
---|
| 109 | |
---|
| 110 | zero.F = 0 * 'kmol/h'; |
---|
| 111 | zero.T = 353 * 'K'; |
---|
| 112 | zero.P = 1 * 'atm'; |
---|
| 113 | zero.z = [0.4962, 0.4808, 0, 0.0229]; |
---|
| 114 | zero.v = 0; |
---|
| 115 | zero.h = 0 * 'J/mol'; |
---|
| 116 | |
---|
[346] | 117 | col.p.dP = 2 * 'atm' - col.sp.Outlet2.P; |
---|
[310] | 118 | col.trays.Emv = 1; |
---|
| 119 | |
---|
| 120 | # Variáveis dos PID's especificadas |
---|
| 121 | PIDLreb.Parameters.tau = 1*'s'; |
---|
| 122 | PIDLreb.Parameters.tauSet=1*'s'; |
---|
| 123 | PIDLreb.Parameters.bias = 0; |
---|
| 124 | PIDLreb.Parameters.alpha=1; |
---|
| 125 | PIDLreb.Parameters.gamma=1; |
---|
| 126 | PIDLreb.Parameters.beta=1; |
---|
| 127 | PIDLreb.Parameters.gain=1; |
---|
| 128 | PIDLreb.Parameters.intTime=10*'s'; |
---|
| 129 | PIDLreb.Parameters.derivTime=1*'s'; |
---|
| 130 | PIDLreb.Options.action=-1; |
---|
| 131 | PIDLreb.Options.clip=1; |
---|
| 132 | PIDLreb.Options.autoMan=0; |
---|
| 133 | PIDLreb.Ports.setPoint=(0.5 * 'm' - Lrebmin)/(Lrebmax-Lrebmin); |
---|
| 134 | Lreb_ad*(Lrebmax-Lrebmin)=col.reb.Level-Lrebmin; |
---|
| 135 | PIDLreb.Ports.input=Lreb_ad; |
---|
| 136 | col.reb.OutletL.F = Frmin + (Frmax-Frmin) * PIDLreb.Ports.output; |
---|
| 137 | |
---|
| 138 | PIDLcond.Parameters.tau = 1*'s'; |
---|
| 139 | PIDLcond.Parameters.tauSet=1*'s'; |
---|
| 140 | PIDLcond.Parameters.bias = 0.5; |
---|
| 141 | PIDLcond.Parameters.alpha=1; |
---|
| 142 | PIDLcond.Parameters.gamma=1; |
---|
| 143 | PIDLcond.Parameters.beta=1; |
---|
| 144 | PIDLcond.Parameters.gain=1; |
---|
| 145 | PIDLcond.Parameters.intTime=10*'s'; |
---|
| 146 | PIDLcond.Parameters.derivTime=1*'s'; |
---|
| 147 | PIDLcond.Options.action=-1; |
---|
| 148 | PIDLcond.Options.clip=1; |
---|
| 149 | PIDLcond.Options.autoMan=0; |
---|
| 150 | PIDLcond.Ports.setPoint=(0.5 * 'm' - Lcondmin)/(Lcondmax-Lcondmin); |
---|
| 151 | Lcond_ad*(Lcondmax-Lcondmin)=col.cond.Level-Lcondmin; |
---|
| 152 | PIDLcond.Ports.input=Lcond_ad; |
---|
| 153 | col.sp.Outlet1.F = Fmin + (Fmax-Fmin) * PIDLcond.Ports.output; |
---|
| 154 | |
---|
| 155 | PIDTreb.Parameters.tau = 1*'s'; |
---|
| 156 | PIDTreb.Parameters.tauSet=1*'s'; |
---|
| 157 | PIDTreb.Parameters.bias = 0.2; |
---|
| 158 | PIDTreb.Parameters.alpha=0.2; |
---|
| 159 | PIDTreb.Parameters.gamma=1; |
---|
| 160 | PIDTreb.Parameters.beta=1; |
---|
| 161 | PIDTreb.Parameters.gain=0.9; |
---|
| 162 | PIDTreb.Parameters.intTime=100*'s'; |
---|
| 163 | PIDTreb.Parameters.derivTime=1*'s'; |
---|
| 164 | PIDTreb.Options.action=1; |
---|
| 165 | PIDTreb.Options.clip=1; |
---|
| 166 | PIDTreb.Options.autoMan=0; |
---|
| 167 | PIDTreb.Ports.setPoint= (366 * 'K' - Trebmin)/(Trebmax-Trebmin); |
---|
| 168 | Treb_ad*(Trebmax-Trebmin)=col.reb.OutletL.T-Trebmin; |
---|
| 169 | |
---|
| 170 | PIDTcond.Parameters.tau = 1*'s'; |
---|
| 171 | PIDTcond.Parameters.tauSet=1*'s'; |
---|
| 172 | PIDTcond.Parameters.bias = 0.5; |
---|
| 173 | PIDTcond.Parameters.alpha=0.2; |
---|
| 174 | PIDTcond.Parameters.gamma=1; |
---|
| 175 | PIDTcond.Parameters.beta=1; |
---|
| 176 | PIDTcond.Parameters.gain=1; |
---|
| 177 | PIDTcond.Parameters.intTime=10*'s'; |
---|
| 178 | PIDTcond.Parameters.derivTime=1*'s'; |
---|
| 179 | PIDTcond.Options.action=1; |
---|
| 180 | PIDTcond.Options.clip=1; |
---|
| 181 | PIDTcond.Options.autoMan=0; |
---|
| 182 | PIDTcond.Ports.setPoint= (346 * 'K' - Tcondmin)/(Tcondmax-Tcondmin); |
---|
| 183 | Tcond_ad*(Tcondmax-Tcondmin)=col.cond.OutletL.T-Tcondmin; |
---|
| 184 | PIDTcond.Ports.input=Tcond_ad; |
---|
| 185 | |
---|
| 186 | "Valores limites para normalizações" |
---|
| 187 | Lrebmax=0.8*'m'; |
---|
| 188 | Lrebmin=0.1*'m'; |
---|
| 189 | Lcondmax=0.8*'m'; |
---|
| 190 | Lcondmin=0.1*'m'; |
---|
| 191 | Trebmax=400*'K'; |
---|
| 192 | Trebmin=200*'K'; |
---|
| 193 | Tcondmax=380*'K'; |
---|
| 194 | Tcondmin=250*'K'; |
---|
| 195 | Qcmin = -100 * 'kJ/s'; |
---|
| 196 | Qcmax = 0 * 'kJ/s'; |
---|
| 197 | Qrmin = 0 * 'kJ/s'; |
---|
| 198 | Qrmax = 150 * 'kJ/s'; |
---|
| 199 | Fmin = 0 * 'kmol/h'; |
---|
| 200 | Fmax = 2 * 'kmol/h'; |
---|
| 201 | Frmin = 0 * 'kmol/h'; |
---|
| 202 | Frmax = 5 * 'kmol/h'; |
---|
| 203 | |
---|
| 204 | col.cond.OutletV.F = 0 * 'kmol/h'; |
---|
| 205 | |
---|
| 206 | SET |
---|
| 207 | PIDLreb.PID_Select = "Ideal_AW"; |
---|
| 208 | PIDLcond.PID_Select = "Ideal_AW"; |
---|
| 209 | PIDTreb.PID_Select = "Ideal_AW"; |
---|
| 210 | PIDTcond.PID_Select = "Ideal_AW"; |
---|
| 211 | |
---|
| 212 | col.NTrays = 11; |
---|
| 213 | |
---|
| 214 | col.trays.stoic = [-1, -1, 1, 1]; |
---|
| 215 | col.cond.stoic = [-1, -1, 1, 1]; |
---|
| 216 | col.reb.stoic = [-1, -1, 1, 1]; |
---|
| 217 | col.cond.V = 6 * 'l'; |
---|
| 218 | col.cond.Across = 6 * 'l/m'; |
---|
| 219 | |
---|
| 220 | col.trays.V = 0.0961 * 'm^3'; |
---|
| 221 | col.trays.Ah = 0.04 * 'm^2'; |
---|
| 222 | col.trays.lw = 0.457 * 'm'; |
---|
| 223 | col.trays.hw = 0.05 * 'm'; |
---|
| 224 | col.trays.Q = 0 * 'kW'; |
---|
| 225 | col.trays.beta = 0.8; |
---|
| 226 | col.trays.alfa = 30; |
---|
| 227 | col.alfacond = 100000; |
---|
| 228 | col.trays.Ap = 0.07 * 'm^2'; |
---|
| 229 | |
---|
| 230 | col.trays.Hr = 0 * 'kJ/mol'; |
---|
| 231 | col.cond.Hr = 0 * 'kJ/mol'; |
---|
| 232 | col.reb.Hr = 0 * 'kJ/mol'; |
---|
| 233 | col.reb.V = 20 * 'l'; |
---|
| 234 | col.reb.Across = 20 * 'l/m'; |
---|
| 235 | |
---|
| 236 | col.reb.Pstartup = 1 * 'atm'; |
---|
| 237 | col.trays.Pstartup = 1 * 'atm'; |
---|
| 238 | col.cond.Pstartup = 1 * 'atm'; |
---|
| 239 | |
---|
| 240 | INITIAL |
---|
| 241 | # condenser |
---|
| 242 | col.cond.OutletL.T = 300 *'K'; |
---|
[346] | 243 | col.cond.Level = 0.4 * 'm'; |
---|
[310] | 244 | col.cond.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
| 245 | |
---|
| 246 | # reboiler |
---|
| 247 | col.reb.OutletL.T = 300 * 'K'; |
---|
[346] | 248 | col.reb.Level = 0.4 * 'm'; |
---|
[310] | 249 | col.reb.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
| 250 | |
---|
| 251 | # column trays |
---|
| 252 | col.trays.OutletL.T = 300 * 'K'; |
---|
| 253 | col.trays.Level = 0.1 * col.trays.hw; |
---|
| 254 | col.trays.OutletL.z([1:3]) = [0.4962, 0.4808, 0]; |
---|
| 255 | |
---|
| 256 | OPTIONS |
---|
| 257 | TimeStep = 100; |
---|
| 258 | TimeEnd = 50000; |
---|
| 259 | end |
---|