 Timestamp:
 Nov 17, 2009, 4:46:38 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/gui/eml/stage_separators/condenser.mso
r893 r899 1 <<<<<<< .mine2 1 #* 3 2 * EMSO Model Library (EML) Copyright (C) 2004  2007 ALSOC. … … 437 436 Brief = "Model of a Steady State total condenser with specified temperature outlet conditions."; 438 437 Info = 439 "A simple model of a simpleSteady State total condenser with specified temperature (or subcooling degree), with a real438 "A simple model of a Steady State total condenser with specified temperature (or subcooling degree), with a real 440 439 calculation of the output stream enthalpy. 441 440 442 441 == ASSUMPTIONS == 443 442 * perfect mixing of both phases; 444 * saturated vapour at the Inlet. 445 * no thermodynamics equilibrium. 446 447 == SET == 448 * the fake Outlet temperature ; 449 * the pressure drop in the condenser; 443 * saturated vapour at the Inlet; 444 * no thermodynamics equilibrium; 445 * no pressure drop in the condenser. 450 446 451 447 == SPECIFY == … … 453 449 * the subcooled temperature OR the the degree of subcooling. 454 450 455 == OPTIONAL ==456 * the condenser model has two control ports457 ** TI OutletLiquid Temperature Indicator;458 ** PI OutletLiquid Pressure Indicator;459 451 "; 460 452 … … 463 455 outer NComp as Integer (Brief = "Number of Components"); 464 456 465 Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P");457 # Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P"); 466 458 #Fake_Temperature as temperature (Brief="Fake temperature", Symbol = "T_{fake}"); 467 459 … … 472 464 #in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true); 473 465 T_sub as temperature (Brief="Condensate temperature (subcooled)", Symbol = "T_{sub}"); 474 #SubcoolingDegree as temp_delta (Brief="Subcooling Degree", Symbol = "\Delta _{sub}");466 SubcoolingDegree as temp_delta (Brief="Subcooling Degree", Symbol = "\Delta _{sub}"); 475 467 CondenserDuty as power (Brief="Calculated condenser duty for desired subcooling", Protected = true, Symbol = "Q_{cond}"); 476 468 477 out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0);478 out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0);469 #out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0); 470 #out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0); 479 471 480 472 EQUATIONS … … 490 482 491 483 "Pressure Drop" 492 OutletLiquid.P = InletVapour.P  Pdrop;484 OutletLiquid.P = InletVapour.P; 493 485 494 486 "Subcooled Temperature" 495 487 OutletLiquid.T = T_sub; 496 488 497 #"Degree of subcooling"498 #SubcoolingDegree = InletVapour.T  T_sub;489 "Degree of subcooling" 490 SubcoolingDegree = InletVapour.T  T_sub; 499 491 500 492 "Liquid enthalpy" … … 506 498 "Vapourisation Fraction" 507 499 OutletLiquid.v = 0; 508 509 "Temperature indicator"510 TI * 'K' = OutletLiquid.T;511 512 "Pressure indicator"513 PI * 'atm' = OutletLiquid.P;514 500 515 501 end 516 502 517 518 =======519 #*520 * EMSO Model Library (EML) Copyright (C) 2004  2007 ALSOC.521 *522 * This LIBRARY is free software; you can distribute it and/or modify523 * it under the therms of the ALSOC FREE LICENSE as available at524 * http://www.enq.ufrgs.br/alsoc.525 *526 * EMSO Copyright (C) 2004  2007 ALSOC, original code527 * from http://www.rps.eng.br Copyright (C) 20022004.528 * All rights reserved.529 *530 * EMSO is distributed under the therms of the ALSOC LICENSE as531 * available at http://www.enq.ufrgs.br/alsoc.532 *533 *534 * Author: Paula B. Staudt535 * $Id: condenser.mso 555 20080718 19:01:13Z rafael $536 **#537 538 using "tank";539 540 Model condenserSteady541 542 ATTRIBUTES543 Pallete = true;544 Icon = "icon/CondenserSteady";545 Brief = "Model of a Steady State condenser with no thermodynamics equilibrium.";546 Info =547 "== ASSUMPTIONS ==548 * perfect mixing of both phases;549 * no thermodynamics equilibrium.550 551 == SET ==552 * the pressure drop in the condenser;553 554 == SPECIFY ==555 * the InletVapour stream;556 * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model).557 558 == OPTIONAL ==559 * the condenser model has two control ports560 ** TI OutletLiquid Temperature Indicator;561 ** PI OutletLiquid Pressure Indicator;562 ";563 564 PARAMETERS565 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");566 outer NComp as Integer (Brief = "Number of Components");567 568 Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P");569 570 VARIABLES571 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.16, PosY=0, Symbol="_{in}^{Vapour}");572 out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}");573 in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true);574 575 Tbubble as temperature (Brief ="Bubble Temperature",Protected=true, Symbol ="T_{bubble}");576 Deg_Subcooled as temp_delta (Brief ="Degrees subcooled",Symbol ="\Delta T_{subcooled}");577 578 out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0);579 out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0);580 581 EQUATIONS582 583 "Molar Flow Balance"584 InletVapour.F = OutletLiquid.F;585 586 "Molar Composition Balance"587 InletVapour.z = OutletLiquid.z;588 589 "Energy Balance"590 InletVapour.F*InletVapour.h + InletQ = OutletLiquid.F*OutletLiquid.h;591 592 "Pressure Drop"593 OutletLiquid.P = InletVapour.P  Pdrop;594 595 "Bubble Temperature"596 Tbubble = PP.BubbleT(OutletLiquid.P,OutletLiquid.z);597 598 "Temperature"599 OutletLiquid.T = TbubbleDeg_Subcooled;600 601 "Temperature indicator"602 TI * 'K' = OutletLiquid.T;603 604 "Pressure indicator"605 PI * 'atm' = OutletLiquid.P;606 607 end608 609 Model condenserSteady_fakeH610 611 ATTRIBUTES612 Pallete = true;613 Icon = "icon/CondenserSteady";614 Brief = "Model of a Steady State condenser with fake calculation of outlet conditions.";615 Info =616 "Model of a Steady State condenser with fake calculation of output temperature, but with a real617 calculation of the output stream enthalpy.618 619 == ASSUMPTIONS ==620 * perfect mixing of both phases;621 * no thermodynamics equilibrium.622 623 == SET ==624 * the fake Outlet temperature ;625 * the pressure drop in the condenser;626 627 == SPECIFY ==628 * the InletVapour stream;629 * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model).630 631 == OPTIONAL ==632 * the condenser model has two control ports633 ** TI OutletLiquid Temperature Indicator;634 ** PI OutletLiquid Pressure Indicator;635 ";636 637 PARAMETERS638 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");639 outer NComp as Integer (Brief = "Number of Components");640 641 Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P");642 Fake_Temperature as temperature (Brief="Fake temperature", Symbol = "T_{fake}");643 644 645 VARIABLES646 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.16, PosY=0, Symbol="_{in}^{Vapour}");647 out OutletLiquid as stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}");648 in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true);649 650 out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0);651 out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0);652 653 EQUATIONS654 655 "Molar Flow Balance"656 InletVapour.F = OutletLiquid.F;657 658 "Molar Composition Balance"659 InletVapour.z = OutletLiquid.z;660 661 "Energy Balance"662 InletVapour.F*InletVapour.h + InletQ = OutletLiquid.F*OutletLiquid.h;663 664 "Pressure Drop"665 OutletLiquid.P = InletVapour.P  Pdrop;666 667 "Fake Temperature"668 OutletLiquid.T = Fake_Temperature;669 670 "Vapourisation Fraction"671 OutletLiquid.v = 0;672 673 "Temperature indicator"674 TI * 'K' = OutletLiquid.T;675 676 "Pressure indicator"677 PI * 'atm' = OutletLiquid.P;678 679 end680 681 Model condenserReact682 ATTRIBUTES683 Pallete = false;684 Icon = "icon/Condenser";685 Brief = "Model of a Condenser with reaction in liquid phase.";686 Info =687 "== Assumptions ==688 * perfect mixing of both phases;689 * thermodynamics equilibrium;690 * the reaction only takes place in liquid phase.691 692 == Specify ==693 * the reaction related variables;694 * the inlet stream;695 * the outlet flows: OutletVapour.F and OutletLiquid.F;696 * the heat supply.697 698 == Initial Conditions ==699 * the condenser temperature (OutletLiquid.T);700 * the condenser liquid level (Level);701 * (NoComps  1) OutletLiquid (OR OutletVapour) compositions.702 ";703 704 PARAMETERS705 outer PP as Plugin(Type="PP");706 outer NComp as Integer;707 708 V as volume (Brief="Condenser total volume");709 Across as area (Brief="Cross Section Area of reboiler");710 711 stoic(NComp) as Real (Brief="Stoichiometric matrix");712 Hr as energy_mol;713 Initial_Level as length (Brief="Initial Level of liquid phase");714 Initial_Temperature as temperature (Brief="Initial Temperature of Condenser");715 Initial_Composition(NComp) as fraction (Brief="Initial Liquid Composition");716 717 VARIABLES718 719 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}");720 out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");721 out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");722 InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");723 724 M(NComp) as mol (Brief="Molar Holdup in the tray");725 ML as mol (Brief="Molar liquid holdup");726 MV as mol (Brief="Molar vapour holdup");727 E as energy (Brief="Total Energy Holdup on tray");728 vL as volume_mol (Brief="Liquid Molar Volume");729 vV as volume_mol (Brief="Vapour Molar volume");730 Level as length (Brief="Level of liquid phase");731 Vol as volume;732 r3 as reaction_mol (Brief="Reaction Rates", DisplayUnit = 'mol/l/s');733 C(NComp) as conc_mol (Brief="Molar concentration", Lower = 1);734 735 INITIAL736 737 Level = Initial_Level;738 OutletLiquid.T = Initial_Temperature;739 OutletLiquid.z(1:NComp1) = Initial_Composition(1:NComp1)/sum(Initial_Composition);740 741 EQUATIONS742 "Molar Concentration"743 OutletLiquid.z = vL * C;744 745 "Reaction"746 r3 = exp(7150*'K'/OutletLiquid.T)*(4.85e4*C(1)*C(2)  1.23e4*C(3)*C(4)) * 'l/mol/s';747 748 "Component Molar Balance"749 diff(M) = InletVapour.F*InletVapour.z  OutletLiquid.F*OutletLiquid.z  OutletVapour.F*OutletVapour.z + stoic*r3*ML*vL;750 751 "Energy Balance"752 diff(E) = InletVapour.F*InletVapour.h  OutletLiquid.F*OutletLiquid.h OutletVapour.F*OutletVapour.h + InletQ + Hr * r3 * ML*vL;753 754 "Molar Holdup"755 M = ML*OutletLiquid.z + MV*OutletVapour.z;756 757 "Energy Holdup"758 E = ML*OutletLiquid.h + MV*OutletVapour.h  OutletVapour.P*V;759 760 "Mol fraction normalisation"761 sum(OutletLiquid.z)=1.0;762 763 "Liquid Volume"764 vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);765 766 "Vapour Volume"767 vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);768 769 "Thermal Equilibrium"770 OutletLiquid.T = OutletVapour.T;771 772 "Mechanical Equilibrium"773 OutletVapour.P = OutletLiquid.P;774 775 "Geometry Constraint"776 V = ML*vL + MV*vV;777 778 Vol = ML*vL;779 780 "Level of liquid phase"781 Level = ML*vL/Across;782 783 "Chemical Equilibrium"784 PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =785 PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;786 787 sum(OutletLiquid.z)=sum(OutletVapour.z);788 789 end790 791 Model condenser792 793 ATTRIBUTES794 Pallete = true;795 Icon = "icon/Condenser";796 Brief = "Model of a dynamic condenser with control.";797 Info =798 "== ASSUMPTIONS ==799 * perfect mixing of both phases;800 * thermodynamics equilibrium.801 802 == SPECIFY ==803 * the InletVapour stream;804 * the outlet flows: OutletVapour.F and OutletLiquid.F;805 * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model).806 807 == OPTIONAL ==808 * the condenser model has three control ports809 ** TI OutletLiquid Temperature Indicator;810 ** PI OutletLiquid Pressure Indicator;811 ** LI Level Indicator of Condenser;812 813 == INITIAL CONDITIONS ==814 * Initial_Temperature : the condenser temperature (OutletLiquid.T);815 * Levelpercent_Initial : the condenser liquid level in percent (LI);816 * Initial_Composition : (NoComps) OutletLiquid compositions.817 ";818 819 PARAMETERS820 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");821 outer NComp as Integer (Brief="Number of Components");822 823 Mw(NComp) as molweight (Brief = "Component Mol Weight",Hidden=true);824 low_flow as flow_mol (Brief = "Low Flow",Default = 1E6, Hidden=true);825 zero_flow as flow_mol (Brief = "No Flow",Default = 0, Hidden=true);826 KfConst as area (Brief="Constant for K factor pressure drop", Default = 1, Hidden=true);827 828 VapourFlow as Switcher (Brief="Vapour Flow", Valid = ["on", "off"], Default = "on",Hidden=true);829 830 Kfactor as positive (Brief="K factor for pressure drop", Lower = 1E8, Default = 1E3);831 832 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70);833 Initial_Temperature as temperature (Brief="Initial Temperature of Condenser");834 Initial_Composition(NComp) as positive (Brief="Initial Liquid Composition", Lower=1E6);835 836 VARIABLES837 838 Geometry as VesselVolume (Brief="Vessel Geometry", Symbol=" ");839 840 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.13, PosY=0, Symbol="_{in}^{Vapour}");841 out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.35, PosY=1, Symbol="_{out}^{Liquid}");842 out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.54, PosY=0, Symbol="_{out}^{Vapour}");843 in InletQ as power (Brief="Heat supplied", Protected = true, PosX=1, PosY=0.08, Symbol="Q_{in}");844 845 out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.33, PosY=0);846 out LI as control_signal (Brief="Level Indicator of Condenser", Protected = true, PosX=0.43, PosY=0);847 out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.25, PosY=0);848 849 M(NComp) as mol (Brief="Molar Holdup in the tray", Protected = true);850 ML as mol (Brief="Molar liquid holdup", Protected = true);851 MV as mol (Brief="Molar vapour holdup", Protected = true);852 E as energy (Brief="Total Energy Holdup on tray", Protected = true);853 vL as volume_mol (Brief="Liquid Molar Volume", Protected = true);854 vV as volume_mol (Brief="Vapour Molar volume", Protected = true);855 rho as dens_mass (Brief ="Inlet Vapour Mass Density",Hidden=true, Symbol ="\rho");856 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true);857 858 SET859 Mw = PP.MolecularWeight();860 low_flow = 1E6 * 'kmol/h';861 zero_flow = 0 * 'kmol/h';862 KfConst = 1*'m^2';863 864 INITIAL865 866 "Initial level Percent"867 LI = Levelpercent_Initial;868 869 "Initial Temperature"870 OutletLiquid.T = Initial_Temperature;871 872 "Initial Composition"873 OutletLiquid.z(1:NComp1) = Initial_Composition(1:NComp1)/sum(Initial_Composition);874 875 EQUATIONS876 877 switch VapourFlow878 879 case "on":880 InletVapour.F*sum(Mw*InletVapour.z) = Kfactor *sqrt(Pdrop*rho)*KfConst;881 882 when InletVapour.F < low_flow switchto "off";883 884 case "off":885 InletVapour.F = zero_flow;886 887 when InletVapour.P > OutletLiquid.P switchto "on";888 889 end890 891 "Component Molar Balance"892 diff(M) = InletVapour.F*InletVapour.z  OutletLiquid.F*OutletLiquid.z OutletVapour.F*OutletVapour.z;893 894 "Energy Balance"895 diff(E) = InletVapour.F*InletVapour.h  OutletLiquid.F*OutletLiquid.h OutletVapour.F*OutletVapour.h + InletQ;896 897 "Molar Holdup"898 M = ML*OutletLiquid.z + MV*OutletVapour.z;899 900 "Energy Holdup"901 E = ML*OutletLiquid.h + MV*OutletVapour.h  OutletVapour.P*Geometry.Vtotal;902 903 "Mol fraction normalisation"904 sum(OutletLiquid.z)=1.0;905 906 "Mol fraction Constraint"907 sum(OutletLiquid.z)=sum(OutletVapour.z);908 909 "Liquid Volume"910 vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);911 912 "Vapour Volume"913 vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);914 915 "Inlet Vapour Density"916 rho = PP.VapourDensity(InletVapour.T, InletVapour.P, InletVapour.z);917 918 "Chemical Equilibrium"919 PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =920 PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;921 922 "Thermal Equilibrium"923 OutletLiquid.T = OutletVapour.T;924 925 "Mechanical Equilibrium"926 OutletVapour.P = OutletLiquid.P;927 928 "Pressure Drop"929 OutletLiquid.P = InletVapour.P  Pdrop;930 931 "Geometry Constraint"932 Geometry.Vtotal = ML*vL + MV*vV;933 934 "Liquid Level"935 ML * vL = Geometry.Vfilled;936 937 "Temperature indicator"938 TI * 'K' = OutletLiquid.T;939 940 "Pressure indicator"941 PI * 'atm' = OutletLiquid.P;942 943 "Level indicator"944 LI*Geometry.Vtotal= Geometry.Vfilled;945 946 end947 948 949 Model condenserSubcooled950 951 ATTRIBUTES952 Pallete = true;953 Icon = "icon/CondenserSteady";954 Brief = "Model of a Steady State total condenser with specified temperature outlet conditions.";955 Info =956 "A simple model of a simple Steady State total condenser with specified temperature (or subcooling degree), with a real957 calculation of the output stream enthalpy.958 959 == ASSUMPTIONS ==960 * perfect mixing of both phases;961 * saturated vapour at the Inlet.962 * no thermodynamics equilibrium.963 964 == SET ==965 * the fake Outlet temperature ;966 * the pressure drop in the condenser;967 968 == SPECIFY ==969 * the InletVapour stream;970 * the subcooled temperature OR the the degree of subcooling.971 972 == OPTIONAL ==973 * the condenser model has two control ports974 ** TI OutletLiquid Temperature Indicator;975 ** PI OutletLiquid Pressure Indicator;976 ";977 978 PARAMETERS979 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");980 outer NComp as Integer (Brief = "Number of Components");981 982 Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P");983 #Fake_Temperature as temperature (Brief="Fake temperature", Symbol = "T_{fake}");984 985 986 VARIABLES987 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.16, PosY=0, Symbol="_{in}^{Vapour}");988 out OutletLiquid as stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}");989 #in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true);990 T_sub as temperature (Brief="Condensate temperature (subcooled)", Symbol = "T_{sub}");991 SubcoolingDegree as temp_delta (Brief="Subcooling Degree", Symbol = "\Delta _{sub}");992 CondenserDuty as power (Brief="Calculated condenser duty for desired subcooling", Protected = true, Symbol = "Q_{cond}");993 994 out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0);995 out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0);996 997 EQUATIONS998 999 "Molar Flow Balance"1000 InletVapour.F = OutletLiquid.F;1001 1002 "Molar Composition Balance"1003 InletVapour.z = OutletLiquid.z;1004 1005 #"Energy Balance"1006 #InletVapour.F*InletVapour.h + InletQ = OutletLiquid.F*OutletLiquid.h;1007 1008 "Pressure Drop"1009 OutletLiquid.P = InletVapour.P  Pdrop;1010 1011 "Subcooled Temperature"1012 OutletLiquid.T = T_sub;1013 1014 "Degree of subcooling"1015 SubcoolingDegree = InletVapour.T  T_sub;1016 1017 "Liquid enthalpy"1018 OutletLiquid.h = PP.LiquidEnthalpy(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);1019 1020 "Condenser Duty"1021 CondenserDuty = OutletLiquid.F*OutletLiquid.h  InletVapour.F*InletVapour.h;1022 1023 "Vapourisation Fraction"1024 OutletLiquid.v = 0;1025 1026 "Temperature indicator"1027 TI * 'K' = OutletLiquid.T;1028 1029 "Pressure indicator"1030 PI * 'atm' = OutletLiquid.P;1031 1032 end1033 1034 1035 Model condenserSubcooled21036 1037 ATTRIBUTES1038 Pallete = true;1039 Icon = "icon/CondenserSteady";1040 Brief = "Model of a Steady State total condenser with specified temperature outlet conditions.";1041 Info =1042 "A simple model of a simple Steady State total condenser with specified temperature (or subcooling degree), with a real1043 calculation of the output stream enthalpy.1044 1045 == ASSUMPTIONS ==1046 * perfect mixing of both phases;1047 * saturated vapour at the Inlet.1048 * no thermodynamics equilibrium.1049 1050 == SET ==1051 * the fake Outlet temperature ;1052 * the pressure drop in the condenser;1053 1054 == SPECIFY ==1055 * the InletVapour stream;1056 * the subcooled temperature OR the the degree of subcooling.1057 1058 == OPTIONAL ==1059 * the condenser model has two control ports1060 ** TI OutletLiquid Temperature Indicator;1061 ** PI OutletLiquid Pressure Indicator;1062 ";1063 1064 PARAMETERS1065 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");1066 outer NComp as Integer (Brief = "Number of Components");1067 1068 Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P");1069 #Fake_Temperature as temperature (Brief="Fake temperature", Symbol = "T_{fake}");1070 1071 1072 VARIABLES1073 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.16, PosY=0, Symbol="_{in}^{Vapour}");1074 out OutletLiquid as stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}");1075 #in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true);1076 #SubcoolingDegree as temp_delta (Brief="Subcooling Degree", Symbol = "\Delta _{sub}");1077 T_sub as temperature (Brief="Condensate temperature (subcooled)", Symbol = "T_{sub}");1078 Tbubble as temperature (Brief="Bubble point at the condenser conditions", Protected = true, Symbol = "T_{b}");1079 CondenserDuty as power (Brief="Calculated condenser duty for desired subcooling", Protected = true, Symbol = "Q_{cond}");1080 1081 out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0);1082 out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0);1083 1084 EQUATIONS1085 1086 "Molar Flow Balance"1087 InletVapour.F = OutletLiquid.F;1088 1089 "Molar Composition Balance"1090 InletVapour.z = OutletLiquid.z;1091 1092 #"Energy Balance"1093 #InletVapour.F*InletVapour.h + InletQ = OutletLiquid.F*OutletLiquid.h;1094 1095 "Pressure Drop"1096 OutletLiquid.P = InletVapour.P  Pdrop;1097 1098 "Subcooled Temperature"1099 OutletLiquid.T = T_sub;1100 1101 "Bubble Temperature"1102 Tbubble = PP.BubbleT(OutletLiquid.P,OutletLiquid.z);1103 1104 #"Degree of subcooling"1105 # SubcoolingDegree = Tbubble  T_sub;1106 1107 "Liquid enthalpy"1108 OutletLiquid.h = PP.LiquidEnthalpy(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);1109 1110 "Condenser Duty"1111 CondenserDuty = OutletLiquid.F*OutletLiquid.h  InletVapour.F*InletVapour.h;1112 1113 "Vapourisation Fraction"1114 OutletLiquid.v = 0;1115 1116 "Temperature indicator"1117 TI * 'K' = OutletLiquid.T;1118 1119 "Pressure indicator"1120 PI * 'atm' = OutletLiquid.P;1121 1122 end1123 1124 >>>>>>> .r891
Note: See TracChangeset
for help on using the changeset viewer.