Changeset 885 for branches/gui/eml


Ignore:
Timestamp:
Nov 13, 2009, 1:23:17 PM (13 years ago)
Author:
gerson bicca
Message:

updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/eml/stage_separators/column.mso

    r878 r885  
    647647
    648648
     649Model Packed_Section_ColumnBasic
     650
     651ATTRIBUTES
     652        Pallete         = false;
     653        Icon            = "icon/PackedSectionColumn";
     654        Brief           = "Model of a packed column section.";
     655        Info            =
     656"== Model of a packed column section containing ==
     657* NStages theoretical stages.
     658       
     659== Specify ==
     660* the feed stream of each tray (Inlet);
     661* the InletLiquid stream of the top tray;
     662* the InletVapour stream of the bottom tray;
     663* the total pressure drop (dP) of the section.
     664       
     665== Initial Conditions ==
     666* the stages temperature (OutletLiquid.T);
     667* the stages liquid holdup;
     668* (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray.
     669";
     670       
     671PARAMETERS
     672
     673        outer PP                as Plugin       (Brief = "External Physical Properties", Type="PP");
     674        outer NComp     as Integer      (Brief="Number of components",Protected=true);
     675       
     676
     677        NumberOfFeeds                                           as Integer      (Brief="Number of Feed Stages",Default=3,Protected=true);
     678        NumberOfStages                                          as Integer      (Brief="Number of Stages", Default=3);
     679        FeedStageLocation(NumberOfFeeds)        as Integer      (Brief="Feed Stage Location",Default=2);
     680       
     681        PackingHeight           as length               (Brief="Height of packing");
     682        HeatSupply                      as heat_rate    (Brief="Rate of heat supply");
     683        ColumnDiameter          as length               (Brief="Column diameter");
     684        VoidFraction            as Real                 (Brief="Void fraction of packing, (m^3 void space/m^3 packed bed)");
     685        ResistanceCoeff         as positive     (Brief="Resistance coefficient on the liquid load", Default=1);
     686        AreaPerPackingVol       as Real                 (Brief="surface area per packing volume", Unit='m^2/m^3');
     687        HETP                            as length               (Brief="The Height Equivalent to a Theoretical Plate",Protected=true);
     688
     689VARIABLES
     690
     691        INITIALIZATION  as InitializeStage      (Brief = "Column Model Initialization");
     692        CONTROL                 as ControlSection (Brief="Column Model Control");
     693       
     694        out     TCI as control_signal   (Brief="Temperature  Indicator", Protected = true, PosX=1, PosY=0.73);
     695        out     PCI as control_signal   (Brief="Pressure Indicator", Protected = true, PosX=0, PosY=0.24);
     696       
     697        in      LiquidInlet             as      stream                          (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0,Protected=true);
     698        out     VapourOutlet            as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0,Protected=true);
     699       
     700        in              VapourInlet             as stream                               (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1,Protected=true);
     701        out     LiquidOutlet            as liquid_stream                (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1,Protected=true);
     702       
     703        LiquidConnector as stream       (Brief="Liquid connection at the middle STAGES", PosX=0.75, PosY=1,Hidden=true);
     704        VapourConnector as stream       (Brief="Vapour connection at the middle STAGES", PosX=0.55, PosY=0,Hidden=true);
     705       
     706        STAGES(NumberOfStages) as packedStage (Brief="Column Stages",Protected=true);
     707        PressureDrop               as pressure (Brief="Column Pressure Drop", Protected=true);
     708
     709SET
     710
     711        STAGES.Number_Stages                            = NumberOfStages;
     712        STAGES.HeightOfPacking                          = PackingHeight;
     713        STAGES.HeatOnStage                                      = HeatSupply;
     714        STAGES.ColumnInternalDiameter           = ColumnDiameter;
     715        STAGES.PackingVoidFraction                      = VoidFraction;
     716        STAGES.LiquidResistanceCoeff            = ResistanceCoeff ;
     717        STAGES.AreaPerPackingVolume             = AreaPerPackingVol;
     718       
     719        HETP = PackingHeight/NumberOfStages;   
     720
     721CONNECTIONS
     722
     723        STAGES([2:NumberOfStages]).OutletVapour         to STAGES([1:NumberOfStages-1]).InletVapour;
     724        STAGES([1:NumberOfStages-1]).OutletLiquid       to STAGES([2:NumberOfStages]).InletLiquid;
     725        LiquidConnector                                                         to STAGES(1).InletLiquid;
     726        VapourConnector                                                         to STAGES(NumberOfStages).InletVapour;
     727
     728EQUATIONS
     729
     730        LiquidConnector.F= LiquidInlet.F;
     731        LiquidConnector.T = LiquidInlet.T;
     732        LiquidConnector.P = LiquidInlet.P;
     733        LiquidConnector.z = LiquidInlet.z;
     734        LiquidConnector.v = LiquidInlet.v;
     735        LiquidConnector.h = LiquidInlet.h;
     736       
     737        VapourConnector.F= VapourInlet.F;
     738        VapourConnector.T = VapourInlet.T;
     739        VapourConnector.P = VapourInlet.P;
     740        VapourConnector.z = VapourInlet.z;
     741        VapourConnector.v = VapourInlet.v;
     742        VapourConnector.h = VapourInlet.h;
     743       
     744        LiquidOutlet.F= STAGES(NumberOfStages).OutletLiquid.F;
     745        LiquidOutlet.T = STAGES(NumberOfStages).OutletLiquid.T;
     746        LiquidOutlet.P = STAGES(NumberOfStages).OutletLiquid.P;
     747        LiquidOutlet.z = STAGES(NumberOfStages).OutletLiquid.z;
     748       
     749        VapourOutlet.F= STAGES(1).OutletVapour.F;
     750        VapourOutlet.T = STAGES(1).OutletVapour.T;
     751        VapourOutlet.P = STAGES(1).OutletVapour.P;
     752        VapourOutlet.z = STAGES(1).OutletVapour.z;
     753
     754"Tray Temperature Indicator"   
     755        #TCI*'K' = TRAYS(min([NumberOfTrays, CONTROL.Tindicator_TrayNumber])).OutletVapour.T;
     756        TCI*'K' = STAGES(CONTROL.Tindicator_TrayNumber).OutletVapour.T;
     757
     758"Tray Pressure Indicator"       
     759        #PCI*'atm' = TRAYS(min([NumberOfTrays, CONTROL.Pindicator_TrayNumber])).OutletVapour.P;
     760        PCI*'atm' = STAGES(CONTROL.Pindicator_TrayNumber).OutletVapour.P;
     761
     762"PressureDrop"
     763        PressureDrop = STAGES(NumberOfStages).OutletLiquid.P - STAGES(1).OutletLiquid.P;
     764
     765INITIAL
     766
     767for i in 1:NumberOfStages do
     768
     769"The initial temperature of the STAGES"
     770        STAGES(i).OutletLiquid.T = INITIALIZATION.TopStageTemperature+(INITIALIZATION.BottomStageTemperature-INITIALIZATION.TopStageTemperature)*((i-1)/(NumberOfStages-1));
     771
     772"The Column Holdup of the STAGES"
     773        STAGES(i).hl = INITIALIZATION.ColumnHoldup;
     774
     775end
     776
     777for i in 1:NComp-1 do
     778
     779for j in 1:NumberOfStages do
     780
     781"The initial composition of the TRAYS"
     782        STAGES(j).OutletLiquid.z(i) = INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) +(INITIALIZATION.BottomStageComposition(i)/sum(INITIALIZATION.BottomStageComposition)-INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) )*((j-1)/(NumberOfStages-1));
     783
     784end
     785
     786end
     787
     788end
     789
     790Model Packed_Section_Column     as Packed_Section_ColumnBasic
     791
     792        ATTRIBUTES
     793        Pallete         = true;
     794        Icon            = "icon/PackedSectionColumn";
     795        Brief           = "Model of a packed column section.";
     796        Info            =
     797"== Model of a packed column section containing ==
     798* NStages theoretical stages.
     799       
     800== Specify ==
     801* the feed stream of each tray (Inlet);
     802* the InletLiquid stream of the top tray;
     803* the InletVapour stream of the bottom tray;
     804* the total pressure drop (dP) of the section.
     805       
     806== Initial Conditions ==
     807* the stages temperature (OutletLiquid.T);
     808* the stages liquid holdup;
     809* (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray.
     810";
     811
     812SET
     813        NumberOfFeeds = 1;
     814
     815VARIABLES
     816       
     817        in      FeedStage       as stream               (Brief="Feed stream", PosX=0, PosY=0.55);
     818
     819EQUATIONS
     820#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     821# Equating Feed Tray Variables to Trays Variables
     822#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     823for i in 1:NumberOfStages do
     824
     825if   i equal FeedStageLocation(1) then   
     826
     827"FeedTrayTop Inlet Flow"       
     828        FeedStage.F= STAGES(i).Inlet.F;
     829
     830"FeedTrayTop Inlet Temperature"
     831        FeedStage.T = STAGES(i).Inlet.T;
     832
     833"FeedTrayTop Inlet Pressure"
     834        FeedStage.P = STAGES(i).Inlet.P;
     835
     836"FeedTrayTop Inlet Composition"
     837        FeedStage.z = STAGES(i).Inlet.z;
     838
     839"FeedTrayTop Inlet Vapour Fraction"
     840        FeedStage.v = STAGES(i).Inlet.v;
     841
     842"FeedTrayTop Inlet Enthalpy"
     843        FeedStage.h = STAGES(i).Inlet.h;
     844
     845else
     846
     847"Inlet Tray - Flow Sealed"
     848    0*'mol/h'= STAGES(i).Inlet.F;
     849       
     850"Inlet Tray -  Temperature"
     851    300*'K' = STAGES(i).Inlet.T;
     852       
     853"Inlet Tray -  Pressure"
     854    1*'atm' = STAGES(i).Inlet.P;
     855       
     856"Inlet Tray -  Composition"
     857    0.1 = STAGES(i).Inlet.z;
     858       
     859"Inlet Tray -  Vapour Fraction"
     860    0 = STAGES(i).Inlet.v;
     861       
     862"Inlet Tray -  Enthalpy"
     863    0*'J/mol' = STAGES(i).Inlet.h;
     864
     865end
     866
     867end
     868
     869end
     870
     871Model Packed_Section_Column2    as Packed_Section_ColumnBasic
     872
     873        ATTRIBUTES
     874        Pallete         = true;
     875        Icon            = "icon/PackedSectionColumn";
     876        Brief           = "Model of a packed column section.";
     877        Info            =
     878"== Model of a packed column section containing ==
     879* NStages theoretical stages.
     880       
     881== Specify ==
     882* the feed stream of each tray (Inlet);
     883* the InletLiquid stream of the top tray;
     884* the InletVapour stream of the bottom tray;
     885* the total pressure drop (dP) of the section.
     886       
     887== Initial Conditions ==
     888* the stages temperature (OutletLiquid.T);
     889* the stages liquid holdup;
     890* (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray.
     891";
     892
     893SET
     894        NumberOfFeeds = 2;
     895
     896VARIABLES
     897       
     898        in      FeedStageOne    as stream               (Brief="Feed stream", PosX=0, PosY=0.45);
     899        in      FeedStageTwo    as stream               (Brief="Feed stream", PosX=0, PosY=0.65);
     900
     901EQUATIONS
     902#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     903# Equating Feed Stage Variables to Stages Variables
     904#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     905
     906for i in 1:NumberOfStages do
     907
     908if   i equal FeedStageLocation(1) then   
     909
     910"FeedTrayTop Inlet Flow"       
     911        FeedStageOne.F= STAGES(i).Inlet.F;
     912
     913"FeedTrayTop Inlet Temperature"
     914        FeedStageOne.T = STAGES(i).Inlet.T;
     915
     916"FeedTrayTop Inlet Pressure"
     917        FeedStageOne.P = STAGES(i).Inlet.P;
     918
     919"FeedTrayTop Inlet Composition"
     920        FeedStageOne.z = STAGES(i).Inlet.z;
     921
     922"FeedTrayTop Inlet Vapour Fraction"
     923        FeedStageOne.v = STAGES(i).Inlet.v;
     924
     925"FeedTrayTop Inlet Enthalpy"
     926        FeedStageOne.h = STAGES(i).Inlet.h;
     927
     928else if   i equal FeedStageLocation(2) then   
     929
     930"FeedTrayBottom Inlet Flow"     
     931        FeedStageTwo.F= STAGES(i).Inlet.F;
     932
     933"FeedTrayBottom Inlet Temperature"
     934        FeedStageTwo.T = STAGES(i).Inlet.T;
     935
     936"FeedTrayBottom Inlet Pressure"
     937        FeedStageTwo.P = STAGES(i).Inlet.P;
     938
     939"FeedTrayBottom Inlet Composition"
     940        FeedStageTwo.z = STAGES(i).Inlet.z;
     941
     942"FeedTrayBottom Inlet Vapour Fraction"
     943        FeedStageTwo.v = STAGES(i).Inlet.v;
     944
     945"FeedTrayBottom Inlet Enthalpy"
     946        FeedStageTwo.h = STAGES(i).Inlet.h;
     947
     948else
     949
     950"Inlet Tray - Flow Sealed"
     951    0*'mol/h'= STAGES(i).Inlet.F;
     952       
     953"Inlet Tray -  Temperature"
     954    300*'K' = STAGES(i).Inlet.T;
     955       
     956"Inlet Tray -  Pressure"
     957    1*'atm' = STAGES(i).Inlet.P;
     958       
     959"Inlet Tray -  Composition"
     960    0.1 = STAGES(i).Inlet.z;
     961       
     962"Inlet Tray -  Vapour Fraction"
     963    0 = STAGES(i).Inlet.v;
     964       
     965"Inlet Tray -  Enthalpy"
     966    0*'J/mol' = STAGES(i).Inlet.h;
     967
     968end
     969
     970end
     971
     972end
     973
     974end
     975
     976
     977# Models to be revised
     978#*
    649979Model ColumnBasic
    650980
     
    16892019end
    16902020
    1691 
    1692 
    1693 Model Packed_Section_ColumnBasic
    1694 
    1695 ATTRIBUTES
    1696         Pallete         = false;
    1697         Icon            = "icon/PackedSectionColumn";
    1698         Brief           = "Model of a packed column section.";
    1699         Info            =
    1700 "== Model of a packed column section containing ==
    1701 * NStages theoretical stages.
    1702        
    1703 == Specify ==
    1704 * the feed stream of each tray (Inlet);
    1705 * the InletLiquid stream of the top tray;
    1706 * the InletVapour stream of the bottom tray;
    1707 * the total pressure drop (dP) of the section.
    1708        
    1709 == Initial Conditions ==
    1710 * the stages temperature (OutletLiquid.T);
    1711 * the stages liquid holdup;
    1712 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray.
    1713 ";
    1714        
    1715 PARAMETERS
    1716 
    1717         outer PP                as Plugin       (Brief = "External Physical Properties", Type="PP");
    1718         outer NComp     as Integer      (Brief="Number of components",Protected=true);
    1719        
    1720 
    1721         NumberOfFeeds                                           as Integer      (Brief="Number of Feed Stages",Default=3,Protected=true);
    1722         NumberOfStages                                          as Integer      (Brief="Number of Stages", Default=3);
    1723         FeedStageLocation(NumberOfFeeds)        as Integer      (Brief="Feed Stage Location",Default=2);
    1724        
    1725         PackingHeight           as length               (Brief="Height of packing");
    1726         HeatSupply                      as heat_rate    (Brief="Rate of heat supply");
    1727         ColumnDiameter          as length               (Brief="Column diameter");
    1728         VoidFraction            as Real                 (Brief="Void fraction of packing, (m^3 void space/m^3 packed bed)");
    1729         ResistanceCoeff         as positive     (Brief="Resistance coefficient on the liquid load", Default=1);
    1730         AreaPerPackingVol       as Real                 (Brief="surface area per packing volume", Unit='m^2/m^3');
    1731         HETP                            as length               (Brief="The Height Equivalent to a Theoretical Plate",Protected=true);
    1732 
    1733 VARIABLES
    1734 
    1735         INITIALIZATION  as InitializeStage      (Brief = "Column Model Initialization");
    1736         CONTROL                 as ControlSection (Brief="Column Model Control");
    1737        
    1738         out     TCI as control_signal   (Brief="Temperature  Indicator", Protected = true, PosX=1, PosY=0.73);
    1739         out     PCI as control_signal   (Brief="Pressure Indicator", Protected = true, PosX=0, PosY=0.24);
    1740        
    1741         in      LiquidInlet             as      stream                          (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0,Protected=true);
    1742         out     VapourOutlet            as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0,Protected=true);
    1743        
    1744         in              VapourInlet             as stream                               (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1,Protected=true);
    1745         out     LiquidOutlet            as liquid_stream                (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1,Protected=true);
    1746        
    1747         LiquidConnector as stream       (Brief="Liquid connection at the middle STAGES", PosX=0.75, PosY=1,Hidden=true);
    1748         VapourConnector as stream       (Brief="Vapour connection at the middle STAGES", PosX=0.55, PosY=0,Hidden=true);
    1749        
    1750         STAGES(NumberOfStages) as packedStage (Brief="Column Stages",Protected=true);
    1751         PressureDrop               as pressure (Brief="Column Pressure Drop", Protected=true);
    1752 
    1753 SET
    1754 
    1755         STAGES.Number_Stages                            = NumberOfStages;
    1756         STAGES.HeightOfPacking                          = PackingHeight;
    1757         STAGES.HeatOnStage                                      = HeatSupply;
    1758         STAGES.ColumnInternalDiameter           = ColumnDiameter;
    1759         STAGES.PackingVoidFraction                      = VoidFraction;
    1760         STAGES.LiquidResistanceCoeff            = ResistanceCoeff ;
    1761         STAGES.AreaPerPackingVolume             = AreaPerPackingVol;
    1762        
    1763         HETP = PackingHeight/NumberOfStages;   
    1764 
    1765 CONNECTIONS
    1766 
    1767         STAGES([2:NumberOfStages]).OutletVapour         to STAGES([1:NumberOfStages-1]).InletVapour;
    1768         STAGES([1:NumberOfStages-1]).OutletLiquid       to STAGES([2:NumberOfStages]).InletLiquid;
    1769         LiquidConnector                                                         to STAGES(1).InletLiquid;
    1770         VapourConnector                                                         to STAGES(NumberOfStages).InletVapour;
    1771 
    1772 EQUATIONS
    1773 
    1774         LiquidConnector.F= LiquidInlet.F;
    1775         LiquidConnector.T = LiquidInlet.T;
    1776         LiquidConnector.P = LiquidInlet.P;
    1777         LiquidConnector.z = LiquidInlet.z;
    1778         LiquidConnector.v = LiquidInlet.v;
    1779         LiquidConnector.h = LiquidInlet.h;
    1780        
    1781         VapourConnector.F= VapourInlet.F;
    1782         VapourConnector.T = VapourInlet.T;
    1783         VapourConnector.P = VapourInlet.P;
    1784         VapourConnector.z = VapourInlet.z;
    1785         VapourConnector.v = VapourInlet.v;
    1786         VapourConnector.h = VapourInlet.h;
    1787        
    1788         LiquidOutlet.F= STAGES(NumberOfStages).OutletLiquid.F;
    1789         LiquidOutlet.T = STAGES(NumberOfStages).OutletLiquid.T;
    1790         LiquidOutlet.P = STAGES(NumberOfStages).OutletLiquid.P;
    1791         LiquidOutlet.z = STAGES(NumberOfStages).OutletLiquid.z;
    1792        
    1793         VapourOutlet.F= STAGES(1).OutletVapour.F;
    1794         VapourOutlet.T = STAGES(1).OutletVapour.T;
    1795         VapourOutlet.P = STAGES(1).OutletVapour.P;
    1796         VapourOutlet.z = STAGES(1).OutletVapour.z;
    1797 
    1798 "Tray Temperature Indicator"   
    1799         #TCI*'K' = TRAYS(min([NumberOfTrays, CONTROL.Tindicator_TrayNumber])).OutletVapour.T;
    1800         TCI*'K' = STAGES(CONTROL.Tindicator_TrayNumber).OutletVapour.T;
    1801 
    1802 "Tray Pressure Indicator"       
    1803         #PCI*'atm' = TRAYS(min([NumberOfTrays, CONTROL.Pindicator_TrayNumber])).OutletVapour.P;
    1804         PCI*'atm' = STAGES(CONTROL.Pindicator_TrayNumber).OutletVapour.P;
    1805 
    1806 "PressureDrop"
    1807         PressureDrop = STAGES(NumberOfStages).OutletLiquid.P - STAGES(1).OutletLiquid.P;
    1808 
    1809 INITIAL
    1810 
    1811 for i in 1:NumberOfStages do
    1812 
    1813 "The initial temperature of the STAGES"
    1814         STAGES(i).OutletLiquid.T = INITIALIZATION.TopStageTemperature+(INITIALIZATION.BottomStageTemperature-INITIALIZATION.TopStageTemperature)*((i-1)/(NumberOfStages-1));
    1815 
    1816 "The Column Holdup of the STAGES"
    1817         STAGES(i).hl = INITIALIZATION.ColumnHoldup;
    1818 
    1819 end
    1820 
    1821 for i in 1:NComp-1 do
    1822 
    1823 for j in 1:NumberOfStages do
    1824 
    1825 "The initial composition of the TRAYS"
    1826         STAGES(j).OutletLiquid.z(i) = INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) +(INITIALIZATION.BottomStageComposition(i)/sum(INITIALIZATION.BottomStageComposition)-INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) )*((j-1)/(NumberOfStages-1));
    1827 
    1828 end
    1829 
    1830 end
    1831 
    1832 end
    1833 
    1834 Model Packed_Section_Column     as Packed_Section_ColumnBasic
    1835 
    1836         ATTRIBUTES
    1837         Pallete         = true;
    1838         Icon            = "icon/PackedSectionColumn";
    1839         Brief           = "Model of a packed column section.";
    1840         Info            =
    1841 "== Model of a packed column section containing ==
    1842 * NStages theoretical stages.
    1843        
    1844 == Specify ==
    1845 * the feed stream of each tray (Inlet);
    1846 * the InletLiquid stream of the top tray;
    1847 * the InletVapour stream of the bottom tray;
    1848 * the total pressure drop (dP) of the section.
    1849        
    1850 == Initial Conditions ==
    1851 * the stages temperature (OutletLiquid.T);
    1852 * the stages liquid holdup;
    1853 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray.
    1854 ";
    1855 
    1856 SET
    1857         NumberOfFeeds = 1;
    1858 
    1859 VARIABLES
    1860        
    1861         in      FeedStage       as stream               (Brief="Feed stream", PosX=0, PosY=0.55);
    1862 
    1863 EQUATIONS
    1864 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    1865 # Equating Feed Tray Variables to Trays Variables
    1866 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    1867 for i in 1:NumberOfStages do
    1868 
    1869 if   i equal FeedStageLocation(1) then   
    1870 
    1871 "FeedTrayTop Inlet Flow"       
    1872         FeedStage.F= STAGES(i).Inlet.F;
    1873 
    1874 "FeedTrayTop Inlet Temperature"
    1875         FeedStage.T = STAGES(i).Inlet.T;
    1876 
    1877 "FeedTrayTop Inlet Pressure"
    1878         FeedStage.P = STAGES(i).Inlet.P;
    1879 
    1880 "FeedTrayTop Inlet Composition"
    1881         FeedStage.z = STAGES(i).Inlet.z;
    1882 
    1883 "FeedTrayTop Inlet Vapour Fraction"
    1884         FeedStage.v = STAGES(i).Inlet.v;
    1885 
    1886 "FeedTrayTop Inlet Enthalpy"
    1887         FeedStage.h = STAGES(i).Inlet.h;
    1888 
    1889 else
    1890 
    1891 "Inlet Tray - Flow Sealed"
    1892     0*'mol/h'= STAGES(i).Inlet.F;
    1893        
    1894 "Inlet Tray -  Temperature"
    1895     300*'K' = STAGES(i).Inlet.T;
    1896        
    1897 "Inlet Tray -  Pressure"
    1898     1*'atm' = STAGES(i).Inlet.P;
    1899        
    1900 "Inlet Tray -  Composition"
    1901     0.1 = STAGES(i).Inlet.z;
    1902        
    1903 "Inlet Tray -  Vapour Fraction"
    1904     0 = STAGES(i).Inlet.v;
    1905        
    1906 "Inlet Tray -  Enthalpy"
    1907     0*'J/mol' = STAGES(i).Inlet.h;
    1908 
    1909 end
    1910 
    1911 end
    1912 
    1913 end
    1914 
    1915 Model Packed_Section_Column2    as Packed_Section_ColumnBasic
    1916 
    1917         ATTRIBUTES
    1918         Pallete         = true;
    1919         Icon            = "icon/PackedSectionColumn";
    1920         Brief           = "Model of a packed column section.";
    1921         Info            =
    1922 "== Model of a packed column section containing ==
    1923 * NStages theoretical stages.
    1924        
    1925 == Specify ==
    1926 * the feed stream of each tray (Inlet);
    1927 * the InletLiquid stream of the top tray;
    1928 * the InletVapour stream of the bottom tray;
    1929 * the total pressure drop (dP) of the section.
    1930        
    1931 == Initial Conditions ==
    1932 * the stages temperature (OutletLiquid.T);
    1933 * the stages liquid holdup;
    1934 * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray.
    1935 ";
    1936 
    1937 SET
    1938         NumberOfFeeds = 2;
    1939 
    1940 VARIABLES
    1941        
    1942         in      FeedStageOne    as stream               (Brief="Feed stream", PosX=0, PosY=0.45);
    1943         in      FeedStageTwo    as stream               (Brief="Feed stream", PosX=0, PosY=0.65);
    1944 
    1945 EQUATIONS
    1946 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    1947 # Equating Feed Stage Variables to Stages Variables
    1948 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    1949 
    1950 for i in 1:NumberOfStages do
    1951 
    1952 if   i equal FeedStageLocation(1) then   
    1953 
    1954 "FeedTrayTop Inlet Flow"       
    1955         FeedStageOne.F= STAGES(i).Inlet.F;
    1956 
    1957 "FeedTrayTop Inlet Temperature"
    1958         FeedStageOne.T = STAGES(i).Inlet.T;
    1959 
    1960 "FeedTrayTop Inlet Pressure"
    1961         FeedStageOne.P = STAGES(i).Inlet.P;
    1962 
    1963 "FeedTrayTop Inlet Composition"
    1964         FeedStageOne.z = STAGES(i).Inlet.z;
    1965 
    1966 "FeedTrayTop Inlet Vapour Fraction"
    1967         FeedStageOne.v = STAGES(i).Inlet.v;
    1968 
    1969 "FeedTrayTop Inlet Enthalpy"
    1970         FeedStageOne.h = STAGES(i).Inlet.h;
    1971 
    1972 else if   i equal FeedStageLocation(2) then   
    1973 
    1974 "FeedTrayBottom Inlet Flow"     
    1975         FeedStageTwo.F= STAGES(i).Inlet.F;
    1976 
    1977 "FeedTrayBottom Inlet Temperature"
    1978         FeedStageTwo.T = STAGES(i).Inlet.T;
    1979 
    1980 "FeedTrayBottom Inlet Pressure"
    1981         FeedStageTwo.P = STAGES(i).Inlet.P;
    1982 
    1983 "FeedTrayBottom Inlet Composition"
    1984         FeedStageTwo.z = STAGES(i).Inlet.z;
    1985 
    1986 "FeedTrayBottom Inlet Vapour Fraction"
    1987         FeedStageTwo.v = STAGES(i).Inlet.v;
    1988 
    1989 "FeedTrayBottom Inlet Enthalpy"
    1990         FeedStageTwo.h = STAGES(i).Inlet.h;
    1991 
    1992 else
    1993 
    1994 "Inlet Tray - Flow Sealed"
    1995     0*'mol/h'= STAGES(i).Inlet.F;
    1996        
    1997 "Inlet Tray -  Temperature"
    1998     300*'K' = STAGES(i).Inlet.T;
    1999        
    2000 "Inlet Tray -  Pressure"
    2001     1*'atm' = STAGES(i).Inlet.P;
    2002        
    2003 "Inlet Tray -  Composition"
    2004     0.1 = STAGES(i).Inlet.z;
    2005        
    2006 "Inlet Tray -  Vapour Fraction"
    2007     0 = STAGES(i).Inlet.v;
    2008        
    2009 "Inlet Tray -  Enthalpy"
    2010     0*'J/mol' = STAGES(i).Inlet.h;
    2011 
    2012 end
    2013 
    2014 end
    2015 
    2016 end
    2017 
    2018 end
    2019 
    20202021Model PackedDistillation_kettle_cond as Packed_Section_ColumnBasic
    20212022        ATTRIBUTES
     
    21232124end
    21242125
    2125 #*
    21262126Model Rectifier_subcooling as Section_ColumnBasicX
    21272127
Note: See TracChangeset for help on using the changeset viewer.