Changeset 848
- Timestamp:
- Oct 3, 2009, 7:15:28 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/eml/stage_separators/column.mso
r511 r848 1308 1308 1309 1309 EQUATIONS 1310 stage.deltaP = dP/NStages; 1310 #stage.deltaP = dP/NStages; 1311 dP = stage(bot).OutletL.P - stage(top).OutletL.P; 1311 1312 1312 1313 CONNECTIONS … … 1352 1353 "; 1353 1354 1354 PARAMETERS1355 VapourFlow as Switcher(Valid = ["on", "off"], Default = "on");1356 1357 1355 VARIABLES 1358 1356 cond as condenser; … … 1373 1371 1374 1372 EQUATIONS 1375 switch VapourFlow 1376 case "on": 1377 stage(bot).InletV.F*stage(bot).vV = sqrt((reb.OutletV.P - stage(bot).OutletV.P)/ 1378 (stage(bot).rhoV*stage(bot).Qsil*20))*(stage(bot).d^2*3.14159/4*stage(bot).e - stage(bot).Al); 1379 when stage(bot).InletV.F < 1e-6 * 'kmol/h' switchto "off"; 1380 1381 case "off": 1382 stage(bot).InletV.F = 0 * 'mol/s'; 1383 when reb.OutletV.P > stage(bot).OutletV.P + 1e-1 * 'atm' switchto "on"; 1384 end 1385 1386 end 1373 stage(top).InletV.F = stage(top).OutletV.F + stage(top).Inlet.F*stage(top).Inlet.v; 1374 1375 end -
trunk/eml/stage_separators/tray.mso
r706 r848 405 405 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 406 406 outer NComp as Integer; 407 PPwater as Plugin(Brief="Physical Properties",408 Type="PP",409 Components = [ "water" ],410 LiquidModel = "PR",411 VapourModel = "PR"412 );413 407 414 408 V as volume(Brief="Total Volume of the tray"); … … 419 413 g as acceleration; 420 414 e as Real (Brief="Void fraction of packing, m^3/m^3"); 421 Cpo as Real (Brief="Constant for resitance equation"); # Billet and Schultes, 1999.422 415 Mw(NComp) as molweight (Brief = "Component Mol Weight"); 423 416 hs as length (Brief="Height of the packing stage"); 424 Qsil as positive (Brief="Resistance coefficient on the liquid load", Default=1); 417 Qsil as positive (Brief="Resistance coefficient on the liquid load", Default=0.6); 418 419 VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); 425 420 426 421 VARIABLES … … 439 434 440 435 miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s'); 441 miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s');442 436 rhoL as dens_mass; 443 437 rhoV as dens_mass; 444 438 445 deltaP as pressure; 446 447 uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=100); 448 uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100); 449 dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10); 450 invK as positive (Brief="Wall factor", Default=1, Upper=10); 451 Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000); 452 Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1); 453 hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10); 454 439 deltaP as pressure(Lower=-10); 440 441 uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=0, Upper=100); 442 uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=0, Upper=100); 443 Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=10); 444 hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.04,Upper=1); 445 455 446 SET 456 447 Mw = PP.MolecularWeight(); … … 473 464 "Mol fraction normalisation" 474 465 sum(OutletL.z)= 1.0; 475 466 sum(OutletL.z)=sum(OutletV.z); 467 476 468 "Liquid Volume" 477 469 vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); … … 498 490 "Liquid viscosity" 499 491 miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z); 500 "Vapour viscosity"501 miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z);502 492 503 493 "Area occupied by the liquid" … … 507 497 uL * Al = OutletL.F * vL; 508 498 "Volume flow rate of vapor, m^3/m^2/s" 509 uV * ( (d^2*3.14159/4)*e - Al) = OutletV.F * vV;499 uV * (V*e/hs - Al) = InletV.F * vV; 510 500 511 501 "Liquid holdup" 512 hl = ML*vL/V/e; 513 514 "Particle diameter" 515 dp = 6 * (1-e)/a; 516 517 "Wall Factor" 518 invK = (1 + (2*dp/(3*d*(1-e)))); 519 520 "Reynolds number of the vapor stream" 521 Rev*invK = dp*uV*rhoV / (miV*(1-e)); 522 502 hl*V*e = ML*vL; 503 504 "Liquid velocity as a function of liquid holdup, Billet (4-27)" 505 hl^3 = (12/g) * a^2 * (miL/rhoL) * uL; 506 507 switch VapourFlow 508 case "on": 509 "Pressure drop and Vapor flow, Billet (4-58)" 510 deltaP/hs = Qsil * (a/2 + 2/d) * 1/((e-hl)^3) * (uV^2) * rhoV; 511 512 when InletV.F < 1e-6 * 'kmol/h' switchto "off"; 513 514 case "off": 515 InletV.F = 0 * 'mol/s'; 516 when deltaP > 1e-4 * 'atm' switchto "on"; 517 end 518 519 "Pressure profile" 523 520 deltaP = InletV.P - OutletV.P; 524 525 "Pressure drop and Vapor flow"526 deltaP/hs = Qsil*a*uV^2*rhoV*invK / (2*(e-hl)^3);527 528 "Liquid holdup"529 hl = (12*miL*a^2*uL/rhoL/g)^1/3;530 521 end 531 522 -
trunk/sample/stage_separators/sample_column.mso
r650 r848 505 505 end 506 506 507 # packed column section with 8 trays508 FlowSheet PackedSectionColumn509 PARAMETERS510 PP as Plugin(Brief="Physical Properties",511 Type="PP",512 Components = [ "isobutane", "n-pentane", "propylene",513 "benzene", "isobutene" ],514 LiquidModel = "PR",515 VapourModel = "PR"516 );517 NComp as Integer;518 519 SET520 NComp = PP.NumberOfComponents;521 522 DEVICES523 sec as Packed_Section_Column;524 feed as liquid_stream;525 reb as vapour_stream;526 cond as liquid_stream;527 zero as stream;528 529 CONNECTIONS530 feed to sec.stage(5).Inlet;531 zero to sec.stage([1:4]).Inlet;532 zero to sec.stage([6:sec.NStages]).Inlet;533 reb to sec.stage(8).InletV;534 cond to sec.stage(1).InletL;535 536 SPECIFY537 feed.F = 113.4 * 'kmol/h';538 feed.T = 291 * 'K';539 feed.P = 1.66 * 'atm';540 feed.z = [0.2, 0.2, 0.2, 0.2, 0.2];541 542 zero.F = 0 * 'kmol/h';543 zero.T = 300 * 'K';544 zero.P = 1 * 'atm';545 zero.z = [0.2, 0.2, 0.2, 0.2, 0.2];546 zero.v = 0;547 zero.h = 0 * 'J/mol';548 549 cond.F = 85 * 'kmol/h';550 cond.P = 2.33 * 'atm';551 cond.T = 283.5 * 'K';552 cond.z = [0.599, 0.044, 0.035, 0.007, 0.315];553 554 reb.F = 137.57 * 'kmol/h';555 reb.P = 2.46 * 'atm';556 reb.T = 325 * 'K';557 reb.z = [0.16, 0.542, 0.013, 0.008, 0.277];558 559 sec.dP = 0.008 * 'atm'; #queda de pressao na secao!560 561 SET562 sec.H = 4 * 'm';#altura do recheio563 sec.NStages = 8; #numero de estagios teoricos do recheio564 sec.stage.Q = 0 * 'kW';565 sec.stage.d = 1.009 * 'm';566 sec.stage.Cpo = 0.763;567 sec.stage.e = 0.951;568 sec.stage.a = 112.6 * 'm^2/m^3';569 sec.stage.Qsil = 0.1;#coeficiente de resistencia do recheio570 571 INITIAL572 sec.stage.OutletL.T =[283:(325-283)/(sec.NStages-1):325] *'K';573 sec.stage.ML = 0.01 * 'kmol';574 sec.stage.OutletL.z([1:4]) = [0.3, 0.2, 0.002, 0.1];575 576 OPTIONS577 DAESolver(File="dassl");578 NLASolver(File="nlasolver");579 TimeStep = 10;580 TimeEnd = 100;581 end582 583 FlowSheet Packed_kettle_cond_Test584 PARAMETERS585 PP as Plugin(Brief="Physical Properties",586 Type="PP",587 Components = [ "isobutane", "n-pentane", "propylene",588 "benzene", "isobutene" ],589 LiquidModel = "PR",590 VapourModel = "PR"591 );592 NComp as Integer;593 594 VARIABLES595 Qc as energy_source (Brief="Heat rate removed from condenser");596 Qr as energy_source (Brief="Heat rate supplied to reboiler");597 598 SET599 NComp = PP.NumberOfComponents;600 601 DEVICES602 col as PackedDistillation_kettle_cond;603 feed as source;604 zero as stream;605 606 CONNECTIONS607 feed.Outlet to col.stage(5).Inlet;608 zero to col.reb.Inlet;609 zero to col.stage([1:4]).Inlet;610 zero to col.stage([6:col.NStages]).Inlet;611 Qc.OutletQ to col.cond.InletQ;612 Qr.OutletQ to col.reb.InletQ;613 614 SPECIFY615 feed.F = 113.4 * 'kmol/h';616 feed.T = 291 * 'K';617 feed.P = 168.3 * 'kPa';618 feed.Composition = 1/NComp;619 620 zero.F = 0 * 'kmol/h';621 zero.T = 300 * 'K';622 zero.P = 1 * 'atm';623 zero.z = 1/NComp;624 zero.v = 0;625 zero.h = 0 * 'J/mol';626 627 col.sptop.Outlet2.F = 85 * 'kmol/h';628 col.reb.OutletL.F = 28.4 * 'kmol/h';629 col.sptop.frac = 0.444445;630 col.cond.OutletV.F = 0 * 'kmol/h';631 Qr.OutletQ.Q = 3.7743e6 * 'kJ/h';632 Qc.OutletQ.Q = -3.71e6 * 'kJ/h';633 col.pump1.dP = 16 * 'kPa';634 635 col.dP = 0.024 * 'atm'; #queda de pressao entre o topo e o fundo da coluna.636 637 SET638 col.H = 3.5 * 'm'; # altura de recheio639 col.NStages = 8; # numero de estagios teoricos do recheio640 col.stage.Q = 0 * 'kW';641 col.stage.d = 2.24 * 'ft';642 col.stage.Cpo = 0.763;643 col.stage.e = 0.951;644 col.stage.a = 112.6 * 'm^2/m^3';645 646 col.cond.V = 2 * 'm^3';647 col.cond.Across = 1 * 'm^2';648 col.reb.V = 2 * 'm^3';649 col.reb.Across = 1 * 'm^2';650 col.stage.Qsil = 2; # coeficiente de resistencia do recheio651 652 INITIAL653 # condenser654 col.cond.OutletL.T = 260 *'K';655 col.cond.Level = 1 * 'm';656 col.cond.OutletL.z([1:4]) = [0.65, 0.05, 0.01, 0.01];657 658 # reboiler659 col.reb.OutletL.T = 330 *'K';660 col.reb.Level = 1 * 'm';661 col.reb.OutletL.z([1:4]) = [0.1, 0.7, 0.01, 0.01];662 663 # column trays664 col.stage.OutletL.T = [290:(330-290)/(col.NStages-1):330] * 'K';665 col.stage.ML = 0.1 * 'kmol';666 col.stage.OutletL.z([1:4]) = [0.15, 0.5, 0.001, 0.1];667 668 OPTIONS669 TimeStep = 10;670 TimeEnd = 500;671 end672 673 FlowSheet PackedColumn_ctrl674 PARAMETERS675 PP as Plugin(Brief="Physical Properties",676 Type="PP",677 Components = [ "isobutane", "n-pentane", "propylene",678 "benzene", "isobutene" ],679 LiquidModel = "PR",680 VapourModel = "PR"681 );682 NComp as Integer;683 684 Qcmin as heat_rate (Brief="Minimum Condenser Heat supplied");685 Qcmax as heat_rate (Brief="Maximum Condenser Heat supplied");686 Qrmin as heat_rate (Brief="Minimum Reboiler Heat supplied");687 Qrmax as heat_rate (Brief="Maximum Reboiler Heat supplied");688 Frmin as flow_mol (Brief="Minimum bottom flow rate");689 Frmax as flow_mol (Brief="Maximum bottom flow rate");690 Fcmin as flow_mol (Brief="Minimum reflux flow rate");691 Fcmax as flow_mol (Brief="Maximum reflux flow rate");692 Hmint as length (Brief="Minimum liquid level in top tank");693 Hmaxt as length (Brief="Maximum liquid level in top tank");694 Hminb as length (Brief="Minimum liquid level in reboiler");695 Hmaxb as length (Brief="Maximum liquid level in reboiler");696 Pmax as pressure (Brief="Maximum column pressure");697 Pmin as pressure (Brief="Minimum column pressure");698 Tmax as temperature (Brief="Maximum column temperature");699 Tmin as temperature (Brief="Minimum column temperature");700 701 VARIABLES702 Qc as energy_source (Brief="Heat rate removed from condenser");703 Qr as energy_source (Brief="Heat rate supplied to reboiler");704 Had_top as Real (Brief="Dimensionless condenser level");705 Had_bot as Real (Brief="Dimensionless reboiler level");706 Pad as Real (Brief="Dimensionless pressure");707 Tad as Real (Brief="Dimensionless temperature");708 RR as positive (Brief="Reflux ratio");709 710 SET711 NComp = PP.NumberOfComponents;712 713 DEVICES714 col as PackedDistillation_kettle_cond;715 feed as source;716 zero as stream;717 TCcond as PIDIncr;718 LCtop as PIDIncr;719 LCbot as PIDIncr;720 PC as PIDIncr;721 722 CONNECTIONS723 feed.Outlet to col.stage(5).Inlet;724 zero to col.reb.Inlet;725 zero to col.stage([1:4]).Inlet;726 zero to col.stage([6:col.NStages]).Inlet;727 Qc.OutletQ to col.cond.InletQ;728 Qr.OutletQ to col.reb.InletQ;729 730 EQUATIONS731 "Temperature Controller"732 TCcond.Parameters.tau = 0*'s';733 TCcond.Parameters.tauSet = 0*'s';734 TCcond.Parameters.alpha = 0.3;735 TCcond.Parameters.bias = 0.5;736 TCcond.Parameters.gamma = 1;737 TCcond.Parameters.beta = 1;738 TCcond.Options.action = 1;739 TCcond.Options.clip = 1;740 TCcond.Options.autoMan = 0;741 TCcond.Parameters.intTime = 60*'s';742 TCcond.Parameters.gain = 0.6;743 TCcond.Parameters.derivTime = 1*'s';744 TCcond.Ports.setPoint = ((15+273.15) * 'K' - Tmin)/(Tmax-Tmin);745 TCcond.Ports.input = Tad;746 Tad = (col.cond.OutletL.T-Tmin)/(Tmax-Tmin);747 Qc.OutletQ.Q = Qcmin+(Qcmax-Qcmin)*TCcond.Ports.output;748 749 "Pressure Controller"750 PC.Parameters.tau = 0*'s';751 PC.Parameters.tauSet = 0*'s';752 PC.Parameters.alpha = 0.3;753 PC.Parameters.bias = 0;754 PC.Parameters.gamma = 1;755 PC.Parameters.beta = 1;756 PC.Options.action = -1;757 PC.Options.clip = 1;758 PC.Options.autoMan = 0;759 PC.Parameters.intTime = 50*'s';760 PC.Parameters.gain = 0.5;761 PC.Parameters.derivTime = 1*'s';762 PC.Ports.setPoint = (4.0*'bar'-Pmin)/(Pmax-Pmin);763 PC.Ports.input = Pad;764 Pad = (col.cond.OutletV.P-Pmin)/(Pmax-Pmin);765 col.cond.OutletV.F = (Fcmin+(Fcmax-Fcmin)*PC.Ports.output);766 767 "Ttop Level Controller"768 LCtop.Parameters.tau = 0*'s';769 LCtop.Parameters.tauSet = 0*'s';770 LCtop.Parameters.alpha = 0.3;771 LCtop.Parameters.bias = 0.5;772 LCtop.Parameters.gamma = 1;773 LCtop.Parameters.beta = 1;774 LCtop.Options.action = -1;775 LCtop.Options.clip = 1;776 LCtop.Options.autoMan = 0;777 LCtop.Parameters.intTime = 10*'s';778 LCtop.Parameters.gain = 1;779 LCtop.Parameters.derivTime = 0*'s';780 LCtop.Ports.setPoint = (1.0 * 'm' - Hmint)/(Hmaxt-Hmint);781 LCtop.Ports.input = Had_top;782 Had_top = (col.cond.Level-Hmint)/(Hmaxt-Hmint);783 col.sptop.Outlet1.F = Fcmin + (Fcmax-Fcmin) * LCtop.Ports.output;784 785 "Tbottom Level Controller"786 LCbot.Parameters.tau = 0*'s';787 LCbot.Parameters.tauSet = 0*'s';788 LCbot.Parameters.alpha = 0.3;789 LCbot.Parameters.bias = 0.5;790 LCbot.Parameters.gamma = 1;791 LCbot.Parameters.beta = 1;792 LCbot.Options.action = -1;793 LCbot.Options.clip = 1;794 LCbot.Options.autoMan = 0;795 LCbot.Parameters.intTime = 100*'s';796 LCbot.Parameters.gain = 1;797 LCbot.Parameters.derivTime = 0*'s';798 LCbot.Ports.setPoint = (1.0 * 'm' - Hminb)/(Hmaxb-Hminb);799 LCbot.Ports.input = Had_bot;800 Had_bot = (col.reb.Level-Hminb)/(Hmaxb-Hminb);801 col.reb.OutletL.F = Frmin + (Frmax-Frmin) * LCbot.Ports.output;802 803 RR * (col.cond.OutletV.F + col.sptop.Outlet1.F) = col.sptop.Outlet2.F;804 805 if time < 1 * 'h' then806 col.sptop.Outlet2.F = 75 * 'kmol/h'; # reflux807 else808 col.sptop.Outlet2.F = 85 * 'kmol/h'; # reflux809 end810 811 SPECIFY812 feed.F = 113.4 * 'kmol/h';813 feed.T = 291 * 'K';814 feed.P = 5 * 'bar';815 feed.Composition = 1/NComp;816 817 zero.F = 0 * 'kmol/h';818 zero.T = 300 * 'K';819 zero.P = 1 * 'atm';820 zero.z = 1/NComp;821 zero.v = 0;822 zero.h = 0 * 'J/mol';823 824 Qr.OutletQ.Q = 4e6 * 'kJ/h';825 col.pump1.dP = 16 * 'kPa';826 827 col.dP = 0.024 * 'atm'; #queda de pressao entre o topo e o fundo da coluna828 829 SET830 col.H = 3.5 * 'm'; #altura do recheio831 col.NStages = 8; #numero de estagios teoricos do recheio832 col.stage.Q = 0 * 'kW';833 col.stage.d = 2.24 * 'ft';834 col.stage.Cpo = 0.763;835 col.stage.e = 0.951;836 col.stage.a = 112.6 * 'm^2/m^3';837 838 col.cond.V = 2 * 'm^3';839 col.cond.Across = 1 * 'm^2';840 col.reb.V = 2 * 'm^3';841 col.reb.Across = 1 * 'm^2';842 843 col.stage.Qsil = 2; #coeficiente de resistencia do recheio844 845 # Controllers type846 TCcond.PID_Select = "Ideal_AW";847 PC.PID_Select = "Ideal_AW";848 LCtop.PID_Select = "Ideal_AW";849 LCbot.PID_Select = "Ideal_AW";850 851 Qrmax = 5e6 * 'kJ/h';852 Qrmin = 1e6 * 'kJ/h';853 Frmin = 0 * 'kmol/h';854 Frmax = 60 * 'kmol/h';855 Fcmin = 0 * 'kmol/h';856 Fcmax = 120 * 'kmol/h';857 Hmint = 0 * 'm';858 Hmaxt = 2 * 'm';859 Hminb = 0 * 'm';860 Hmaxb = 2 * 'm';861 Pmin = 0.5 * 'bar';862 Pmax = 6 * 'bar';863 Qcmax = -5e5 * 'kJ/h';864 Qcmin = -5e6 * 'kJ/h';865 Tmax = (30+273.15) * 'K';866 Tmin = (-20+273.15) * 'K';867 868 INITIAL869 # condenser870 col.cond.OutletL.T = 260 *'K';871 col.cond.Level = 1 * 'm';872 col.cond.OutletL.z([1:4]) = [0.2, 0.2, 0.4, 0.05];873 874 # reboiler875 col.reb.OutletL.T = 350 *'K';876 col.reb.Level = 1 * 'm';877 col.reb.OutletL.z([1:4]) = [0.1, 0.4, 0.1, 0.3];878 879 # column trays880 col.stage.OutletL.T = [290:(330-290)/(col.NStages-1):330] * 'K';881 col.stage.ML = 0.1 * 'kmol';882 col.stage.OutletL.z([1:4]) = [0.15, 0.3, 0.25, 0.2];883 884 OPTIONS885 TimeStep = 0.1;886 TimeEnd = 5;887 TimeUnit = 'h';888 InitialFile = "Packed_Column_ctrl.rlt";889 #GuessFile = "Packed_Column_ctrl.rlt";890 #Dynamic = false;891 DAESolver(File="dassl");892 end
Note: See TracChangeset
for help on using the changeset viewer.