[86] | 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 column model |
---|
| 17 | *-------------------------------------------------------------------- |
---|
| 18 | * |
---|
[88] | 19 | * This sample file needs VRTherm DEMO(www.vrtech.com.br) to run |
---|
| 20 | * SectionColumn_Test and needs VRTherm full to run the distillation |
---|
| 21 | * column flowsheet. |
---|
[86] | 22 | * |
---|
| 23 | *---------------------------------------------------------------------- |
---|
| 24 | * Author: Paula B. Staudt |
---|
| 25 | * $Id: sample_column.mso 270 2007-06-16 19:18:47Z paula $ |
---|
| 26 | *--------------------------------------------------------------------*# |
---|
| 27 | |
---|
[1] | 28 | using "stage_separators/column"; |
---|
[111] | 29 | using "controllers/PIDIncr"; |
---|
[1] | 30 | |
---|
| 31 | # column section with 2 trays |
---|
| 32 | FlowSheet SectionColumn_Test_with2tray |
---|
| 33 | PARAMETERS |
---|
[213] | 34 | PP as Plugin(Brief="Physical Properties", |
---|
| 35 | Type="PP", |
---|
| 36 | Components = [ "isobutane", "benzene"], |
---|
| 37 | LiquidModel = "PR", |
---|
| 38 | VapourModel = "PR" |
---|
| 39 | ); |
---|
[1] | 40 | NComp as Integer; |
---|
| 41 | |
---|
| 42 | SET |
---|
| 43 | NComp = PP.NumberOfComponents; |
---|
| 44 | |
---|
| 45 | DEVICES |
---|
| 46 | sec as Section_Column; |
---|
[125] | 47 | feed as liquid_stream; |
---|
| 48 | reb as vapour_stream; |
---|
| 49 | cond as liquid_stream; |
---|
[1] | 50 | zero as stream; |
---|
| 51 | |
---|
| 52 | CONNECTIONS |
---|
| 53 | feed to sec.trays(2).Inlet; |
---|
| 54 | zero to sec.trays(1).Inlet; |
---|
| 55 | reb to sec.trays(2).InletV; |
---|
| 56 | cond to sec.trays(1).InletL; |
---|
| 57 | |
---|
| 58 | SPECIFY |
---|
[187] | 59 | feed.F = 113.4 * 'kmol/h'; |
---|
| 60 | feed.T = 291 * 'K'; |
---|
| 61 | feed.P = 168.3 * 'kPa'; |
---|
[1] | 62 | feed.z = [0.5, 0.5]; |
---|
| 63 | |
---|
[187] | 64 | zero.F = 0 * 'kmol/h'; |
---|
| 65 | zero.T = 300 * 'K'; |
---|
| 66 | zero.P = 1 * 'atm'; |
---|
[1] | 67 | zero.z = [0.5, 0.5]; |
---|
| 68 | zero.v = 0; |
---|
[187] | 69 | zero.h = 0 * 'J/mol'; |
---|
[1] | 70 | |
---|
[187] | 71 | cond.F = 68 * 'kmol/h'; |
---|
| 72 | cond.P = 150 * 'kPa'; |
---|
| 73 | cond.T = 281.75 * 'K'; |
---|
[1] | 74 | cond.z = [0.6664, 0.3336]; |
---|
| 75 | |
---|
[187] | 76 | reb.F = 153 * 'kmol/h'; |
---|
| 77 | reb.P = 185 * 'kPa'; |
---|
| 78 | reb.T = 328.12 * 'K'; |
---|
[1] | 79 | reb.z = [0.001848, 0.9982]; |
---|
| 80 | |
---|
| 81 | sec.trays.Emv = 1; |
---|
| 82 | |
---|
| 83 | SET |
---|
| 84 | sec.NTrays = 2; |
---|
| 85 | #COLUMN |
---|
[187] | 86 | sec.trays.V = 4 * 'ft^3'; |
---|
| 87 | sec.trays.Ah = 0.394 * 'ft^2'; |
---|
| 88 | sec.trays.lw = 20.94 * 'in'; |
---|
| 89 | sec.trays.hw = 0.125 * 'ft'; |
---|
| 90 | sec.trays.Q = 0 * 'kW'; |
---|
[1] | 91 | sec.trays.beta = 0.6; |
---|
| 92 | sec.trays.alfa = 4; |
---|
[187] | 93 | sec.trays.Ap = 3.94 * 'ft^2'; |
---|
[1] | 94 | |
---|
| 95 | INITIAL |
---|
[187] | 96 | sec.trays.OutletL.T = 290 *'K'; |
---|
[1] | 97 | sec.trays.Level = 0.9 * sec.trays.hw; |
---|
| 98 | sec.trays.OutletL.z(1) = 0.5; |
---|
| 99 | |
---|
| 100 | OPTIONS |
---|
[125] | 101 | TimeStep = 10; |
---|
| 102 | TimeEnd = 1000; |
---|
[111] | 103 | |
---|
| 104 | # After running few seconds of transient the steady-state |
---|
| 105 | # can be obtained by using the results from that transient: |
---|
| 106 | |
---|
[208] | 107 | #GuessFile="SectionColumn_Test_with2tray.rlt"; |
---|
| 108 | #Dynamic = false; |
---|
[1] | 109 | end |
---|
| 110 | |
---|
| 111 | # column section with 8 trays |
---|
| 112 | FlowSheet SectionColumn_Test_with8tray |
---|
| 113 | PARAMETERS |
---|
[213] | 114 | PP as Plugin(Brief="Physical Properties", |
---|
| 115 | Type="PP", |
---|
| 116 | Components = [ "isobutane", "benzene"], |
---|
| 117 | LiquidModel = "PR", |
---|
| 118 | VapourModel = "PR" |
---|
| 119 | ); |
---|
[1] | 120 | NComp as Integer; |
---|
| 121 | |
---|
| 122 | SET |
---|
| 123 | NComp = PP.NumberOfComponents; |
---|
| 124 | |
---|
| 125 | DEVICES |
---|
| 126 | sec as Section_Column; |
---|
[125] | 127 | feed as liquid_stream; |
---|
| 128 | reb as vapour_stream; |
---|
| 129 | cond as liquid_stream; |
---|
[1] | 130 | zero as stream; |
---|
| 131 | |
---|
| 132 | CONNECTIONS |
---|
| 133 | feed to sec.trays(5).Inlet; |
---|
| 134 | |
---|
| 135 | zero to sec.trays([1:4]).Inlet; |
---|
| 136 | zero to sec.trays([6:8]).Inlet; |
---|
| 137 | |
---|
| 138 | reb to sec.trays(8).InletV; |
---|
| 139 | cond to sec.trays(1).InletL; |
---|
| 140 | |
---|
| 141 | SPECIFY |
---|
[187] | 142 | feed.F = 113.4 * 'kmol/h'; |
---|
| 143 | feed.T = 291 * 'K'; |
---|
| 144 | feed.P = 168.3 * 'kPa'; |
---|
[1] | 145 | feed.z = [0.5, 0.5]; |
---|
| 146 | |
---|
[187] | 147 | zero.F = 0 * 'kmol/h'; |
---|
| 148 | zero.T = 300 * 'K'; |
---|
| 149 | zero.P = 1 * 'atm'; |
---|
[1] | 150 | zero.z = [0.5, 0.5]; |
---|
| 151 | zero.v = 0; |
---|
[187] | 152 | zero.h = 0 * 'J/mol'; |
---|
[1] | 153 | |
---|
[187] | 154 | cond.F = 68 * 'kmol/h'; |
---|
| 155 | cond.P = 150 * 'kPa'; |
---|
| 156 | cond.T = 281.75 * 'K'; |
---|
[1] | 157 | cond.z = [0.6664, 0.3336]; |
---|
| 158 | |
---|
[187] | 159 | reb.F = 153 * 'kmol/h'; |
---|
| 160 | reb.P = 185 * 'kPa'; |
---|
| 161 | reb.T = 328.12 * 'K'; |
---|
[1] | 162 | reb.z = [0.001848, 0.9982]; |
---|
| 163 | |
---|
| 164 | sec.trays.Emv = 1; |
---|
| 165 | |
---|
| 166 | SET |
---|
| 167 | sec.NTrays = 8; |
---|
| 168 | #COLUMN |
---|
[187] | 169 | sec.trays.V = 4 * 'ft^3'; |
---|
| 170 | sec.trays.Ah = 0.394 * 'ft^2'; |
---|
| 171 | sec.trays.lw = 20.94 * 'in'; |
---|
| 172 | sec.trays.hw = 0.125 * 'ft'; |
---|
| 173 | sec.trays.Q = 0 * 'kW'; |
---|
[1] | 174 | sec.trays.beta = 0.6; |
---|
| 175 | sec.trays.alfa = 4; |
---|
[187] | 176 | sec.trays.Ap = 3.94 * 'ft^2'; |
---|
[1] | 177 | |
---|
| 178 | INITIAL |
---|
[187] | 179 | sec.trays.OutletL.T = [290:(330-290)/(sec.NTrays-1):330] *'K'; |
---|
[1] | 180 | sec.trays.Level = 0.3 * sec.trays.hw; |
---|
| 181 | sec.trays.OutletL.z(1) = 0.5; |
---|
| 182 | |
---|
| 183 | OPTIONS |
---|
[125] | 184 | TimeStep = 1; |
---|
| 185 | TimeEnd = 100; |
---|
[208] | 186 | #GuessFile="SectionColumn_Test_with8tray.rlt"; |
---|
| 187 | #Dynamic = false; |
---|
[1] | 188 | end |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | FlowSheet Distillation_kettle_cond_Test |
---|
| 192 | PARAMETERS |
---|
[213] | 193 | PP as Plugin(Brief="Physical Properties", |
---|
| 194 | Type="PP", |
---|
[218] | 195 | Components = [ "isobutane", "n-pentane", "propylene", |
---|
| 196 | "benzene", "isobutene" ], |
---|
[213] | 197 | LiquidModel = "PR", |
---|
| 198 | VapourModel = "PR" |
---|
| 199 | ); |
---|
[1] | 200 | NComp as Integer; |
---|
| 201 | |
---|
| 202 | VARIABLES |
---|
| 203 | Qc as heat_rate (Brief="Heat rate removed from condenser"); |
---|
| 204 | Qr as heat_rate (Brief="Heat rate supplied to reboiler"); |
---|
| 205 | |
---|
| 206 | SET |
---|
| 207 | NComp = PP.NumberOfComponents; |
---|
| 208 | |
---|
| 209 | DEVICES |
---|
| 210 | col as Distillation_kettle_cond; |
---|
[125] | 211 | feed as source; |
---|
[1] | 212 | zero as stream; |
---|
| 213 | |
---|
| 214 | CONNECTIONS |
---|
[187] | 215 | feed.Outlet to col.trays(5).Inlet; |
---|
[1] | 216 | zero to col.reb.Inlet; |
---|
| 217 | zero to col.trays([1:4]).Inlet; |
---|
| 218 | zero to col.trays([6:col.NTrays]).Inlet; |
---|
| 219 | Qc to col.cond.Q; |
---|
| 220 | Qr to col.reb.Q; |
---|
| 221 | |
---|
| 222 | SPECIFY |
---|
[187] | 223 | feed.Outlet.F = 113.4 * 'kmol/h'; |
---|
| 224 | feed.Outlet.T = 291 * 'K'; |
---|
| 225 | feed.Outlet.P = 168.3 * 'kPa'; |
---|
[125] | 226 | feed.Outlet.z = 1/NComp; |
---|
[1] | 227 | |
---|
[187] | 228 | zero.F = 0 * 'kmol/h'; |
---|
| 229 | zero.T = 300 * 'K'; |
---|
| 230 | zero.P = 1 * 'atm'; |
---|
[1] | 231 | zero.z = 1/NComp; |
---|
| 232 | zero.v = 0; |
---|
[187] | 233 | zero.h = 0 * 'J/mol'; |
---|
[1] | 234 | |
---|
[187] | 235 | col.sptop.Outlet2.F = 85 * 'kmol/h'; |
---|
| 236 | col.reb.OutletL.F = 28.4 * 'kmol/h'; |
---|
[19] | 237 | col.sptop.frac = 0.444445; |
---|
[187] | 238 | col.cond.OutletV.F = 0 * 'kmol/h'; |
---|
| 239 | Qr = 3.7743e6 * 'kJ/h'; |
---|
| 240 | Qc = -3.71e6 * 'kJ/h'; |
---|
| 241 | col.pump1.dP = 16 * 'kPa'; |
---|
[1] | 242 | col.trays.Emv = 1; |
---|
| 243 | |
---|
| 244 | SET |
---|
| 245 | col.NTrays = 8; |
---|
[187] | 246 | col.cond.V = 2 * 'm^3'; |
---|
| 247 | col.cond.Across = 1 * 'm^2'; |
---|
| 248 | col.trays.V = 4 * 'ft^3'; |
---|
| 249 | col.trays.Ah = 0.394 * 'ft^2'; |
---|
| 250 | col.trays.lw = 20.94 * 'in'; |
---|
| 251 | col.trays.hw = 0.125 * 'ft'; |
---|
| 252 | col.trays.Q = 0 * 'kW'; |
---|
[1] | 253 | col.trays.beta = 0.6; |
---|
| 254 | col.trays.alfa = 4; |
---|
[187] | 255 | col.trays.Ap = 3.94 * 'ft^2'; |
---|
| 256 | col.reb.V = 2 * 'm^3'; |
---|
| 257 | col.reb.Across = 1 * 'm^2'; |
---|
[1] | 258 | |
---|
| 259 | INITIAL |
---|
| 260 | # condenser |
---|
[187] | 261 | col.cond.OutletL.T = 260 *'K'; |
---|
| 262 | col.cond.Level = 1 * 'm'; |
---|
[1] | 263 | col.cond.OutletL.z([1:4]) = [0.65, 0.05, 0.01, 0.01]; |
---|
| 264 | |
---|
| 265 | # reboiler |
---|
[187] | 266 | col.reb.OutletL.T = 330 *'K'; |
---|
| 267 | col.reb.Level = 1 * 'm'; |
---|
[1] | 268 | col.reb.OutletL.z([1:4]) = [0.1, 0.7, 0.01, 0.01]; |
---|
| 269 | |
---|
| 270 | # column trays |
---|
[187] | 271 | col.trays.OutletL.T = [290:(330-290)/(col.NTrays-1):330] * 'K'; |
---|
[19] | 272 | col.trays.Level = 1.2 * col.trays.hw; |
---|
[1] | 273 | col.trays.OutletL.z([1:4]) = [0.5, 0.05, 0.01, 0.01]; |
---|
| 274 | |
---|
| 275 | OPTIONS |
---|
[187] | 276 | TimeStep = 0.1; |
---|
[125] | 277 | TimeEnd = 50; |
---|
| 278 | #time = [0:0.01:1, 2:50]; |
---|
[208] | 279 | #GuessFile="Distillation_kettle_cond_Test.rlt"; |
---|
| 280 | #Dynamic = false; |
---|
[1] | 281 | end |
---|
[111] | 282 | |
---|
[270] | 283 | FlowSheet Distillation_thermosyphon_subcooling_Test |
---|
| 284 | PARAMETERS |
---|
| 285 | PP as Plugin(Brief="Physical Properties", |
---|
| 286 | Type="PP", |
---|
| 287 | Components = [ "isobutane", "n-pentane", "propylene", |
---|
| 288 | "benzene", "isobutene" ], |
---|
| 289 | LiquidModel = "PR", |
---|
| 290 | VapourModel = "PR" |
---|
| 291 | ); |
---|
| 292 | NComp as Integer; |
---|
| 293 | |
---|
| 294 | VARIABLES |
---|
| 295 | Qc as heat_rate (Brief="Heat rate removed from condenser"); |
---|
| 296 | Qr as heat_rate (Brief="Heat rate supplied to reboiler"); |
---|
| 297 | Qttop as heat_rate (Brief="Heat rate removed from condenser"); |
---|
| 298 | Qtbottom as heat_rate (Brief="Heat rate supplied to reboiler"); |
---|
| 299 | |
---|
| 300 | SET |
---|
| 301 | NComp = PP.NumberOfComponents; |
---|
| 302 | |
---|
| 303 | DEVICES |
---|
| 304 | col as Distillation_thermosyphon_subcooling; |
---|
| 305 | feed as source; |
---|
| 306 | zero as stream; |
---|
| 307 | |
---|
| 308 | CONNECTIONS |
---|
| 309 | feed.Outlet to col.trays(5).Inlet; |
---|
| 310 | zero to col.trays([1:4]).Inlet; |
---|
| 311 | zero to col.trays([6:col.NTrays]).Inlet; |
---|
| 312 | Qttop to col.ttop.Q; |
---|
| 313 | Qtbottom to col.tbottom.Q; |
---|
| 314 | Qc to col.cond.Q; |
---|
| 315 | Qr to col.reb.Q; |
---|
| 316 | |
---|
| 317 | SPECIFY |
---|
| 318 | feed.Outlet.F = 113.4 * 'kmol/h'; |
---|
| 319 | feed.Outlet.T = 291 * 'K'; |
---|
| 320 | feed.Outlet.P = 168.3 * 'kPa'; |
---|
| 321 | feed.Outlet.z = 1/NComp; |
---|
| 322 | |
---|
| 323 | zero.F = 0 * 'kmol/h'; |
---|
| 324 | zero.T = 300 * 'K'; |
---|
| 325 | zero.P = 1 * 'atm'; |
---|
| 326 | zero.z = 1/NComp; |
---|
| 327 | zero.v = 0; |
---|
| 328 | zero.h = 0 * 'J/mol'; |
---|
| 329 | |
---|
| 330 | col.sptop.Outlet2.F = 85 * 'kmol/h'; |
---|
| 331 | col.sptop.frac = 0.444445; |
---|
| 332 | col.spbottom.Outlet1.F = 100 * 'kmol/h'; |
---|
| 333 | |
---|
| 334 | Qr = 3.7743e6 * 'kJ/h'; |
---|
| 335 | Qc = -3.71e6 * 'kJ/h'; |
---|
| 336 | Qttop = 0 * 'kJ/h'; |
---|
| 337 | Qtbottom = 0 * 'kJ/h'; |
---|
| 338 | |
---|
| 339 | col.pump1.dP = 16 * 'kPa'; |
---|
| 340 | col.trays.Emv = 1; |
---|
| 341 | col.cond.DP = 0.5 * 'atm'; |
---|
| 342 | |
---|
| 343 | SET |
---|
| 344 | col.NTrays = 8; |
---|
| 345 | col.trays.V = 4 * 'ft^3'; |
---|
| 346 | col.trays.Ah = 0.394 * 'ft^2'; |
---|
| 347 | col.trays.lw = 20.94 * 'in'; |
---|
| 348 | col.trays.hw = 0.125 * 'ft'; |
---|
| 349 | col.trays.Q = 0 * 'kW'; |
---|
| 350 | col.trays.beta = 0.6; |
---|
| 351 | col.trays.alfa = 4; |
---|
| 352 | col.trays.Ap = 3.94 * 'ft^2'; |
---|
| 353 | col.reb.DP = 0.5 * 'atm'; |
---|
| 354 | col.tbottom.Across = 2.20 * 'm^2'; |
---|
| 355 | |
---|
| 356 | INITIAL |
---|
| 357 | # ttop |
---|
| 358 | col.ttop.Outlet.T = 260 *'K'; |
---|
| 359 | col.ttop.Level = 1 * 'm'; |
---|
| 360 | col.ttop.Outlet.z([1:4]) = [0.65, 0.05, 0.01, 0.01]; |
---|
| 361 | |
---|
| 362 | # tbottom |
---|
| 363 | col.tbottom.Outlet.T = 330 *'K'; |
---|
| 364 | col.tbottom.Level = 1 * 'm'; |
---|
| 365 | col.tbottom.Outlet.z([1:4]) = [0.1, 0.7, 0.01, 0.01]; |
---|
| 366 | |
---|
| 367 | # column trays |
---|
| 368 | col.trays.OutletL.T = [290:(330-290)/(col.NTrays-1):330] * 'K'; |
---|
| 369 | col.trays.Level = 1.2 * col.trays.hw; |
---|
| 370 | col.trays.OutletL.z([1:4]) = [0.5, 0.05, 0.01, 0.01]; |
---|
| 371 | |
---|
| 372 | OPTIONS |
---|
| 373 | TimeStep = 0.1; |
---|
| 374 | TimeEnd = 50; |
---|
| 375 | #time = [0:0.01:1, 2:50]; |
---|
| 376 | #GuessFile="Distillation_kettle_cond_Test.rlt"; |
---|
| 377 | #Dynamic = false; |
---|
| 378 | end |
---|
| 379 | |
---|
[111] | 380 | FlowSheet Column_ctrl |
---|
| 381 | PARAMETERS |
---|
[213] | 382 | PP as Plugin(Brief="Physical Properties", |
---|
| 383 | Type="PP", |
---|
| 384 | Components = [ "isobutane", "n-pentane", "propylene", |
---|
| 385 | "benzene", "isobutene" ], |
---|
| 386 | LiquidModel = "PR", |
---|
| 387 | VapourModel = "PR" |
---|
| 388 | ); |
---|
[111] | 389 | NComp as Integer; |
---|
| 390 | |
---|
| 391 | Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied"); |
---|
| 392 | Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied"); |
---|
| 393 | Qrmin as heat_rate (Brief="Minimum Reboiler Heat supplied"); |
---|
| 394 | Qrmax as heat_rate (Brief="Maximum Reboiler Heat supplied"); |
---|
| 395 | Frmin as flow_mol (Brief="Minimum bottom flow rate"); |
---|
| 396 | Frmax as flow_mol (Brief="Maximum bottom flow rate"); |
---|
| 397 | Fcmin as flow_mol (Brief="Minimum reflux flow rate"); |
---|
| 398 | Fcmax as flow_mol (Brief="Maximum reflux flow rate"); |
---|
| 399 | Hmint as length (Brief="Minimum liquid level in top tank"); |
---|
| 400 | Hmaxt as length (Brief="Maximum liquid level in top tank"); |
---|
| 401 | Hminb as length (Brief="Minimum liquid level in reboiler"); |
---|
| 402 | Hmaxb as length (Brief="Maximum liquid level in reboiler"); |
---|
| 403 | Pmax as pressure (Brief="Maximum column pressure"); |
---|
| 404 | Pmin as pressure (Brief="Minimum column pressure"); |
---|
| 405 | Tmax as temperature (Brief="Maximum column temperature"); |
---|
| 406 | Tmin as temperature (Brief="Minimum column temperature"); |
---|
| 407 | |
---|
| 408 | VARIABLES |
---|
| 409 | Qc as heat_rate (Brief="Heat rate removed from condenser"); |
---|
| 410 | Qr as heat_rate (Brief="Heat rate supplied to reboiler"); |
---|
| 411 | Had_top as Real (Brief="Dimensionless condenser level"); |
---|
| 412 | Had_bot as Real (Brief="Dimensionless reboiler level"); |
---|
| 413 | Pad as Real (Brief="Dimensionless pressure"); |
---|
| 414 | Tad as Real (Brief="Dimensionless temperature"); |
---|
[112] | 415 | RR as positive (Brief="Reflux ratio"); |
---|
| 416 | |
---|
[111] | 417 | SET |
---|
| 418 | NComp = PP.NumberOfComponents; |
---|
| 419 | |
---|
| 420 | DEVICES |
---|
| 421 | col as Distillation_kettle_cond; |
---|
[125] | 422 | feed as source; |
---|
[111] | 423 | zero as stream; |
---|
| 424 | TCcond as PIDIncr_Ideal_AW; |
---|
| 425 | LCtop as PIDIncr_Ideal_AW; |
---|
| 426 | LCbot as PIDIncr_Ideal_AW; |
---|
| 427 | PC as PIDIncr_Ideal_AW; |
---|
| 428 | |
---|
| 429 | CONNECTIONS |
---|
[134] | 430 | feed.Outlet to col.trays(5).Inlet; |
---|
[111] | 431 | zero to col.reb.Inlet; |
---|
| 432 | zero to col.trays([1:4]).Inlet; |
---|
| 433 | zero to col.trays([6:col.NTrays]).Inlet; |
---|
| 434 | Qc to col.cond.Q; |
---|
| 435 | Qr to col.reb.Q; |
---|
| 436 | |
---|
| 437 | EQUATIONS |
---|
| 438 | "Temperature Controller" |
---|
[177] | 439 | TCcond.Parameters.tau = 0*'s'; |
---|
| 440 | TCcond.Parameters.tauSet = 0*'s'; |
---|
[111] | 441 | TCcond.Parameters.alpha = 0.3; |
---|
| 442 | TCcond.Parameters.bias = 0.5; |
---|
| 443 | TCcond.Parameters.gamma = 1; |
---|
| 444 | TCcond.Parameters.beta = 1; |
---|
| 445 | TCcond.Options.action = 1; |
---|
| 446 | TCcond.Options.clip = 1; |
---|
| 447 | TCcond.Options.autoMan = 0; |
---|
[177] | 448 | TCcond.Parameters.intTime = 60*'s'; |
---|
[111] | 449 | TCcond.Parameters.gain = 0.6; |
---|
[177] | 450 | TCcond.Parameters.derivTime = 1*'s'; |
---|
| 451 | TCcond.Ports.setPoint = ((15+273.15) * 'K' - Tmin)/(Tmax-Tmin); |
---|
[111] | 452 | TCcond.Ports.input = Tad; |
---|
| 453 | Tad = (col.cond.OutletL.T-Tmin)/(Tmax-Tmin); |
---|
| 454 | Qc = Qcmin+(Qcmax-Qcmin)*TCcond.Ports.output; |
---|
| 455 | |
---|
| 456 | "Pressure Controller" |
---|
[177] | 457 | PC.Parameters.tau = 0*'s'; |
---|
| 458 | PC.Parameters.tauSet = 0*'s'; |
---|
[111] | 459 | PC.Parameters.alpha = 0.3; |
---|
| 460 | PC.Parameters.bias = 0; |
---|
| 461 | PC.Parameters.gamma = 1; |
---|
| 462 | PC.Parameters.beta = 1; |
---|
| 463 | PC.Options.action = -1; |
---|
| 464 | PC.Options.clip = 1; |
---|
| 465 | PC.Options.autoMan = 0; |
---|
[177] | 466 | PC.Parameters.intTime = 50*'s'; |
---|
[111] | 467 | PC.Parameters.gain = 0.5; |
---|
[177] | 468 | PC.Parameters.derivTime = 1*'s'; |
---|
| 469 | PC.Ports.setPoint = (2.0*'bar'-Pmin)/(Pmax-Pmin); |
---|
[111] | 470 | PC.Ports.input = Pad; |
---|
| 471 | Pad = (col.cond.OutletV.P-Pmin)/(Pmax-Pmin); |
---|
| 472 | col.cond.OutletV.F = (Fcmin+(Fcmax-Fcmin)*PC.Ports.output); |
---|
| 473 | |
---|
| 474 | "Ttop Level Controller" |
---|
[177] | 475 | LCtop.Parameters.tau = 0*'s'; |
---|
| 476 | LCtop.Parameters.tauSet = 0*'s'; |
---|
[111] | 477 | LCtop.Parameters.alpha = 0.3; |
---|
| 478 | LCtop.Parameters.bias = 0.5; |
---|
| 479 | LCtop.Parameters.gamma = 1; |
---|
| 480 | LCtop.Parameters.beta = 1; |
---|
| 481 | LCtop.Options.action = -1; |
---|
| 482 | LCtop.Options.clip = 1; |
---|
| 483 | LCtop.Options.autoMan = 0; |
---|
[177] | 484 | LCtop.Parameters.intTime = 10*'s'; |
---|
[111] | 485 | LCtop.Parameters.gain = 1; |
---|
[218] | 486 | LCtop.Parameters.derivTime = 0*'s'; |
---|
[177] | 487 | LCtop.Ports.setPoint = (1.0 * 'm' - Hmint)/(Hmaxt-Hmint); |
---|
[111] | 488 | LCtop.Ports.input = Had_top; |
---|
| 489 | Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint); |
---|
| 490 | col.sptop.Outlet1.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output; |
---|
| 491 | |
---|
| 492 | "Tbottom Level Controller" |
---|
[177] | 493 | LCbot.Parameters.tau = 0*'s'; |
---|
| 494 | LCbot.Parameters.tauSet = 0*'s'; |
---|
[111] | 495 | LCbot.Parameters.alpha = 0.3; |
---|
| 496 | LCbot.Parameters.bias = 0.5; |
---|
| 497 | LCbot.Parameters.gamma = 1; |
---|
| 498 | LCbot.Parameters.beta = 1; |
---|
| 499 | LCbot.Options.action = -1; |
---|
| 500 | LCbot.Options.clip = 1; |
---|
| 501 | LCbot.Options.autoMan = 0; |
---|
[177] | 502 | LCbot.Parameters.intTime = 100*'s'; |
---|
[111] | 503 | LCbot.Parameters.gain = 1; |
---|
[218] | 504 | LCbot.Parameters.derivTime = 0*'s'; |
---|
[177] | 505 | LCbot.Ports.setPoint = (1.0 * 'm' - Hminb)/(Hmaxb-Hminb); |
---|
[111] | 506 | LCbot.Ports.input = Had_bot; |
---|
| 507 | Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb); |
---|
| 508 | col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output; |
---|
| 509 | |
---|
[112] | 510 | RR * (col.cond.OutletV.F + col.sptop.Outlet1.F) = col.sptop.Outlet2.F; |
---|
| 511 | |
---|
[177] | 512 | if time < 1 * 'h' then |
---|
[237] | 513 | col.sptop.Outlet2.F = 75 * 'kmol/h'; # reflux |
---|
[112] | 514 | else |
---|
[177] | 515 | col.sptop.Outlet2.F = 85 * 'kmol/h'; # reflux |
---|
[112] | 516 | end |
---|
| 517 | |
---|
[111] | 518 | SPECIFY |
---|
[177] | 519 | feed.Outlet.F = 113.4 * 'kmol/h'; |
---|
| 520 | feed.Outlet.T = 291 * 'K'; |
---|
| 521 | feed.Outlet.P = 168.3 * 'kPa'; |
---|
[125] | 522 | feed.Outlet.z = 1/NComp; |
---|
[111] | 523 | |
---|
[177] | 524 | zero.F = 0 * 'kmol/h'; |
---|
| 525 | zero.T = 300 * 'K'; |
---|
| 526 | zero.P = 1 * 'atm'; |
---|
[111] | 527 | zero.z = 1/NComp; |
---|
| 528 | zero.v = 0; |
---|
[177] | 529 | zero.h = 0 * 'J/mol'; |
---|
[111] | 530 | |
---|
[177] | 531 | Qr = 3e6 * 'kJ/h'; |
---|
| 532 | col.pump1.dP = 16 * 'kPa'; |
---|
[111] | 533 | col.trays.Emv = 1; |
---|
| 534 | |
---|
| 535 | SET |
---|
| 536 | col.NTrays = 8; |
---|
[177] | 537 | col.cond.V = 2 * 'm^3'; |
---|
| 538 | col.cond.Across = 1 * 'm^2'; |
---|
| 539 | col.trays.V = 4 * 'ft^3'; |
---|
| 540 | col.trays.Ah = 0.394 * 'ft^2'; |
---|
| 541 | col.trays.lw = 20.94 * 'in'; |
---|
| 542 | col.trays.hw = 0.125 * 'ft'; |
---|
| 543 | col.trays.Q = 0 * 'kW'; |
---|
[111] | 544 | col.trays.beta = 0.6; |
---|
| 545 | col.trays.alfa = 4; |
---|
[177] | 546 | col.trays.Ap = 3.94 * 'ft^2'; |
---|
| 547 | col.reb.V = 2 * 'm^3'; |
---|
| 548 | col.reb.Across = 1 * 'm^2'; |
---|
[111] | 549 | |
---|
[177] | 550 | Qrmax = 5e6 * 'kJ/h'; |
---|
| 551 | Qrmin = 1e6 * 'kJ/h'; |
---|
| 552 | Frmin = 0 * 'kmol/h'; |
---|
| 553 | Frmax = 60 * 'kmol/h'; |
---|
| 554 | Fcmin = 0 * 'kmol/h'; |
---|
| 555 | Fcmax = 120 * 'kmol/h'; |
---|
| 556 | Hmint = 0 * 'm'; |
---|
| 557 | Hmaxt = 2 * 'm'; |
---|
| 558 | Hminb = 0 * 'm'; |
---|
| 559 | Hmaxb = 2 * 'm'; |
---|
| 560 | Pmin = 0.5 * 'bar'; |
---|
| 561 | Pmax = 4 * 'bar'; |
---|
| 562 | Qcmax = -5e5 * 'kJ/h'; |
---|
| 563 | Qcmin = -5e6 * 'kJ/h'; |
---|
| 564 | Tmax = (30+273.15) * 'K'; |
---|
| 565 | Tmin = (-20+273.15) * 'K'; |
---|
[111] | 566 | |
---|
| 567 | INITIAL |
---|
| 568 | # condenser |
---|
[177] | 569 | col.cond.OutletL.T = 260 *'K'; |
---|
| 570 | col.cond.Level = 1 * 'm'; |
---|
[111] | 571 | col.cond.OutletL.z([1:4]) = [0.2, 0.2, 0.4, 0.05]; |
---|
| 572 | |
---|
| 573 | # reboiler |
---|
[177] | 574 | col.reb.OutletL.T = 350 *'K'; |
---|
| 575 | col.reb.Level = 1 * 'm'; |
---|
[111] | 576 | col.reb.OutletL.z([1:4]) = [0.1, 0.4, 0.1, 0.3]; |
---|
[218] | 577 | |
---|
[111] | 578 | # column trays |
---|
[177] | 579 | col.trays.OutletL.T = [290:(330-290)/(col.NTrays-1):330] * 'K'; |
---|
[111] | 580 | col.trays.Level = 1.2 * col.trays.hw; |
---|
| 581 | col.trays.OutletL.z([1:4]) = [0.15, 0.3, 0.25, 0.2]; |
---|
| 582 | |
---|
| 583 | OPTIONS |
---|
[218] | 584 | TimeStep = 0.1; |
---|
| 585 | TimeEnd = 5; |
---|
[177] | 586 | TimeUnit = 'h'; |
---|
[218] | 587 | InitialFile = "Column_ctrl.rlt"; |
---|
[208] | 588 | #GuessFile = "Column_ctrl.rlt"; |
---|
| 589 | #Dynamic = false; |
---|
[111] | 590 | end |
---|
| 591 | |
---|
[270] | 592 | |
---|