Changeset 498
- Timestamp:
- Apr 11, 2008, 3:21:24 PM (15 years ago)
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/packed/eml/stage_separators/column.mso
r497 r498 1263 1263 1264 1264 1265 Model Section_Column_Packed1265 Model Packed_Section_Column 1266 1266 1267 1267 PARAMETERS … … 1275 1275 1276 1276 VARIABLES 1277 stage(NStages) as packedStage; #_BilletSchultes;1277 stage(NStages) as packedStage; 1278 1278 1279 1279 SET … … 1288 1288 end 1289 1289 1290 Model PackedDistillation_kettle_cond as Section_Column_Packed1290 Model PackedDistillation_kettle_cond as Packed_Section_Column 1291 1291 PARAMETERS 1292 1292 VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); -
branches/packed/eml/stage_separators/tray.mso
r497 r498 348 348 Mw(NComp) as molweight (Brief = "Component Mol Weight"); 349 349 hs as length (Brief="Height of the packing stage"); 350 Qsil as positive (Brief="Resistance coefficient on the liquid load", Default=1); 350 351 351 352 VARIABLES … … 377 378 Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1); 378 379 hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10); 379 Qsil as positive (Brief="Resistance coefficient on the liquid load");380 380 381 381 SET -
branches/packed/sample/stage_separators/sample_column.mso
r497 r498 519 519 520 520 DEVICES 521 sec as Section_Column_Packed;521 sec as Packed_Section_Column; 522 522 feed as liquid_stream; 523 523 reb as vapour_stream; … … 555 555 reb.z = [0.16, 0.542, 0.013, 0.008, 0.277]; 556 556 557 sec.stage.Qsil = 0.1;558 #sec.stage(1).OutletV.F = 150 * 'kmol/h';559 557 sec.stage.deltaP = 0.001 * 'atm'; 560 558 … … 567 565 sec.stage.e = 0.951; 568 566 sec.stage.a = 112.6 * 'm^2/m^3'; 567 sec.stage.Qsil = 0.1; 569 568 570 569 INITIAL -
branches/packed/sample/stage_separators/sample_tray.mso
r497 r498 371 371 t1.OutletV.P = 145 * 'kPa'; 372 372 #t1.OutletV.F = 190 * 'kmol/h'; 373 t1.Qsil = 10;374 373 375 374 SET 376 375 #Metal Pall Ring - nominal packing size 50 mm - Billet and Schultes, 1999. 377 376 t1.Q = 0 * 'kW'; 378 t1.Ap = 0.8 * 'm^2';379 377 t1.V = 0.8 * 'm^2' * 0.4 * 'm'; 380 t1.d s= 1.009 * 'm';378 t1.d = 1.009 * 'm'; 381 379 t1.Cpo = 0.763; 382 380 t1.e = 0.951; 383 381 t1.a = 112.6 * 'm^2/m^3'; 384 382 t1.hs = 0.4 * 'm'; 383 t1.Qsil = 10; 385 384 386 385 INITIAL … … 447 446 t1.deltaP = 0.01 * 'atm'; 448 447 #t1.OutletV.F = 165 * 'kmol/h'; 449 t1.Qsil = 10;450 448 451 449 SET … … 461 459 462 460 t1.V = 4 * 'ft^2' * 1 * 'ft'; 463 t1.Ap = 4 * 'ft^2';464 461 t1.hs = 1 * 'ft'; 465 t1.ds = 2.26 * 'ft'; 462 t1.d = 2.26 * 'ft'; 463 t1.Qsil = 10; 466 464 467 465 INITIAL -
trunk/eml/stage_separators/column.mso
r398 r498 1261 1261 1262 1262 end 1263 1264 #*---------------------------------------------------------------------- 1265 * Model of a packed column section with: 1266 * - NStages = theoretical number of equilibrium stages. 1267 * 1268 *---------------------------------------------------------------------*# 1269 Model Packed_Section_Column 1270 ATTRIBUTES 1271 Pallete = true; 1272 Icon = "icon/SectionColumn"; 1273 Brief = "Model of a packed column section."; 1274 Info = 1275 "== Model of a packed column section containing == 1276 * NStages theoretical stages. 1277 1278 == Specify == 1279 * the feed stream of each tray (Inlet); 1280 * the InletL stream of the top tray; 1281 * the InletV stream of the bottom tray; 1282 * the pressure drop (deltaP) of each tray. 1283 1284 == Initial Conditions == 1285 * the stages temperature (OutletL.T); 1286 * the stages liquid holdup; 1287 * (NoComps - 1) OutletL (OR OutletV) compositions for each tray. 1288 "; 1289 1290 PARAMETERS 1291 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 1292 outer NComp as Integer; 1293 NStages as Integer(Brief="Number of trays", Default=2); 1294 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); 1295 top as Integer(Brief="Number of top tray"); 1296 bot as Integer(Brief="Number of bottom tray"); 1297 H as length (Brief="Height of packing"); 1298 1299 VARIABLES 1300 stage(NStages) as packedStage; 1301 1302 SET 1303 top = (NStages-1)*(1-topdown)/2+1; 1304 bot = NStages/top; 1305 stage.hs = H/NStages; 1306 stage.V = stage.hs * stage.d^2*3.14159/4; 1307 1308 CONNECTIONS 1309 stage([top+topdown:topdown:bot]).OutletV to stage([top:topdown:bot-topdown]).InletV; 1310 stage([top:topdown:bot-topdown]).OutletL to stage([top+topdown:topdown:bot]).InletL; 1311 end 1312 1313 #*---------------------------------------------------------------------- 1314 * Model of a packed distillation column containing: 1315 * - a section with NStages theoretical stages; 1316 * - a kettle reboiler; 1317 * - dymamic condenser; 1318 * - a splitter which separate reflux and distillate; 1319 * - a pump in reflux stream; 1320 *---------------------------------------------------------------------*# 1321 Model PackedDistillation_kettle_cond as Packed_Section_Column 1322 PARAMETERS 1323 VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); 1324 1325 VARIABLES 1326 cond as condenser; 1327 reb as reboiler; 1328 sptop as splitter; 1329 pump1 as pump; 1330 1331 CONNECTIONS 1332 #vapor 1333 reb.OutletV to stage(bot).InletV; 1334 stage(top).OutletV to cond.InletV; 1335 1336 #liquid 1337 cond.OutletL to sptop.Inlet; 1338 sptop.Outlet2 to pump1.Inlet; 1339 pump1.Outlet to stage(top).InletL; 1340 stage(bot).OutletL to reb.InletL; 1341 1342 EQUATIONS 1343 switch VapourFlow 1344 case "on": 1345 stage(bot).InletV.F*stage(bot).vV = sqrt((reb.OutletV.P - stage(bot).OutletV.P)/ 1346 (stage(bot).rhoV*stage(bot).Qsil*20))*(stage(bot).d^2*3.14159/4*stage(bot).e - stage(bot).Al); 1347 when stage(bot).InletV.F < 1e-6 * 'kmol/h' switchto "off"; 1348 1349 case "off": 1350 stage(bot).InletV.F = 0 * 'mol/s'; 1351 when reb.OutletV.P > stage(bot).OutletV.P + 1e-1 * 'atm' switchto "on"; 1352 end 1353 1354 end -
trunk/eml/stage_separators/tray.mso
r398 r498 323 323 V = ML* vL + MV*vV; 324 324 end 325 326 #*------------------------------------- 327 * Model of a packed column stage 328 -------------------------------------*# 329 Model packedStage 330 ATTRIBUTES 331 Pallete = false; 332 Icon = "icon/Tray"; 333 Brief = "Complete model of a packed column stage."; 334 Info = 335 "== Specify == 336 * the Feed stream 337 * the Liquid inlet stream 338 * the Vapour inlet stream 339 * the stage pressure drop (deltaP) 340 341 == Initial == 342 * the plate temperature (OutletL.T) 343 * the liquid molar holdup ML 344 * (NoComps - 1) OutletL compositions 345 "; 346 347 PARAMETERS 348 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 349 outer NComp as Integer; 350 PPwater as Plugin(Brief="Physical Properties", 351 Type="PP", 352 Components = [ "water" ], 353 LiquidModel = "PR", 354 VapourModel = "PR" 355 ); 356 357 V as volume(Brief="Total Volume of the tray"); 358 Q as heat_rate (Brief="Rate of heat supply"); 359 d as length (Brief="Column diameter"); 360 361 a as Real (Brief="surface area per packing volume", Unit='m^2/m^3'); 362 g as acceleration; 363 e as Real (Brief="Void fraction of packing, m^3/m^3"); 364 Cpo as Real (Brief="Constant for resitance equation"); # Billet and Schultes, 1999. 365 Mw(NComp) as molweight (Brief = "Component Mol Weight"); 366 hs as length (Brief="Height of the packing stage"); 367 Qsil as positive (Brief="Resistance coefficient on the liquid load", Default=1); 368 369 VARIABLES 370 in Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}"); 371 in InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}"); 372 in InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}"); 373 out OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}"); 374 out OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}"); 375 376 M(NComp) as mol (Brief="Molar Holdup in the tray", Default=0.01, Lower=0, Upper=100); 377 ML as mol (Brief="Molar liquid holdup", Default=0.01, Lower=0, Upper=100); 378 MV as mol (Brief="Molar vapour holdup", Default=0.01, Lower=0, Upper=100); 379 E as energy (Brief="Total Energy Holdup on tray", Default=-500); 380 vL as volume_mol (Brief="Liquid Molar Volume"); 381 vV as volume_mol (Brief="Vapour Molar volume"); 382 383 miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s'); 384 miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s'); 385 rhoL as dens_mass; 386 rhoV as dens_mass; 387 388 deltaP as pressure; 389 390 uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=100); 391 uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100); 392 dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10); 393 invK as positive (Brief="Wall factor", Default=1, Upper=10); 394 Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000); 395 Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1); 396 hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10); 397 398 SET 399 Mw = PP.MolecularWeight(); 400 401 EQUATIONS 402 "Component Molar Balance" 403 diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z 404 - OutletL.F*OutletL.z - OutletV.F*OutletV.z; 405 406 "Energy Balance" 407 diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h 408 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ); 409 410 "Molar Holdup" 411 M = ML*OutletL.z + MV*OutletV.z; 412 413 "Energy Holdup" 414 E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V; 415 416 "Mol fraction normalisation" 417 sum(OutletL.z)= 1.0; 418 419 "Liquid Volume" 420 vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); 421 "Vapour Volume" 422 vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); 423 424 "Chemical Equilibrium" 425 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 426 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; 427 428 "Thermal Equilibrium" 429 OutletV.T = OutletL.T; 430 431 "Mechanical Equilibrium" 432 OutletL.P = OutletV.P; 433 434 "Geometry Constraint" 435 V*e = ML*vL + MV*vV; 436 437 "Liquid Density" 438 rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); 439 "Vapour Density" 440 rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); 441 "Liquid viscosity" 442 miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z); 443 "Vapour viscosity" 444 miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z); 445 446 "Area occupied by the liquid" 447 Al = ML*vL/hs; 448 449 "Volume flow rate of liquid, m^3/m^2/s" 450 uL * Al = OutletL.F * vL; 451 "Volume flow rate of vapor, m^3/m^2/s" 452 uV * ((d^2*3.14159/4)*e - Al) = OutletV.F * vV; 453 454 "Liquid holdup" 455 hl = ML*vL/V/e; 456 457 "Particle diameter" 458 dp = 6 * (1-e)/a; 459 460 "Wall Factor" 461 invK = (1 + (2*dp/(3*d*(1-e)))); 462 463 "Reynolds number of the vapor stream" 464 Rev*invK = dp*uV*rhoV / (miV*(1-e)); 465 466 deltaP = InletV.P - OutletV.P; 467 468 "Pressure drop and Vapor flow" 469 deltaP/hs = Qsil*a*uV^2*rhoV*invK / (2*(e-hl)^3); 470 471 "Liquid holdup" 472 hl = (12*miL*a^2*uL/rhoL/g)^1/3; 473 end -
trunk/sample/stage_separators/sample_column.mso
r398 r498 503 503 end 504 504 505 505 # packed column section with 8 trays 506 FlowSheet PackedSectionColumn 507 PARAMETERS 508 PP as Plugin(Brief="Physical Properties", 509 Type="PP", 510 Components = [ "isobutane", "n-pentane", "propylene", 511 "benzene", "isobutene" ], 512 LiquidModel = "PR", 513 VapourModel = "PR" 514 ); 515 NComp as Integer; 516 517 SET 518 NComp = PP.NumberOfComponents; 519 520 DEVICES 521 sec as Packed_Section_Column; 522 feed as liquid_stream; 523 reb as vapour_stream; 524 cond as liquid_stream; 525 zero as stream; 526 527 CONNECTIONS 528 feed to sec.stage(5).Inlet; 529 zero to sec.stage([1:4]).Inlet; 530 zero to sec.stage([6:sec.NStages]).Inlet; 531 reb to sec.stage(8).InletV; 532 cond to sec.stage(1).InletL; 533 534 SPECIFY 535 feed.F = 113.4 * 'kmol/h'; 536 feed.T = 291 * 'K'; 537 feed.P = 1.66 * 'atm'; 538 feed.z = [0.2, 0.2, 0.2, 0.2, 0.2]; 539 540 zero.F = 0 * 'kmol/h'; 541 zero.T = 300 * 'K'; 542 zero.P = 1 * 'atm'; 543 zero.z = [0.2, 0.2, 0.2, 0.2, 0.2]; 544 zero.v = 0; 545 zero.h = 0 * 'J/mol'; 546 547 cond.F = 85 * 'kmol/h'; 548 cond.P = 2.33 * 'atm'; 549 cond.T = 283.5 * 'K'; 550 cond.z = [0.599, 0.044, 0.035, 0.007, 0.315]; 551 552 reb.F = 137.57 * 'kmol/h'; 553 reb.P = 2.46 * 'atm'; 554 reb.T = 325 * 'K'; 555 reb.z = [0.16, 0.542, 0.013, 0.008, 0.277]; 556 557 sec.stage.deltaP = 0.001 * 'atm'; 558 559 SET 560 sec.H = 4 * 'm'; 561 sec.NStages = 8; 562 sec.stage.Q = 0 * 'kW'; 563 sec.stage.d = 1.009 * 'm'; 564 sec.stage.Cpo = 0.763; 565 sec.stage.e = 0.951; 566 sec.stage.a = 112.6 * 'm^2/m^3'; 567 sec.stage.Qsil = 0.1; 568 569 INITIAL 570 sec.stage.OutletL.T =[283:(325-283)/(sec.NStages-1):325] *'K'; 571 sec.stage.ML = 0.01 * 'kmol'; 572 sec.stage.OutletL.z([1:4]) = [0.3, 0.2, 0.002, 0.1]; 573 574 OPTIONS 575 DAESolver(File="dassl"); 576 NLASolver(File="nlasolver"); 577 TimeStep = 10; 578 TimeEnd = 100; 579 end 580 581 FlowSheet Packed_kettle_cond_Test 582 PARAMETERS 583 PP as Plugin(Brief="Physical Properties", 584 Type="PP", 585 Components = [ "isobutane", "n-pentane", "propylene", 586 "benzene", "isobutene" ], 587 LiquidModel = "PR", 588 VapourModel = "PR" 589 ); 590 NComp as Integer; 591 592 VARIABLES 593 Qc as energy_source (Brief="Heat rate removed from condenser"); 594 Qr as energy_source (Brief="Heat rate supplied to reboiler"); 595 596 SET 597 NComp = PP.NumberOfComponents; 598 599 DEVICES 600 col as PackedDistillation_kettle_cond; 601 feed as source; 602 zero as stream; 603 604 CONNECTIONS 605 feed.Outlet to col.stage(5).Inlet; 606 zero to col.reb.Inlet; 607 zero to col.stage([1:4]).Inlet; 608 zero to col.stage([6:col.NStages]).Inlet; 609 Qc.OutletQ to col.cond.InletQ; 610 Qr.OutletQ to col.reb.InletQ; 611 612 SPECIFY 613 feed.Outlet.F = 113.4 * 'kmol/h'; 614 feed.Outlet.T = 291 * 'K'; 615 feed.Outlet.P = 168.3 * 'kPa'; 616 feed.Outlet.z = 1/NComp; 617 618 zero.F = 0 * 'kmol/h'; 619 zero.T = 300 * 'K'; 620 zero.P = 1 * 'atm'; 621 zero.z = 1/NComp; 622 zero.v = 0; 623 zero.h = 0 * 'J/mol'; 624 625 col.sptop.Outlet2.F = 85 * 'kmol/h'; 626 col.reb.OutletL.F = 28.4 * 'kmol/h'; 627 col.sptop.frac = 0.444445; 628 col.cond.OutletV.F = 0 * 'kmol/h'; 629 Qr.OutletQ.Q = 3.7743e6 * 'kJ/h'; 630 Qc.OutletQ.Q = -3.71e6 * 'kJ/h'; 631 col.pump1.dP = 16 * 'kPa'; 632 633 col.stage.deltaP = 0.003 * 'atm'; 634 635 SET 636 col.H = 3.5 * 'm'; 637 col.NStages = 8; 638 col.stage.Q = 0 * 'kW'; 639 col.stage.d = 2.24 * 'ft'; 640 col.stage.Cpo = 0.763; 641 col.stage.e = 0.951; 642 col.stage.a = 112.6 * 'm^2/m^3'; 643 644 col.cond.V = 2 * 'm^3'; 645 col.cond.Across = 1 * 'm^2'; 646 col.reb.V = 2 * 'm^3'; 647 col.reb.Across = 1 * 'm^2'; 648 col.stage.Qsil = 2; 649 650 INITIAL 651 # condenser 652 col.cond.OutletL.T = 260 *'K'; 653 col.cond.Level = 1 * 'm'; 654 col.cond.OutletL.z([1:4]) = [0.65, 0.05, 0.01, 0.01]; 655 656 # reboiler 657 col.reb.OutletL.T = 330 *'K'; 658 col.reb.Level = 1 * 'm'; 659 col.reb.OutletL.z([1:4]) = [0.1, 0.7, 0.01, 0.01]; 660 661 # column trays 662 col.stage.OutletL.T = [290:(330-290)/(col.NStages-1):330] * 'K'; 663 col.stage.ML = 0.1 * 'kmol'; 664 col.stage.OutletL.z([1:4]) = [0.15, 0.5, 0.001, 0.1]; 665 666 OPTIONS 667 TimeStep = 10; 668 TimeEnd = 500; 669 end 670 671 FlowSheet PackedColumn_ctrl 672 PARAMETERS 673 PP as Plugin(Brief="Physical Properties", 674 Type="PP", 675 Components = [ "isobutane", "n-pentane", "propylene", 676 "benzene", "isobutene" ], 677 LiquidModel = "PR", 678 VapourModel = "PR" 679 ); 680 NComp as Integer; 681 682 Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied"); 683 Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied"); 684 Qrmin as heat_rate (Brief="Minimum Reboiler Heat supplied"); 685 Qrmax as heat_rate (Brief="Maximum Reboiler Heat supplied"); 686 Frmin as flow_mol (Brief="Minimum bottom flow rate"); 687 Frmax as flow_mol (Brief="Maximum bottom flow rate"); 688 Fcmin as flow_mol (Brief="Minimum reflux flow rate"); 689 Fcmax as flow_mol (Brief="Maximum reflux flow rate"); 690 Hmint as length (Brief="Minimum liquid level in top tank"); 691 Hmaxt as length (Brief="Maximum liquid level in top tank"); 692 Hminb as length (Brief="Minimum liquid level in reboiler"); 693 Hmaxb as length (Brief="Maximum liquid level in reboiler"); 694 Pmax as pressure (Brief="Maximum column pressure"); 695 Pmin as pressure (Brief="Minimum column pressure"); 696 Tmax as temperature (Brief="Maximum column temperature"); 697 Tmin as temperature (Brief="Minimum column temperature"); 698 699 VARIABLES 700 Qc as energy_source (Brief="Heat rate removed from condenser"); 701 Qr as energy_source (Brief="Heat rate supplied to reboiler"); 702 Had_top as Real (Brief="Dimensionless condenser level"); 703 Had_bot as Real (Brief="Dimensionless reboiler level"); 704 Pad as Real (Brief="Dimensionless pressure"); 705 Tad as Real (Brief="Dimensionless temperature"); 706 RR as positive (Brief="Reflux ratio"); 707 708 SET 709 NComp = PP.NumberOfComponents; 710 711 DEVICES 712 col as PackedDistillation_kettle_cond; 713 feed as source; 714 zero as stream; 715 TCcond as PIDIncr; 716 LCtop as PIDIncr; 717 LCbot as PIDIncr; 718 PC as PIDIncr; 719 720 CONNECTIONS 721 feed.Outlet to col.stage(5).Inlet; 722 zero to col.reb.Inlet; 723 zero to col.stage([1:4]).Inlet; 724 zero to col.stage([6:col.NStages]).Inlet; 725 Qc.OutletQ to col.cond.InletQ; 726 Qr.OutletQ to col.reb.InletQ; 727 728 EQUATIONS 729 "Temperature Controller" 730 TCcond.Parameters.tau = 0*'s'; 731 TCcond.Parameters.tauSet = 0*'s'; 732 TCcond.Parameters.alpha = 0.3; 733 TCcond.Parameters.bias = 0.5; 734 TCcond.Parameters.gamma = 1; 735 TCcond.Parameters.beta = 1; 736 TCcond.Options.action = 1; 737 TCcond.Options.clip = 1; 738 TCcond.Options.autoMan = 0; 739 TCcond.Parameters.intTime = 60*'s'; 740 TCcond.Parameters.gain = 0.6; 741 TCcond.Parameters.derivTime = 1*'s'; 742 TCcond.Ports.setPoint = ((15+273.15) * 'K' - Tmin)/(Tmax-Tmin); 743 TCcond.Ports.input = Tad; 744 Tad = (col.cond.OutletL.T-Tmin)/(Tmax-Tmin); 745 Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*TCcond.Ports.output; 746 747 "Pressure Controller" 748 PC.Parameters.tau = 0*'s'; 749 PC.Parameters.tauSet = 0*'s'; 750 PC.Parameters.alpha = 0.3; 751 PC.Parameters.bias = 0; 752 PC.Parameters.gamma = 1; 753 PC.Parameters.beta = 1; 754 PC.Options.action = -1; 755 PC.Options.clip = 1; 756 PC.Options.autoMan = 0; 757 PC.Parameters.intTime = 50*'s'; 758 PC.Parameters.gain = 0.5; 759 PC.Parameters.derivTime = 1*'s'; 760 PC.Ports.setPoint = (4.0*'bar'-Pmin)/(Pmax-Pmin); 761 PC.Ports.input = Pad; 762 Pad = (col.cond.OutletV.P-Pmin)/(Pmax-Pmin); 763 col.cond.OutletV.F = (Fcmin+(Fcmax-Fcmin)*PC.Ports.output); 764 765 "Ttop Level Controller" 766 LCtop.Parameters.tau = 0*'s'; 767 LCtop.Parameters.tauSet = 0*'s'; 768 LCtop.Parameters.alpha = 0.3; 769 LCtop.Parameters.bias = 0.5; 770 LCtop.Parameters.gamma = 1; 771 LCtop.Parameters.beta = 1; 772 LCtop.Options.action = -1; 773 LCtop.Options.clip = 1; 774 LCtop.Options.autoMan = 0; 775 LCtop.Parameters.intTime = 10*'s'; 776 LCtop.Parameters.gain = 1; 777 LCtop.Parameters.derivTime = 0*'s'; 778 LCtop.Ports.setPoint = (1.0 * 'm' - Hmint)/(Hmaxt-Hmint); 779 LCtop.Ports.input = Had_top; 780 Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint); 781 col.sptop.Outlet1.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output; 782 783 "Tbottom Level Controller" 784 LCbot.Parameters.tau = 0*'s'; 785 LCbot.Parameters.tauSet = 0*'s'; 786 LCbot.Parameters.alpha = 0.3; 787 LCbot.Parameters.bias = 0.5; 788 LCbot.Parameters.gamma = 1; 789 LCbot.Parameters.beta = 1; 790 LCbot.Options.action = -1; 791 LCbot.Options.clip = 1; 792 LCbot.Options.autoMan = 0; 793 LCbot.Parameters.intTime = 100*'s'; 794 LCbot.Parameters.gain = 1; 795 LCbot.Parameters.derivTime = 0*'s'; 796 LCbot.Ports.setPoint = (1.0 * 'm' - Hminb)/(Hmaxb-Hminb); 797 LCbot.Ports.input = Had_bot; 798 Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb); 799 col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output; 800 801 RR * (col.cond.OutletV.F + col.sptop.Outlet1.F) = col.sptop.Outlet2.F; 802 803 if time < 1 * 'h' then 804 col.sptop.Outlet2.F = 75 * 'kmol/h'; # reflux 805 else 806 col.sptop.Outlet2.F = 85 * 'kmol/h'; # reflux 807 end 808 809 SPECIFY 810 feed.Outlet.F = 113.4 * 'kmol/h'; 811 feed.Outlet.T = 291 * 'K'; 812 feed.Outlet.P = 5 * 'bar'; 813 feed.Outlet.z = 1/NComp; 814 815 zero.F = 0 * 'kmol/h'; 816 zero.T = 300 * 'K'; 817 zero.P = 1 * 'atm'; 818 zero.z = 1/NComp; 819 zero.v = 0; 820 zero.h = 0 * 'J/mol'; 821 822 Qr.OutletQ.Q = 4e6 * 'kJ/h'; 823 col.pump1.dP = 16 * 'kPa'; 824 825 col.stage.deltaP = 0.003 * 'atm'; 826 827 SET 828 col.H = 3.5 * 'm'; 829 col.NStages = 8; 830 col.stage.Q = 0 * 'kW'; 831 col.stage.d = 2.24 * 'ft'; 832 col.stage.Cpo = 0.763; 833 col.stage.e = 0.951; 834 col.stage.a = 112.6 * 'm^2/m^3'; 835 836 col.cond.V = 2 * 'm^3'; 837 col.cond.Across = 1 * 'm^2'; 838 col.reb.V = 2 * 'm^3'; 839 col.reb.Across = 1 * 'm^2'; 840 841 col.stage.Qsil = 2; 842 843 # Controllers type 844 TCcond.PID_Select = "Ideal_AW"; 845 PC.PID_Select = "Ideal_AW"; 846 LCtop.PID_Select = "Ideal_AW"; 847 LCbot.PID_Select = "Ideal_AW"; 848 849 Qrmax = 5e6 * 'kJ/h'; 850 Qrmin = 1e6 * 'kJ/h'; 851 Frmin = 0 * 'kmol/h'; 852 Frmax = 60 * 'kmol/h'; 853 Fcmin = 0 * 'kmol/h'; 854 Fcmax = 120 * 'kmol/h'; 855 Hmint = 0 * 'm'; 856 Hmaxt = 2 * 'm'; 857 Hminb = 0 * 'm'; 858 Hmaxb = 2 * 'm'; 859 Pmin = 0.5 * 'bar'; 860 Pmax = 6 * 'bar'; 861 Qcmax = -5e5 * 'kJ/h'; 862 Qcmin = -5e6 * 'kJ/h'; 863 Tmax = (30+273.15) * 'K'; 864 Tmin = (-20+273.15) * 'K'; 865 866 INITIAL 867 # condenser 868 col.cond.OutletL.T = 260 *'K'; 869 col.cond.Level = 1 * 'm'; 870 col.cond.OutletL.z([1:4]) = [0.2, 0.2, 0.4, 0.05]; 871 872 # reboiler 873 col.reb.OutletL.T = 350 *'K'; 874 col.reb.Level = 1 * 'm'; 875 col.reb.OutletL.z([1:4]) = [0.1, 0.4, 0.1, 0.3]; 876 877 # column trays 878 col.stage.OutletL.T = [290:(330-290)/(col.NStages-1):330] * 'K'; 879 col.stage.ML = 0.1 * 'kmol'; 880 col.stage.OutletL.z([1:4]) = [0.15, 0.3, 0.25, 0.2]; 881 882 OPTIONS 883 TimeStep = 0.1; 884 TimeEnd = 5; 885 TimeUnit = 'h'; 886 end -
trunk/sample/stage_separators/sample_tray.mso
r423 r498 85 85 TimeEnd = 100; 86 86 end 87 88 FlowSheet packedStage_Test_1 89 PARAMETERS 90 PP as Plugin(Brief="Physical Properties", 91 Type="PP", 92 Components = [ "n-pentane", "benzene"], 93 LiquidModel = "PR", 94 VapourModel = "PR" 95 ); 96 NComp as Integer; 97 98 SET 99 NComp = PP.NumberOfComponents; 100 101 DEVICES 102 t1 as packedStage; 103 feed as source; 104 inL as liquid_stream; 105 inV as vapour_stream; 106 107 CONNECTIONS 108 feed.Outlet to t1.Inlet; 109 inL to t1.InletL; 110 inV to t1.InletV; 111 112 SPECIFY 113 feed.Outlet.F = 113.4 * 'kmol/h'; 114 feed.Outlet.T = 291 * 'K'; 115 feed.Outlet.P = 1.66 * 'atm'; 116 feed.Outlet.z = [0.5, 0.5]; 117 118 inL.P = 165 * 'kPa'; 119 inL.T = 315 * 'K'; 120 inL.F = 61.99 * 'kmol/h'; 121 inL.z = [0.1641, 0.8359]; 122 123 inV.F = 201.25 * 'kmol/h'; 124 inV.P = 150 * 'kPa'; 125 inV.T = 315 * 'K'; 126 inV.z = [0.0584, 0.9416]; 127 128 t1.OutletV.P = 145 * 'kPa'; 129 130 SET 131 #Metal Pall Ring - nominal packing size 50 mm - Billet and Schultes, 1999. 132 t1.Q = 0 * 'kW'; 133 t1.V = 0.8 * 'm^2' * 0.4 * 'm'; 134 t1.d = 1.009 * 'm'; 135 t1.Cpo = 0.763; 136 t1.e = 0.951; 137 t1.a = 112.6 * 'm^2/m^3'; 138 t1.hs = 0.4 * 'm'; 139 t1.Qsil = 10; 140 141 INITIAL 142 t1.OutletL.T = 315 *'K'; 143 t1.ML = 0.25 * 'kmol'; 144 t1.OutletL.z(1) = 0.1641; 145 146 OPTIONS 147 DAESolver(File="sundials"); 148 TimeStep = 0.001; 149 TimeEnd = 0.1; 150 end 151 152 FlowSheet packedStage_Test_2 153 PARAMETERS 154 PP as Plugin(Brief="Physical Properties", 155 Type="PP", 156 Components = [ "isobutane", "n-pentane", "propylene", 157 "benzene", "isobutene" ], 158 LiquidModel = "PR", 159 VapourModel = "PR" 160 ); 161 NComp as Integer; 162 163 SET 164 NComp = PP.NumberOfComponents; 165 166 DEVICES 167 t1 as packedStage; 168 feed as source; 169 inL as liquid_stream; 170 inV as vapour_stream; 171 172 CONNECTIONS 173 feed.Outlet to t1.Inlet; 174 inL to t1.InletL; 175 inV to t1.InletV; 176 177 SPECIFY 178 feed.Outlet.F = 0 * 'kmol/h'; 179 feed.Outlet.T = 300 * 'K'; 180 feed.Outlet.P = 1.66 * 'atm'; 181 feed.Outlet.z = [0.226, 0.425, 0.035, 0.025, 0.289]; 182 183 inL.F = 71.21 * 'kmol/h'; 184 inL.P = 2.22 * 'atm'; 185 inL.T = 297.6 * 'K'; 186 inL.z = [0.226, 0.425, 0.035, 0.025, 0.289]; 187 188 inV.F = 175.3 * 'kmol/h'; 189 inV.P = 2.3062 * 'atm'; 190 inV.T = 308.3 * 'K'; 191 inV.z = [0.265, 0.233, 0.150, 0.014, 0.338]; 192 193 t1.deltaP = 0.01 * 'atm'; 194 195 SET 196 #Metal Pall Ring - nominal packing size 50 mm - Billet and Schultes, 1999. 197 t1.Q = 0 * 'kW'; 198 t1.Cpo = 0.763; 199 t1.e = 0.951; 200 t1.a = 112.6 * 'm^2/m^3'; 201 202 t1.V = 4 * 'ft^2' * 1 * 'ft'; 203 t1.hs = 1 * 'ft'; 204 t1.d = 2.26 * 'ft'; 205 t1.Qsil = 10; 206 207 INITIAL 208 t1.OutletL.T = 290 *'K'; 209 t1.ML = 0.02 * 'kmol'; 210 t1.OutletL.z([1:4]) = [0.226, 0.425, 0.035, 0.025]; 211 212 OPTIONS 213 DAESolver(File="sundials"); 214 TimeStep = 10; 215 TimeEnd = 100; 216 end
Note: See TracChangeset
for help on using the changeset viewer.