Changeset 844
 Timestamp:
 Sep 10, 2009, 8:47:35 AM (13 years ago)
 Location:
 trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/eml/stage_separators/flash.mso
r680 r844 198 198 199 199 #* 200 * Model of a Steady State Bubble flash 201 **# 202 Model bubble_steady 203 ATTRIBUTES 204 Pallete = true; 205 Icon = "icon/Flash"; 206 Brief = "Model of a Steady State flash."; 207 Info = 208 "== Assumptions == 209 * both phases are perfectly mixed. 210 211 == Specify == 212 * the feed stream; 213 * the outlet pressure (OutletV.P); 214 * the outlet temperature OR the heat supplied. 215 "; 216 217 PARAMETERS 218 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 219 220 VARIABLES 221 in Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}"); 222 out OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}"); 223 out OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}"); 224 in InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); 225 vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi"); 226 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); 227 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 228 229 EQUATIONS 230 "The flash calculation" 231 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 232 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; 233 234 "Component Molar Balance" 235 Inlet.z = OutletL.z; 236 sum(OutletL.z) = sum(OutletV.z); 237 238 "Global Molar Balance" 239 Inlet.F = OutletV.F + OutletL.F; 240 241 "Vaporization Fraction" 242 OutletV.F = Inlet.F * vfrac; 243 244 "Energy Balance" 245 Inlet.F*Inlet.h + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h; 246 247 "Thermal Equilibrium" 248 OutletV.T = OutletL.T; 249 250 "Mechanical Equilibrium" 251 OutletV.P = OutletL.P; 252 253 "Pressure Drop" 254 OutletL.P = Inlet.P  Pdrop; 255 256 "Pressure Ratio" 257 OutletL.P = Inlet.P * Pratio; 258 259 "Vapor fraction" 260 vfrac = 0; 261 end 262 263 #* 264 * Model of a Steady State Dew flash 265 **# 266 Model dew_steady 267 ATTRIBUTES 268 Pallete = true; 269 Icon = "icon/Flash"; 270 Brief = "Model of a Steady State flash."; 271 Info = 272 "== Assumptions == 273 * both phases are perfectly mixed. 274 275 == Specify == 276 * the feed stream; 277 * the outlet pressure (OutletV.P); 278 * the outlet temperature OR the heat supplied. 279 "; 280 281 PARAMETERS 282 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 283 284 VARIABLES 285 in Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}"); 286 out OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}"); 287 out OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}"); 288 in InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); 289 vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi"); 290 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); 291 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 292 293 EQUATIONS 294 "The flash calculation" 295 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 296 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; 297 298 "Component Molar Balance" 299 Inlet.z = OutletV.z; 300 sum(OutletL.z) = sum(OutletV.z); 301 302 "Global Molar Balance" 303 Inlet.F = OutletV.F + OutletL.F; 304 305 "Vaporization Fraction" 306 OutletV.F = Inlet.F * vfrac; 307 308 "Energy Balance" 309 Inlet.F*Inlet.h + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h; 310 311 "Thermal Equilibrium" 312 OutletV.T = OutletL.T; 313 314 "Mechanical Equilibrium" 315 OutletV.P = OutletL.P; 316 317 "Pressure Drop" 318 OutletL.P = Inlet.P  Pdrop; 319 320 "Pressure Ratio" 321 OutletL.P = Inlet.P * Pratio; 322 323 "Vapor fraction" 324 vfrac = 1; 325 end 326 327 #* 328 * Model of a Steady State flash 329 **# 330 Model flash_steady_full 331 ATTRIBUTES 332 Pallete = true; 333 Icon = "icon/Flash"; 334 Brief = "Model of a Steady State flash."; 335 Info = 336 "== Assumptions == 337 * both phases are perfectly mixed. 338 339 == Specify == 340 * the feed stream; 341 * the outlet pressure (OutletV.P); 342 * the outlet temperature OR the heat supplied. 343 "; 344 345 PARAMETERS 346 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 347 348 VARIABLES 349 in Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}"); 350 out OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}"); 351 out OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}"); 352 in InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); 353 vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi"); 354 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); 355 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 356 357 EQUATIONS 358 "The flash calculation" 359 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 360 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; 361 362 "Component Molar Balance" 363 Inlet.F*Inlet.z = OutletL.F*OutletL.z + OutletV.F*OutletV.z; 364 sum(OutletL.z) = sum(OutletV.z); 365 366 "Global Molar Balance" 367 Inlet.F = OutletV.F + OutletL.F; 368 369 "Vaporization Fraction" 370 OutletV.F = Inlet.F * vfrac; 371 372 "Energy Balance" 373 Inlet.F*Inlet.h + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h; 374 375 "Thermal Equilibrium" 376 OutletV.T = OutletL.T; 377 378 "Mechanical Equilibrium" 379 OutletV.P = OutletL.P; 380 381 "Pressure Drop" 382 OutletL.P = Inlet.P  Pdrop; 383 384 "Pressure Ratio" 385 OutletL.P = Inlet.P * Pratio; 386 end 387 388 #* 389 * Model of a Steady State flash 390 **# 391 Model flash_steady_bd 392 ATTRIBUTES 393 Pallete = true; 394 Icon = "icon/Flash"; 395 Brief = "Model of a Steady State flash."; 396 Info = 397 "== Assumptions == 398 * both phases are perfectly mixed. 399 400 == Specify == 401 * the feed stream; 402 * the outlet pressure (OutletV.P); 403 * the outlet temperature OR the heat supplied. 404 "; 405 406 PARAMETERS 407 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 408 outer NComp as Integer; 409 410 VARIABLES 411 in Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}"); 412 out OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}"); 413 out OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}"); 414 in InletQ as energy_stream (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); 415 vfrac as fraction (Brief="Vapourization fraction", Symbol="\phi"); 416 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); 417 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 418 T_dew as temperature (Brief="Dewpoint Temperature"); 419 T_bubble as temperature (Brief="Bubblepoint Temperature"); 420 x_dew(NComp) as fraction (Brief="Dewpoint liquid composition"); 421 y_bubble(NComp) as fraction (Brief="Bubblepoint Vapour composition"); 422 423 EQUATIONS 424 425 if OutletL.T > T_bubble and OutletL.T < T_dew then 426 "The flash calculation" 427 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 428 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; 429 430 "Composition constraint" 431 sum(OutletL.z) = sum(OutletV.z); 432 433 "Component Molar Balance" 434 Inlet.F*Inlet.z = OutletL.F*OutletL.z + OutletV.F*OutletV.z; 435 436 else if OutletL.T <= T_bubble then 437 "Bubblepoint result" 438 OutletL.z = Inlet.z; 439 OutletV.z = y_bubble; 440 vfrac = 0; 441 else 442 "Dewpoint result" 443 OutletL.z = x_dew; 444 OutletV.z = Inlet.z; 445 vfrac = 1; 446 end 447 end 448 449 "Dewpoint equations" 450 PP.LiquidFugacityCoefficient(T_dew, OutletL.P, x_dew)*x_dew = 451 PP.VapourFugacityCoefficient(T_dew, OutletV.P, Inlet.z)*Inlet.z; 452 sum(x_dew) = 1; 453 454 "Bubblepoint equations" 455 PP.LiquidFugacityCoefficient(T_bubble, OutletL.P, Inlet.z)*Inlet.z = 456 PP.VapourFugacityCoefficient(T_bubble, OutletV.P, y_bubble)*y_bubble; 457 sum(y_bubble) = 1; 458 459 "Global Molar Balance" 460 Inlet.F = OutletV.F + OutletL.F; 461 462 "Vaporization Fraction" 463 OutletV.F = Inlet.F * vfrac; 464 465 "Energy Balance" 466 Inlet.F*Inlet.h + InletQ.Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h; 467 468 "Thermal Equilibrium" 469 OutletV.T = OutletL.T; 470 471 "Mechanical Equilibrium" 472 OutletV.P = OutletL.P; 473 474 "Pressure Drop" 475 OutletL.P = Inlet.P  Pdrop; 476 477 "Pressure Ratio" 478 OutletL.P = Inlet.P * Pratio; 479 end 480 481 482 #* 200 483 * Model of a steadystate PH flash. 201 484 **# 
trunk/sample/stage_separators/sample_flash.mso
r633 r844 23 23 * $Id$ 24 24 **# 25 using " stage_separators/flash";25 using "flash_new"; 26 26 27 27 # exemplo baseado nos dados do artigo do Gani 1985. … … 106 106 DEVICES 107 107 fl as flash_steady; 108 # fl as FlashPHSteadyA; 109 # fl as flash_steady_full; 110 # fl as flash_steady_bd; 108 111 s1 as source; 109 112 … … 119 122 120 123 fl.OutletL.P = 2.5 * 'atm'; 121 122 #Q.OutletQ.Q = 0 * 'kJ/h';123 124 fl.OutletL.T = 315.06 * 'K'; 125 126 # fl.vfrac = 1; 127 128 # Q.OutletQ.Q = 0 * 'kJ/h'; 124 129 125 130 OPTIONS 126 131 Dynamic = false; 127 end 132 # GuessFile="flashSteady_Test"; 133 end 134 135 FlowSheet flashSteady_bubble 136 PARAMETERS 137 PP as Plugin(Brief="Physical Properties", 138 Type="PP", 139 Components = ["1,3butadiene", "isobutene", "npentane", 140 "1pentene", "1hexene", "benzene"], 141 LiquidModel = "PR", 142 VapourModel = "PR" 143 ); 144 NComp as Integer; 145 146 VARIABLES 147 Q as energy_source (Brief="Heat supplied"); 148 149 SET 150 NComp = PP.NumberOfComponents; 151 152 DEVICES 153 fl as bubble_steady; 154 s1 as source; 155 156 CONNECTIONS 157 s1.Outlet to fl.Inlet; 158 Q.OutletQ to fl.InletQ; 159 160 SPECIFY 161 s1.F = 496.3 * 'kmol/h'; 162 s1.T = 338 * 'K'; 163 s1.P = 507.1 * 'kPa'; 164 s1.Composition = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; 165 166 fl.OutletL.P = 2.5 * 'atm'; 167 # fl.OutletL.T = 315.06 * 'K'; 168 169 # Q.OutletQ.Q = 0 * 'kJ/h'; 170 171 OPTIONS 172 Dynamic = false; 173 # GuessFile="flashSteady_Test"; 174 end 175 176 FlowSheet flashSteady_dew 177 PARAMETERS 178 PP as Plugin(Brief="Physical Properties", 179 Type="PP", 180 Components = ["1,3butadiene", "isobutene", "npentane", 181 "1pentene", "1hexene", "benzene"], 182 LiquidModel = "PR", 183 VapourModel = "PR" 184 ); 185 NComp as Integer; 186 187 VARIABLES 188 Q as energy_source (Brief="Heat supplied"); 189 190 SET 191 NComp = PP.NumberOfComponents; 192 193 DEVICES 194 fl as dew_steady; 195 s1 as source; 196 197 CONNECTIONS 198 s1.Outlet to fl.Inlet; 199 Q.OutletQ to fl.InletQ; 200 201 SPECIFY 202 s1.F = 496.3 * 'kmol/h'; 203 s1.T = 338 * 'K'; 204 s1.P = 507.1 * 'kPa'; 205 s1.Composition = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; 206 207 fl.OutletL.P = 2.5 * 'atm'; 208 # fl.OutletL.T = 315.06 * 'K'; 209 210 # Q.OutletQ.Q = 0 * 'kJ/h'; 211 212 OPTIONS 213 Dynamic = false; 214 # GuessFile="flashSteady_Test"; 215 end
Note: See TracChangeset
for help on using the changeset viewer.