Changeset 721 for branches/gui/eml


Ignore:
Timestamp:
Feb 25, 2009, 7:51:53 PM (15 years ago)
Author:
gerson bicca
Message:

updates (tank/reboiler/condenser/column)

Location:
branches/gui/eml/stage_separators
Files:
4 edited

Legend:

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

    r719 r721  
    4949        TopTemperature          as temperature  (Brief = "Tray Temperature at Column Top", Default = 300);
    5050        BottomTemperature       as temperature  (Brief = "Tray Temperature at Column Bottom", Default = 330);
    51         LevelFraction           as fraction             (Brief = "Level Fraction");
     51        LevelFraction           as fraction             (Brief = "Tray Level Fraction", Default = 0.5);
    5252
    5353        TopComposition(NComp)           as fraction     (Brief = "Component Molar Fraction at Column Top", Default = 0.30);
    5454        BottomComposition(NComp)        as fraction     (Brief = "Component Molar Fraction at Column Bottom", Default = 0.30);
     55
     56end
     57
     58Model InitializeStage
     59
     60ATTRIBUTES
     61        Pallete = false;
     62        Brief = "Initial conditions for Packed column section.";
     63
     64PARAMETERS
     65        outer NComp             as Integer      (Brief="Number of components");
     66
     67        TopStageTemperature             as temperature  (Brief = "Tray Temperature at Column Top", Default = 300);
     68        BottomStageTemperature          as temperature  (Brief = "Tray Temperature at Column Bottom", Default = 300);
     69       
     70        TopStageComposition(NComp)              as fraction     (Brief = "Component Molar Fraction at Top");
     71        BottomStageComposition(NComp)   as fraction     (Brief = "Component Molar Fraction at Bottom");
     72        LiquidMolarHoldup                               as mol          (Brief="Molar liquid holdup", Default=0.01);
    5573
    5674end
     
    6381        Brief   = "Model of a column section.";
    6482        Info            =
    65 "Model of a basic column section containing a vetor of TRAYS numbered from the top to down.";
     83"Model of a basic column section containing a vetor of TRAYS numbered from the top-down.";
    6684
    6785PARAMETERS
    6886        outer PP                                                        as Plugin                       (Brief="External Physical Properties", Type="PP");
    6987        outer NComp                                             as Integer                      (Brief="Number of components");
     88#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     89# Section Column Feed Tray - Side Streams  Location and Numbering
     90#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    7091        NumberOfTrays                                           as Integer                      (Brief="Number of trays", Default=8);
    7192        FeedTrayIndex(NumberOfTrays)            as Integer                      (Brief="Feed Tray Index", Default=0,Hidden=true);
     
    7798        g                                                                       as acceleration         (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
    7899        Mw(NComp)                                                       as molweight            (Brief="Component Mol Weight",Hidden=true);
    79        
     100#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     101# Section Column Flow Model for Liquid and Vapour
     102#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    80103        VapourFlowModel         as Switcher     (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer");
    81104        LiquidFlowModel         as Switcher     (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default");
    82 
     105#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     106# Section Column Tray Geometry and Auxiliar Parameters
     107#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    83108        VolumeOfTray            as volume               (Brief="Total Volume of the tray");
    84109        HeatSupply                      as heat_rate    (Brief="Rate of heat supply");
    85110        PlateArea                       as area                 (Brief="Plate area = Atray - Adowncomer");
    86 
    87         HolesArea                       as area                         (Brief="Total holes area");
    88         WeirLength                      as length                       (Brief="Weir length");
    89         WeirHeight                      as length                       (Brief="Weir height");
    90         FeeheryCoeff            as Real                         (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1);
    91         ElgueCoeff                      as Real                         (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1);
    92         OlsenCoeff                      as Real                         (Brief="Olsens correlation coefficient", Default=1);
    93         TrayLiquidPasses        as Real                         (Brief="Number of liquid passes in the tray", Default=1);
     111        HolesArea                       as area                 (Brief="Total holes area");
     112        WeirLength                      as length               (Brief="Weir length");
     113        WeirHeight                      as length               (Brief="Weir height");
     114        FeeheryCoeff            as Real                 (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1);
     115        ElgueCoeff                      as Real                 (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1);
     116        OlsenCoeff                      as Real                 (Brief="Olsens correlation coefficient", Default=1);
     117        TrayLiquidPasses        as Real                 (Brief="Number of liquid passes in the tray", Default=1);
    94118       
    95119        V                               as volume               (Brief="Total Volume of the tray",Hidden=true);
    96120        Q                               as heat_rate    (Brief="Rate of heat supply",Hidden=true);
    97         Ap                              as area                         (Brief="Plate area = Atray - Adowncomer",Hidden=true);
    98 
    99         Ah                              as area                         (Brief="Total holes area",Hidden=true);
    100         lw                              as length                       (Brief="Weir length",Hidden=true);
    101         hw                              as length                       (Brief="Weir height",Hidden=true);
    102         beta                    as fraction             (Brief="Aeration fraction");
    103         alfa                    as fraction             (Brief="Dry pressure drop coefficient");
    104         w                               as Real                         (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true);
    105         btray                   as Real                         (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true);
    106         fw                              as Real                         (Brief="Olsens correlation coefficient", Default=1,Hidden=true);
    107         Np                              as Real                         (Brief="Number of liquid passes in the tray", Default=1,Hidden=true);
     121        Ap                              as area                 (Brief="Plate area = Atray - Adowncomer",Hidden=true);
     122        Ah                              as area                 (Brief="Total holes area",Hidden=true);
     123        lw                              as length               (Brief="Weir length",Hidden=true);
     124        hw                              as length               (Brief="Weir height",Hidden=true);
     125        beta                    as fraction     (Brief="Aeration fraction");
     126        alfa                    as fraction     (Brief="Dry pressure drop coefficient");
     127        w                               as Real                 (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true);
     128        btray                   as Real                 (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true);
     129        fw                              as Real                 (Brief="Olsens correlation coefficient", Default=1,Hidden=true);
     130        Np                              as Real                 (Brief="Number of liquid passes in the tray", Default=1,Hidden=true);
    108131       
    109132        VapourFlow      as Switcher     (Valid = ["on", "off"], Default = "on",Hidden=true);
     
    128151
    129152VARIABLES
    130 
    131         INITIALIZATION as InitializeSection;
    132        
    133         in      FeedTray                                as stream                               (Brief="Feed stream", PosX=0, PosY=0.55);
    134        
    135         TRAYS(NumberOfTrays) as tray    (Brief="Number of trays in the Column Section");
    136 
    137         VapourDrawOffFlow  as flow_mol  (Brief = "Stream Molar Flow Rate");
    138         LiquidDrawOffFlow  as flow_mol  (Brief = "Stream Molar Flow Rate");
    139 
    140         MurphreeEff     as Real         (Brief = "Murphree efficiency");
    141        
     153#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     154# Tray Initialization For the Whole Column Section
     155#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     156        INITIALIZATION as InitializeSection (Brief = "Column Model Initialization");
     157#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     158# Column Feed - Side Stream Flow and Murphree Efficiency
     159#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++             
     160        in      FeedTray                                as stream               (Brief="Feed stream", PosX=0, PosY=0.55);
     161                TRAYS(NumberOfTrays)    as tray                 (Brief="Number of trays in the Column Section");
     162                VapourDrawOffFlow               as flow_mol     (Brief="Stream Molar Flow Rate");
     163                LiquidDrawOffFlow               as flow_mol     (Brief="Stream Molar Flow Rate");
     164                MurphreeEff                     as Real                 (Brief="Murphree efficiency for All Trays");
     165
    142166CONNECTIONS
    143 
     167#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     168# Connecting Intermediate Trays
     169#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    144170        TRAYS([2:NumberOfTrays]).OutletV        to TRAYS([1:NumberOfTrays-1]).InletV;
    145171        TRAYS([1:NumberOfTrays-1]).OutletL      to TRAYS([2:NumberOfTrays]).InletL;
    146172       
    147173INITIAL
    148 
     174#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     175# Tray Initialization
     176#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    149177for i in 1:NumberOfTrays do
    150        
     178
    151179"The initial temperature of the TRAYS"
    152180        TRAYS(i).OutletL.T = INITIALIZATION.TopTemperature+(INITIALIZATION.BottomTemperature-INITIALIZATION.TopTemperature)*((i-1)/(NumberOfTrays-1));
     
    154182"The initial Level of the TRAYS"
    155183        TRAYS(i).Level = INITIALIZATION.LevelFraction*hw;
    156 
    157184end
    158185
    159186for i in 1:NComp-1 do
    160        
     187
    161188for j in 1:NumberOfTrays do
    162189
    163190"The initial composition of the TRAYS - Normalized"
    164191        TRAYS(j).OutletL.z(i) = INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) +(INITIALIZATION.BottomComposition(i)/sum(INITIALIZATION.BottomComposition)-INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) )*((j-1)/(NumberOfTrays-1));
    165 
    166192end
    167193
     
    169195
    170196EQUATIONS
    171 # Connecting Trays
     197#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     198# Equating Feed Tray Variables to Trays Variables
     199#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     200"Feed Tray Inlet Flow" 
    172201        FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F;
     202
     203"Feed Tray Inlet Temperature"
    173204        FeedTray.T = TRAYS.Inlet.T;
     205
     206"Feed Tray Inlet Pressure"
    174207        FeedTray.P = TRAYS.Inlet.P;
     208
     209"Feed Tray Inlet Composition"
    175210        FeedTray.z = TRAYS.Inlet.z;
     211
     212"Feed Tray Inlet Vapour Fraction"
    176213        FeedTray.v = TRAYS.Inlet.v;
     214
     215"Feed Tray Inlet Enthalpy"
    177216        FeedTray.h = TRAYS.Inlet.h;
    178        
     217
     218#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     219# Trays Equations
     220#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     221
    179222for i in [1:NumberOfTrays] do
    180223
     
    255298end
    256299
    257 #*----------------------------------------------------------------------
    258 * Model of a  column section with:
    259 *       - NumberOfTrays = number of trays.
    260 *
    261 *---------------------------------------------------------------------*#
    262300Model Section_Column as Section_ColumnBasic
    263301
     
    283321
    284322VARIABLES
    285 
    286         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.35,Protected = true);
    287         out     LiquidDrawOff   as liquid_stream                (Brief="Liquid Outlet in the section", PosX=1, PosY=0.65,Protected = true);
     323#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     324# Section Inlet and Outlet Material Ports
     325#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     326        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Draw Off Port in the section", PosX=1, PosY=0.35,Protected = true);
     327        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Draw Off Port in the section", PosX=1, PosY=0.65,Protected = true);
    288328       
    289329        in      LiquidInlet             as      stream                  (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0);
    290330        out     VapourOutlet    as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0);
    291331       
    292         in      VapourInlet             as stream                               (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1);
    293         out     LiquidOutlet    as liquid_stream                (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1);
    294        
    295         LiquidConnector as stream       (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
    296         VapourConnector as stream       (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
     332        in      VapourInlet             as stream                       (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1);
     333        out     LiquidOutlet    as liquid_stream        (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1);
     334       
     335        LiquidConnector as stream       (Brief="Liquid connection in the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
     336        VapourConnector as stream       (Brief="Vapour connection in the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
    297337
    298338CONNECTIONS
     
    302342
    303343EQUATIONS
    304 
    305         LiquidConnector.F= LiquidInlet.F;
     344#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     345# Equating Inlet Liquid Connector Variables
     346#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     347"Liquid Inlet Flow"     
     348        LiquidConnector.F = LiquidInlet.F;
     349
     350"Liquid Inlet Temperature"             
    306351        LiquidConnector.T = LiquidInlet.T;
     352
     353"Liquid Inlet Pressure"         
    307354        LiquidConnector.P = LiquidInlet.P;
     355
     356"Liquid Inlet Composition"             
    308357        LiquidConnector.z = LiquidInlet.z;
     358
     359"Liquid Inlet Vapour Fraction"         
    309360        LiquidConnector.v = LiquidInlet.v;
     361
     362"Liquid Inlet Enthalpy"         
    310363        LiquidConnector.h = LiquidInlet.h;
    311        
    312         VapourConnector.F= VapourInlet.F;
     364#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     365# Equating Inlet Vapour Connector Variables
     366#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     367"Vapour Inlet Flow"             
     368        VapourConnector.F = VapourInlet.F;
     369
     370"Vapour Inlet Temperature"             
    313371        VapourConnector.T = VapourInlet.T;
     372
     373"Vapour Inlet Pressure"         
    314374        VapourConnector.P = VapourInlet.P;
     375
     376"Vapour Inlet Composition"             
    315377        VapourConnector.z = VapourInlet.z;
     378
     379"Vapour Inlet Vapour Fraction"         
    316380        VapourConnector.v = VapourInlet.v;
     381
     382"Vapour Inlet Enthalpy"         
    317383        VapourConnector.h = VapourInlet.h;
    318        
    319         LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F;
     384#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     385# Equating Outlet Liquid Variables
     386#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     387"Liquid Outlet Flow"   
     388        LiquidOutlet.F = TRAYS(NumberOfTrays).OutletL.F;
     389
     390"Liquid Outlet Temperature"     
    320391        LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T;
     392
     393"Liquid Outlet Pressure"       
    321394        LiquidOutlet.P = TRAYS(NumberOfTrays).OutletL.P;
     395
     396"Liquid Outlet Composition"     
    322397        LiquidOutlet.z = TRAYS(NumberOfTrays).OutletL.z;
    323        
    324         VapourOutlet.F= TRAYS(1).OutletV.F;
     398#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     399# Equating Outlet Vapour Variables
     400#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     401"Vapour Outlet Flow"           
     402        VapourOutlet.F = TRAYS(1).OutletV.F;
     403
     404"Vapour Outlet Temperature"             
    325405        VapourOutlet.T = TRAYS(1).OutletV.T;
     406
     407"Vapour Outlet Pressure"               
    326408        VapourOutlet.P = TRAYS(1).OutletV.P;
     409
     410"Vapour Outlet Composition"             
    327411        VapourOutlet.z = TRAYS(1).OutletV.z;
    328 
     412#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     413# Equating Outlet Vapour Side Stream Variables
     414#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     415"Vapour Draw Off Stream - Flow"         
    329416        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     417
     418"Vapour Draw Off Stream - Temperature"         
    330419        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     420
     421"Vapour Draw Off Stream - Pressure"             
    331422        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     423
     424"Vapour Draw Off Stream - Composition"         
    332425        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
    333426
     427"Vapour Draw Off Stream"       
     428        VapourDrawOffFlow = VapourDrawOff.F;
     429#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     430# Equating Outlet Liquid Side Stream Variables
     431#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     432"Liquid Draw Off Stream - Flow"         
    334433        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     434
     435"Liquid Draw Off Stream - Temperature" 
    335436        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     437
     438"Liquid Draw Off Stream - Pressure"                     
    336439        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     440
     441"Liquid Draw Off Stream - Composition" 
    337442        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    338443
    339         VapourDrawOffFlow = VapourDrawOff.F;
     444"Liquid Draw Off Stream"       
    340445        LiquidDrawOffFlow = LiquidDrawOff.F;
    341446
    342447end
    343448
    344 #*----------------------------------------------------------------------
    345 * Model of a  distillation column containing:
    346 *       - NumberOfTrays like tray;
    347 *       - a kettle reboiler;
    348 *       - dynamic condenser;
    349 *       - a splitter which separate reflux and distillate;
    350 *       - a pump in reflux stream;
    351 *--------------------------------------------------------------------- *#
    352 Model Distillation_kettle_cond as Section_ColumnBasic
     449Model Distillation_kettle_cond  as Section_ColumnBasic
    353450
    354451ATTRIBUTES
     
    384481
    385482VARIABLES
    386         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.46,Protected = true);
    387         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true);
    388        
    389         CONDENSER       as condenser;
     483        out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.375,Protected = true);
     484        out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.42,Protected = true);
     485#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     486# Column Devices
     487#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     488        CONDENSER               as condenser;
    390489        REBOILER                as reboiler;
    391490        SPLITTERtop     as splitter;
    392         PUMP                            as pump;
    393         alfaTopo                                as Real;
    394 
    395         in              HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.94);
    396         in              HeatToCondenser                 as power                                (Brief="Heat supplied to Condenser", PosX=1, PosY=0.10);
    397        
    398         ConnectorHeatReboiler                   as power                                (Brief="Heat supplied to Reboiler", Hidden=true);
    399         ConnectorHeatCondenser                  as power                                (Brief="Heat supplied to Condenser", Hidden=true);
    400 
    401 out     VapourDistillate                                as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.67, PosY=0);
    402 in              ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
    403 
    404 out     LiquidDistillate                                as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.33);
    405 in              ConnectorSplitterOut    as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    406 
    407 out     BottomProduct                           as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=0.99);
    408 in              ConnectorReboilerLout   as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
    409 
     491        PUMP                    as pump;
     492        alfaTopo                as Real;
     493#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     494# Heat Ports
     495#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     496        in      HeatToReboiler  as power (Brief="Heat supplied to Reboiler",Protected = true, PosX=1, PosY=0.90);
     497        in      HeatToCondenser as power (Brief="Heat supplied to Condenser", Protected = true, PosX=1, PosY=0.034);
     498#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     499# Column Connectors
     500#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     501                ConnectorHeatReboiler   as power        (Brief="Heat supplied to Reboiler", Hidden=true);
     502                ConnectorHeatCondenser  as power        (Brief="Heat supplied to Condenser", Hidden=true);
     503        in      ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Condenser", Hidden=true);
     504        in      ConnectorReboilerLout   as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     505        in      ConnectorSplitterOut    as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     506#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     507# Column products
     508#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     509        out     VapourDistillate        as vapour_stream        (Brief="Vapour outlet stream From Condenser", PosX=0.66, PosY=0);
     510        out     LiquidDistillate        as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.20);
     511        out     BottomProduct           as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1);
    410512
    411513EQUATIONS
     
    479581end
    480582
    481 
    482 #* -------------------------------------------------------------------
    483 * Distillation Column model with:
    484 *
    485 *       - NumberOfTrays like tray;
    486 *       - a vessel in the bottom of column;
    487 *       - a splitter who separate the bottom product and the stream to reboiler;
    488 *       - steady state reboiler (thermosyphon);
    489 *       - a steady state condenser with subcooling;
    490 *       - a vessel drum (layed cilinder);
    491 *       - a splitter which separate reflux and distillate;
    492 *       - a pump in reflux stream.
    493 *
    494 * ------------------------------------------------------------------*#
    495 Model Distillation_thermosyphon_subcooling as Section_ColumnBasic
     583Model Distillation_thermosyphon_subcooling      as Section_ColumnBasic
    496584        ATTRIBUTES
    497585        Pallete         = true;
     
    528616
    529617VARIABLES
    530 
     618#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     619# Column Vapour and Liquid Draw Sides
     620#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    531621        out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true);
    532         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.515,Protected = true);
    533 
    534         CONDENSER               as condenserSteady;
    535         TANKtop                                 as tank_cylindrical;
    536         SPLITTERtop             as splitter;
    537         PUMP                                    as pump;
    538         REBOILER                        as reboilerSteady;
    539         TANKbottom                      as tank;
    540         SPLITTERbottom  as splitter;
    541         alfaTopo                                        as Real;
    542 
    543 out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    544 out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    545 out             HeatToBottomVessel      as power                                (Brief="Heat supplied to Bottom Vessel",Hidden=true);
    546 out             HeatToTopVessel         as power                                (Brief="Heat supplied to Top Vessel",Hidden=true);
    547 
    548 out     LiquidDistillate                                as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.30);
    549 in              ConnectorSplitterTop            as stream                       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    550 
    551 out     BottomProduct                                   as liquid_stream        (Brief="Liquid outlet stream From Bottom Splitter", PosX=1, PosY=0.99);
    552 in              ConnectorSplitterBottom         as stream                       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
    553 
     622        out     LiquidDrawOff   as liquid_stream                (Brief="Liquid Outlet in the section", PosX=1, PosY=0.45,Protected = true);
     623#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     624# Column Devices
     625#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     626        CONDENSER                       as condenserSteady      (Brief="steady state condenser with subcooling");
     627        ACCUMULATOR_TOP         as tank_cylindrical     (Brief="vessel drum (layed cilinder)");
     628        SPLITTER_TOP            as splitter                     (Brief="splitter which separate reflux and distillate");
     629        PUMP                            as pump                         (Brief="pump in reflux stream");
     630        REBOILER                        as reboilerSteady       (Brief="steady state reboiler (thermosyphon)");
     631        ACCUMULATOR_BOTTOM      as tank                         (Brief="vessel in the bottom of column");
     632        SPLITTER_BOTTOM         as splitter                     (Brief="splitter who separate the bottom product and the stream to reboiler");
     633        alfaTopo                        as Real;
     634#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     635# Heat Ports
     636#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     637in              HeatToCondenser                 as power        (Brief="Heat supplied to Condenser",PosX=1, PosY=0.065, Protected=true);
     638in              HeatToReboiler                  as power        (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.87,Protected=true);
     639in              HeatToBottomAccumulator as power        (Brief="Heat supplied to Bottom Accumulator",PosX=0, PosY=0.925,Protected=true);
     640in              HeatToTopAccumulator    as power        (Brief="Heat supplied to Top Accumulator", PosX=1, PosY=0.19,Protected=true);
     641#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     642# Column Top and Bottom product
     643#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     644out     LiquidDistillate        as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.24);
     645out     BottomProduct           as liquid_stream        (Brief="Liquid outlet stream From Bottom Splitter", PosX=0.18, PosY=1);
     646#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     647# Column Model Connectors
     648#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     649in      ConnectorSplitterBottom         as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     650in      ConnectorSplitterTop            as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     651
     652        ConnectorHeatReboiler                   as power        (Brief="Connector for Heat supplied to Reboiler", Hidden=true);
     653        ConnectorHeatCondenser                  as power        (Brief="Connector for Heat supplied to Condenser", Hidden=true);
     654        ConnectorHeatTopAccumulator     as power        (Brief="Connector for Heat supplied to Top Accumulator", Hidden=true);
     655        ConnectorHeatBottomAccumulator  as power        (Brief="Connector for Heat supplied to Bottom Accumulator", Hidden=true);
     656       
    554657EQUATIONS
     658# Heat Connector Equations
     659        HeatToCondenser                 =       ConnectorHeatCondenser;
     660        HeatToReboiler                  =       ConnectorHeatReboiler;
     661        HeatToBottomAccumulator =       ConnectorHeatBottomAccumulator;
     662        HeatToTopAccumulator    =       ConnectorHeatTopAccumulator;
    555663
    556664# Top Splitter Connector Equations
     
    595703#vapor
    596704        REBOILER.OutletV        to TRAYS(NumberOfTrays).InletV;
    597         TRAYS(1).OutletV                        to CONDENSER.InletV;
     705        TRAYS(1).OutletV        to CONDENSER.InletV;
    598706
    599707#liquid
    600         CONDENSER.OutletL                               to TANKtop.Inlet;       
    601         TANKtop.Outlet                                                  to SPLITTERtop.Inlet;
    602         SPLITTERtop.Outlet2                             to PUMP.Inlet; 
    603         PUMP.Outlet                                                             to TRAYS(1).InletL;
    604         TRAYS(NumberOfTrays).OutletL    to TANKbottom.Inlet;
    605         TANKbottom.Outlet                                       to SPLITTERbottom.Inlet;
    606         SPLITTERbottom.Outlet2                          to REBOILER.InletL;
     708        CONDENSER.OutletL                               to ACCUMULATOR_TOP.Inlet;       
     709        ACCUMULATOR_TOP.Outlet                  to SPLITTER_TOP.Inlet;
     710        SPLITTER_TOP.Outlet2                    to PUMP.Inlet; 
     711        PUMP.Outlet                                     to TRAYS(1).InletL;
     712        TRAYS(NumberOfTrays).OutletL    to ACCUMULATOR_BOTTOM.Inlet;
     713        ACCUMULATOR_BOTTOM.Outlet               to SPLITTER_BOTTOM.Inlet;
     714        SPLITTER_BOTTOM.Outlet2                 to REBOILER.InletL;
    607715
    608716#Connectors
    609 HeatToCondenser                         to CONDENSER.InletQ;
    610 HeatToReboiler                          to REBOILER.InletQ;
    611 HeatToBottomVessel      to TANKbottom.InletQ;
    612 HeatToTopVessel                 to TANKtop.InletQ;
    613 SPLITTERtop.Outlet1     to ConnectorSplitterTop;
    614 SPLITTERbottom.Outlet1  to ConnectorSplitterBottom;
    615 
    616 end
    617 
    618 
    619 #* -------------------------------------------------------------------
    620 * Distillation Column model with:
    621 *
    622 *       - NumberOfTrays like tray;
    623 *       - a vessel in the bottom of column;
    624 *       - a splitter who separate the bottom product and the stream to reboiler;
    625 *       - steady state reboiler (thermosyphon);
    626 *       - a dynamic condenser without subcooling;
    627 *       - a splitter which separate reflux and distillate;
    628 *       - a pump in reflux stream.
    629 *
    630 * ------------------------------------------------------------------*#
     717        ConnectorHeatCondenser                  to CONDENSER.InletQ;
     718        ConnectorHeatReboiler                   to REBOILER.InletQ;
     719        ConnectorHeatBottomAccumulator  to ACCUMULATOR_BOTTOM.InletQ;
     720        ConnectorHeatTopAccumulator             to ACCUMULATOR_TOP.InletQ;
     721        SPLITTER_TOP.Outlet1                    to ConnectorSplitterTop;
     722        SPLITTER_BOTTOM.Outlet1                 to ConnectorSplitterBottom;
     723
     724end
     725
    631726Model Distillation_thermosyphon_cond as Section_ColumnBasic
    632727        ATTRIBUTES
     
    662757
    663758VARIABLES
    664 
    665         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true);
    666         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.515,Protected = true);
    667        
    668         CONDENSER as condenser;
    669         SPLITTERtop             as splitter;
    670         PUMP            as pump;
    671         TANKbottom      as tank;
    672         SPLITTERbottom  as splitter;
    673         REBOILER        as reboilerSteady;
     759#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     760# Column Vapour and Liquid Draw Sides
     761#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     762        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Outlet in the section", PosX=1, PosY=0.379,Protected = true);
     763        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.425,Protected = true);
     764#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     765# Column Devices
     766#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     767        CONDENSER                       as condenser            (Brief="dynamic condenser without subcooling");
     768        SPLITTER_TOP            as splitter                     (Brief="splitter which separate reflux and distillate");
     769        PUMP                            as pump                         (Brief="pump in reflux stream");
     770        ACCUMULATOR_BOTTOM      as tank                         (Brief="vessel in the bottom of column");
     771        SPLITTER_BOTTOM         as splitter                     (Brief="splitter who separate the bottom product and the stream to reboiler");
     772        REBOILER                        as reboilerSteady       (Brief="steady state reboiler (thermosyphon)");
    674773        alfaTopo                        as Real;
    675 
    676 out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    677 out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    678 out             HeatToBottomVessel      as power                                (Brief="Heat supplied to Bottom Vessel",Hidden=true);
    679 
    680 out     VapourDistillate                                as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.74, PosY=0);
    681 in              ConnectorCondenserVout  as stream                               (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
    682 
    683 out     LiquidDistillate                                as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.30);
    684 in              ConnectorSplitterTop    as stream                       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    685 
    686 out     BottomProduct                                   as liquid_stream        (Brief="Liquid outlet stream From Bottom Splitter", PosX=1, PosY=0.999);
    687 in              ConnectorSplitterBottom         as stream                       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     774#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     775# Heat Ports
     776#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     777in      HeatToCondenser                 as power        (Brief="Heat supplied to Condenser",PosX=1, PosY=0.035, Protected=true);
     778in      HeatToReboiler                  as power        (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.865,Protected=true);
     779in      HeatToBottomAccumulator as power        (Brief="Heat supplied to Bottom Accumulator",PosX=0, PosY=0.92,Protected=true);
     780#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     781# Column Top and Bottom product
     782#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     783out     VapourDistillate        as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.665, PosY=0);
     784out     LiquidDistillate        as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.20);
     785out     BottomProduct           as liquid_stream        (Brief="Liquid outlet stream From Bottom Splitter", PosX=0.18, PosY=1);
     786#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     787# Column Model Connectors
     788#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     789in      ConnectorSplitterBottom as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     790in      ConnectorSplitterTop    as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     791in      ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
     792
     793        ConnectorHeatReboiler                   as power        (Brief="Connector for Heat supplied to Reboiler", Hidden=true);
     794        ConnectorHeatCondenser                  as power        (Brief="Connector for Heat supplied to Condenser", Hidden=true);
     795        ConnectorHeatBottomAccumulator  as power        (Brief="Connector for Heat supplied to Bottom Accumulator", Hidden=true);
    688796
    689797EQUATIONS
     798# Heat Connector Equations
     799        HeatToCondenser                 =       ConnectorHeatCondenser;
     800        HeatToReboiler                  =       ConnectorHeatReboiler;
     801        HeatToBottomAccumulator =       ConnectorHeatBottomAccumulator;
    690802
    691803# Condenser Connector Equations
     
    737849
    738850#liquid
    739         CONDENSER.OutletL               to SPLITTERtop.Inlet;   
    740         SPLITTERtop.Outlet2                             to PUMP.Inlet;
     851        CONDENSER.OutletL               to SPLITTER_TOP.Inlet; 
     852        SPLITTER_TOP.Outlet2                            to PUMP.Inlet;
    741853        PUMP.Outlet                                     to TRAYS(1).InletL;
    742         TRAYS(NumberOfTrays).OutletL    to TANKbottom.Inlet;
    743         TANKbottom.Outlet                               to SPLITTERbottom.Inlet;
    744         SPLITTERbottom.Outlet2                  to REBOILER.InletL;
     854        TRAYS(NumberOfTrays).OutletL    to ACCUMULATOR_BOTTOM.Inlet;
     855        ACCUMULATOR_BOTTOM.Outlet                               to SPLITTER_BOTTOM.Inlet;
     856        SPLITTER_BOTTOM.Outlet2                         to REBOILER.InletL;
    745857
    746858#Connectors
    747 HeatToCondenser                         to CONDENSER.InletQ;
    748 HeatToReboiler                          to REBOILER.InletQ;
    749 HeatToBottomVessel      to TANKbottom.InletQ;
    750 CONDENSER.OutletV to ConnectorCondenserVout;
    751 SPLITTERtop.Outlet1             to ConnectorSplitterTop;
    752 SPLITTERbottom.Outlet1  to ConnectorSplitterBottom;
    753 
    754 end
    755 
    756 #* -------------------------------------------------------------------
    757 * Distillation Column model with:
    758 *
    759 *       - NumberOfTrays like tray;
    760 *       - a kettle reboiler;
    761 *       - a steady state condenser with subcooling;
    762 *       - a vessel drum (layed cilinder);
    763 *       - a splitter which separate reflux and distillate;
    764 *       - a pump in reflux stream.
    765 *
    766 * ------------------------------------------------------------------*#
     859ConnectorHeatCondenser                  to CONDENSER.InletQ;
     860ConnectorHeatReboiler                   to REBOILER.InletQ;
     861ConnectorHeatBottomAccumulator  to ACCUMULATOR_BOTTOM.InletQ;
     862CONDENSER.OutletV                               to ConnectorCondenserVout;
     863SPLITTER_TOP.Outlet1                    to ConnectorSplitterTop;
     864SPLITTER_BOTTOM.Outlet1                 to ConnectorSplitterBottom;
     865
     866end
     867
    767868Model Distillation_kettle_subcooling as Section_ColumnBasic
    768869
     
    800901
    801902VARIABLES
    802         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.46,Protected = true);
    803         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true);
    804        
    805         CONDENSER as condenserSteady;
    806         TANKtop as tank_cylindrical;
    807         SPLITTERtop             as splitter;
    808         PUMP            as pump;
    809         REBOILER        as reboiler;
    810         alfaTopo as Real;
    811 
    812 out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    813 out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    814 out             HeatToTopVessel         as power                                (Brief="Heat supplied to Top Vessel",Hidden=true);
    815 
    816 out     LiquidDistillate                                as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.33);
    817 in              ConnectorSplitterOut    as stream                       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    818 
    819 out     BottomProduct                           as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=1);
    820 in              ConnectorReboilerLout   as stream                       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
    821 
    822 RebNoFlow       as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true);
     903#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     904# Column Vapour and Liquid Draw Sides
     905#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     906        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true);
     907        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.45,Protected = true);
     908#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     909# Column Devices
     910#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     911        CONDENSER               as condenserSteady      (Brief="steady state condenser with subcooling");
     912        ACCUMULATOR             as tank_cylindrical     (Brief="vessel drum (layed cilinder)");
     913        SPLITTER                as splitter                     (Brief="splitter which separate reflux and distillate");
     914        PUMP                    as pump                         (Brief="pump in reflux stream");
     915        REBOILER                as reboiler                     (Brief="kettle reboiler");
     916        alfaTopo                as Real;
     917#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     918# Heat Ports
     919#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     920in              HeatToCondenser         as power        (Brief="Heat supplied to Condenser", PosX=1, PosY=0.065, Protected=true);
     921in              HeatToReboiler          as power        (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.905, Protected=true);
     922in              HeatToAccumulator       as power        (Brief="Heat supplied to Top Vessel", PosX=1, PosY=0.195, Protected=true);
     923#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     924# Column Model Connectors
     925#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     926in      ConnectorSplitterOut            as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     927in      ConnectorReboilerLout           as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     928        ConnectorHeatReboiler           as power        (Brief="Connector for Heat supplied to Reboiler", Hidden=true);
     929        ConnectorHeatCondenser          as power        (Brief="Connector for Heat supplied to Condenser", Hidden=true);
     930        ConnectorHeatAccumulator        as power        (Brief="Connector for Heat supplied to TopVessel", Hidden=true);
     931#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     932# Column Top and Bottom product
     933#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     934out     LiquidDistillate as liquid_stream       (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.24);
     935out     BottomProduct    as liquid_stream       (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1);
    823936
    824937EQUATIONS
     938
     939#Heat Connectors
     940HeatToCondenser         = ConnectorHeatCondenser;
     941HeatToReboiler          = ConnectorHeatReboiler;
     942HeatToAccumulator       = ConnectorHeatAccumulator;
    825943
    826944# Splitter Connector Equations
     
    866984
    867985#liquid
    868         CONDENSER.OutletL               to TANKtop.Inlet;       
    869         TANKtop.Outlet                                  to SPLITTERtop.Inlet;
    870         SPLITTERtop.Outlet2                             to PUMP.Inlet; 
     986        CONDENSER.OutletL                               to ACCUMULATOR.Inlet;   
     987        ACCUMULATOR.Outlet                                      to SPLITTER.Inlet;
     988        SPLITTER.Outlet2                        to PUMP.Inlet; 
    871989        PUMP.Outlet                                     to TRAYS(1).InletL;
    872990        TRAYS(NumberOfTrays).OutletL    to REBOILER.InletL;
    873991
    874992#Connectors
    875 HeatToCondenser                         to CONDENSER.InletQ;
    876 HeatToReboiler                          to REBOILER.InletQ;
    877 HeatToTopVessel                         to TANKtop.InletQ;
    878 
    879 SPLITTERtop.Outlet1             to ConnectorSplitterOut;
     993ConnectorHeatCondenser          to CONDENSER.InletQ;
     994ConnectorHeatReboiler           to REBOILER.InletQ;
     995ConnectorHeatAccumulator        to ACCUMULATOR.InletQ;
     996
     997SPLITTER.Outlet1 to ConnectorSplitterOut;
    880998REBOILER.OutletL        to ConnectorReboilerLout;
    881999
    8821000end
    8831001
    884 
    885 #*----------------------------------------------------------------------
    886 * Model of a  rectifier containing:
    887 *       - NumberOfTrays like tray;
    888 *       - dymamic condenser without subcooling;
    889 *       - a splitter which separate reflux and distillate;
    890 *       - a pump in reflux stream;
    891 *---------------------------------------------------------------------*#
    8921002Model Rectifier as Section_ColumnBasic
    8931003
     
    9201030
    9211031VARIABLES
    922 
    923         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.46,Protected = true);
    924         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true);
    925        
    926         CONDENSER as condenser;
    927         SPLITTERtop as splitter;
    928         PUMP as pump;
    929         alfaTopo as Real;
    930 
    931 out     VapourDistillate                                as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.67, PosY=0);
    932 in              ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
    933         in              VapourInlet             as stream                               (Brief="Vapour Inlet in the section", PosX=0.07, PosY=1);
    934         out     LiquidOutlet            as liquid_stream                (Brief="Liquid Outlet in the section", PosX=0.20, PosY=1);
    935         out     LiquidDistillate                                as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.33);
    936        
    937         out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    938         in              ConnectorSplitterOut    as stream                       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    939         VapourConnector as stream       (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
     1032#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1033# Column Vapour and Liquid Draw Sides
     1034#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1035        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Outlet in the section", PosX=1, PosY=0.45,Protected = true);
     1036        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.50,Protected = true);
     1037#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1038# Column Devices
     1039#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1040        CONDENSER       as condenser    (Brief="dymamic condenser without subcooling");
     1041        SPLITTER        as splitter             (Brief="splitter which separate reflux and distillate");
     1042        PUMP            as pump                 (Brief="pump in reflux stream");
     1043        alfaTopo        as Real;
     1044#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1045# Column Top product
     1046#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1047        out     VapourDistillate        as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.66, PosY=0);
     1048        out     LiquidDistillate        as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.24);
     1049#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1050# Heat Port
     1051#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1052        in      HeatToCondenser         as power (Brief="Heat supplied to Condenser",PosX=1, PosY=0.04, Protected = true);
     1053#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1054# Column Bottom Outlets
     1055#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1056        in      VapourInlet             as stream                       (Brief="Vapour Inlet in the section", PosX=0.07, PosY=1);
     1057        out     LiquidOutlet    as liquid_stream        (Brief="Liquid Outlet in the section", PosX=0.32, PosY=1);
     1058#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1059# Column Model Connectors
     1060#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1061        in      ConnectorSplitterOut    as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     1062        in      ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
     1063                VapourConnector                 as stream       (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
     1064                ConnectorHeatCondenser  as power        (Brief="Connector for Heat supplied to Condenser", Hidden=true);
    9401065       
    9411066EQUATIONS
     
    9541079end     
    9551080
     1081HeatToCondenser = ConnectorHeatCondenser;
     1082
    9561083# Condenser Connector Equations
    9571084        ConnectorCondenserVout.T = VapourDistillate.T;
     
    9961123
    9971124#liquid
    998         CONDENSER.OutletL to SPLITTERtop.Inlet;
    999         SPLITTERtop.Outlet2 to PUMP.Inlet;     
    1000         PUMP.Outlet to TRAYS(1).InletL;
     1125        CONDENSER.OutletL       to SPLITTER.Inlet;     
     1126        SPLITTER.Outlet2        to PUMP.Inlet; 
     1127        PUMP.Outlet             to TRAYS(1).InletL;
    10011128
    10021129#Connectors
    1003 HeatToCondenser         to CONDENSER.InletQ;
    1004 VapourConnector to TRAYS(NumberOfTrays).InletV;
    1005 SPLITTERtop.Outlet1             to ConnectorSplitterOut;
    1006 CONDENSER.OutletV to ConnectorCondenserVout;
    1007 
    1008 end
    1009 
    1010 
    1011 #* -------------------------------------------------------------------
    1012 * Rectifier Column with:
    1013 *
    1014 *       - NumberOfTrays like tray;
    1015 *       - a steady state condenser with subcooling;
    1016 *       - a vessel drum (layed cilinder);
    1017 *       - a splitter which separate reflux and distillate;
    1018 *       - a pump in reflux stream.
    1019 *
    1020 * ------------------------------------------------------------------*#
     1130ConnectorHeatCondenser  to CONDENSER.InletQ;
     1131VapourConnector                 to TRAYS(NumberOfTrays).InletV;
     1132SPLITTER.Outlet1                to ConnectorSplitterOut;
     1133CONDENSER.OutletV               to ConnectorCondenserVout;
     1134
     1135end
    10211136
    10221137Model Rectifier_subcooling as Section_ColumnBasic
     
    10511166
    10521167VARIABLES
    1053         CONDENSER as condenserSteady;
    1054         TANKtop                 as tank_cylindrical;
    1055         SPLITTERtop             as splitter;
    1056         PUMP            as pump;
    1057         alfaTopo                        as Real;
    1058 
    1059         in              VapourInlet             as stream                               (Brief="Vapour Inlet in the section", PosX=0.18, PosY=1);
    1060         out     LiquidOutlet            as liquid_stream                (Brief="Liquid Outlet in the section", PosX=0.25, PosY=1);
    1061 
    1062         out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    1063         out     LiquidDistillate                                as liquid_stream                (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.47);
    1064         in              ConnectorSplitterTop            as stream                               (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    1065         out             HeatToTopVessel         as power                                (Brief="Heat supplied to Top Vessel",Hidden=true);
    1066 
    1067         VapourConnector as stream               (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
     1168#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1169# Column Vapour and Liquid Draw Sides
     1170#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1171        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Outlet in the section", PosX=1, PosY=0.485,Protected = true);
     1172        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.535,Protected = true);
     1173#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1174# Column Devices
     1175#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1176        CONDENSER               as condenserSteady      (Brief="steady state condenser with subcooling");
     1177        ACCUMULATOR             as tank_cylindrical     (Brief="vessel drum (layed cilinder)");
     1178        SPLITTER                as splitter                     (Brief="plitter which separate reflux and distillate");
     1179        PUMP                    as pump                         (Brief="pump in reflux stream");
     1180        alfaTopo                as Real;
     1181#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1182# Column Bottom outlets
     1183#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1184        in      VapourInlet             as stream                       (Brief="Vapour Inlet in the section", PosX=0.07, PosY=1);
     1185        out     LiquidOutlet    as liquid_stream        (Brief="Liquid Outlet in the section", PosX=0.32, PosY=1);
     1186#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1187# Heat Ports
     1188#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1189        in      HeatToCondenser         as power        (Brief="Heat supplied to Condenser", PosX=1, PosY=0.070, Protected=true);
     1190        in      HeatToAccumulator       as power        (Brief="Heat supplied to Top Accumulator", PosX=1, PosY=0.23, Protected=true);
     1191#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1192# Column Top Product
     1193#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1194        out     LiquidDistillate                as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.285);
     1195#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1196# Column Connectors
     1197#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1198in      ConnectorSplitterTop            as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     1199        VapourConnector                         as stream       (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
     1200        ConnectorHeatCondenser          as power        (Brief="Connector for Heat supplied to Condenser", Hidden=true);
     1201        ConnectorHeatAccumulator        as power        (Brief="Connector for Heat supplied to Top Accumulator", Hidden=true);
    10681202
    10691203EQUATIONS
    1070 
     1204#Heat Connectors
     1205        HeatToCondenser         = ConnectorHeatCondenser;
     1206        HeatToAccumulator       = ConnectorHeatAccumulator;
     1207       
    10711208        LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F;
    10721209        LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T;
     
    11051242
    11061243#liquid
    1107         CONDENSER.OutletL               to TANKtop.Inlet;       
    1108         TANKtop.Outlet                                  to SPLITTERtop.Inlet;
    1109         SPLITTERtop.Outlet2             to PUMP.Inlet; 
     1244        CONDENSER.OutletL               to ACCUMULATOR.Inlet;   
     1245        ACCUMULATOR.Outlet                                      to SPLITTER.Inlet;
     1246        SPLITTER.Outlet2                to PUMP.Inlet; 
    11101247        PUMP.Outlet                                             to TRAYS(1).InletL;
    11111248
    11121249#Connectors
    11131250        VapourConnector                         to TRAYS(NumberOfTrays).InletV;
    1114         HeatToCondenser                         to CONDENSER.InletQ;
    1115         SPLITTERtop.Outlet1     to ConnectorSplitterTop;
    1116         HeatToTopVessel                 to TANKtop.InletQ;
    1117 
    1118 end
    1119 
    1120 
    1121 #* -------------------------------------------------------------------
    1122 * Reboiled Stripping Column model with:
    1123 *
    1124 *       - NumberOfTrays like tray;
    1125 *       - a kettle reboiler;
    1126 *
    1127 * ------------------------------------------------------------------*#
     1251        ConnectorHeatCondenser                  to CONDENSER.InletQ;
     1252        SPLITTER.Outlet1        to ConnectorSplitterTop;
     1253        ConnectorHeatAccumulator                        to ACCUMULATOR.InletQ;
     1254
     1255end
     1256
    11281257Model Reboiled_Stripping_kettle as Section_ColumnBasic
    11291258       
     
    11521281
    11531282VARIABLES
    1154 
    1155         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.34,Protected = true);
    1156         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.49,Protected = true);
    1157        
    1158         in              LiquidInlet                                             as      stream                  (Brief="Liquid Inlet in the section", PosX=0.20, PosY=0);
    1159         out     VapourOutlet                                    as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.05, PosY=0);
    1160         out     BottomProduct                           as liquid_stream                (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=1);
    1161         in              ConnectorReboilerLout   as stream                               (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
    1162         out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    1163        
    1164         LiquidConnector as stream                               (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
    1165         RebNoFlow               as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true);
    1166        
    1167         REBOILER as reboiler;
     1283#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1284# Column Vapour and Liquid Draw Sides
     1285#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1286        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Outlet in the section", PosX=1, PosY=0.28,Protected = true);
     1287        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.33,Protected = true);
     1288#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1289# Column Devices
     1290#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
     1291        REBOILER as reboiler (Brief="Kettle Reboiler");
     1292#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1293# Heat Port
     1294#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1295        in      HeatToReboiler  as power        (Brief="Heat supplied to Reboiler",PosX=1, PosY=0.865,Protected=true);
     1296#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1297# Column Top Outlets
     1298#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++             
     1299        in      LiquidInlet             as      stream                  (Brief="Liquid Inlet in the section", PosX=0.30, PosY=0);
     1300        out     VapourOutlet    as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.07, PosY=0);
     1301#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1302# Column Bottom Product
     1303#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1304        out     BottomProduct   as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=0.68, PosY=1);
     1305#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1306# Column Connectors
     1307#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1308        in      ConnectorReboilerLout   as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     1309                LiquidConnector                 as stream       (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
     1310                ConnectorHeatReboiler   as power        (Brief="Connector for Heat supplied to Reboiler", Hidden=true);
    11681311
    11691312CONNECTIONS
     
    11751318
    11761319#Connectors
    1177 REBOILER.OutletL        to ConnectorReboilerLout;
     1320REBOILER.OutletL                to ConnectorReboilerLout;
    11781321LiquidConnector                 to TRAYS(1).InletL;
    1179 HeatToReboiler                  to REBOILER.InletQ;
     1322ConnectorHeatReboiler   to REBOILER.InletQ;
    11801323
    11811324EQUATIONS
    1182 
     1325#Heat Connectors
     1326        HeatToReboiler = ConnectorHeatReboiler;
     1327       
    11831328        LiquidConnector.F= LiquidInlet.F;
    11841329        LiquidConnector.T = LiquidInlet.T;
     
    12141359end
    12151360
    1216 
    1217 #* -------------------------------------------------------------------
    1218 * Reboiled Stripping Column model with:
    1219 *
    1220 *       - NumberOfTrays like tray;
    1221 *       - a vessel in the bottom of column;
    1222 *       - a splitter which separate the bottom product and the stream to reboiler;
    1223 *       - steady state reboiler (thermosyphon);
    1224 *
    1225 * ------------------------------------------------------------------*#
    12261361Model Reboiled_Stripping_thermosyphon as Section_ColumnBasic
    12271362
     
    12491384* (NoComps - 1) OutletL (OR OutletV) compositions.
    12501385";
    1251        
     1386
    12521387VARIABLES
    1253         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.32,Protected = true);
    1254         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.44,Protected = true);
    1255        
    1256         in              LiquidInlet                                             as      stream                  (Brief="Liquid Inlet in the section", PosX=0.32, PosY=0);
    1257         out     VapourOutlet                                    as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.20, PosY=0);
    1258         out     BottomProduct                           as liquid_stream                (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=1);
    1259         LiquidConnector                                         as stream                               (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
    1260         out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    1261         out             HeatToTANKbottom        as power                                (Brief="Heat supplied to Bottom Vessel",Hidden=true);
    1262         in              ConnectorSplitterBottom         as stream                       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
    1263        
    1264         REBOILER                                as reboilerSteady;
    1265         SPLITTERbottom  as splitter;
    1266         TANKbottom                      as tank;
     1388#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1389# Column Vapour and Liquid Draw Sides
     1390#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1391        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Outlet in the section", PosX=1, PosY=0.28,Protected = true);
     1392        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.33,Protected = true);
     1393#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1394# Column Devices
     1395#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1396        REBOILER                as reboilerSteady       (Brief="steady state reboiler (thermosyphon)");
     1397        SPLITTER                as splitter             (Brief="splitter which separate the bottom product and the stream to reboiler");
     1398        ACCUMULATOR     as tank                         (Brief="vessel in the bottom of column");
     1399#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1400# Heat Ports
     1401#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1402        in      HeatToReboiler          as power        (Brief="Heat supplied to Reboiler",PosX=1, PosY=0.84,Protected=true);
     1403        in      HeatToAccumulator       as power        (Brief="Heat supplied to Bottom Vessel",PosX=0, PosY=0.91,Protected=true);
     1404#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1405# Column Top Outlets
     1406#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1407        in      LiquidInlet             as      stream                  (Brief="Liquid Inlet in the section", PosX=0.32, PosY=0);
     1408        out     VapourOutlet    as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.07, PosY=0);
     1409#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1410# Column Bottom Product
     1411#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1412        out     BottomProduct   as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=0.19, PosY=1);
     1413        LiquidConnector         as stream                       (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
     1414#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1415# Column Connectors
     1416#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1417        in      ConnectorSplitterBottom         as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     1418        ConnectorHeatReboiler                   as power        (Brief="Connector for Heat supplied to Reboiler", Hidden=true);
     1419        ConnectorHeatAccumulator                as power        (Brief="Connector for Heat supplied to Bottom Accumulator", Hidden=true);
    12671420
    12681421CONNECTIONS
     
    12711424       
    12721425#liquid
    1273         TRAYS(NumberOfTrays).OutletL                            to TANKbottom.Inlet;
    1274         TANKbottom.Outlet                                                               to SPLITTERbottom.Inlet;
    1275         SPLITTERbottom.Outlet2                                          to REBOILER.InletL;
     1426        TRAYS(NumberOfTrays).OutletL    to ACCUMULATOR.Inlet;
     1427        ACCUMULATOR.Outlet                              to SPLITTER.Inlet;
     1428        SPLITTER.Outlet2                                to REBOILER.InletL;
    12761429
    12771430#Connectors
    1278 LiquidConnector                                 to TRAYS(1).InletL;
    1279 HeatToReboiler                                  to REBOILER.InletQ;
    1280 HeatToTANKbottom                        to TANKbottom.InletQ;
    1281 SPLITTERbottom.Outlet1 to ConnectorSplitterBottom;
     1431LiquidConnector                         to TRAYS(1).InletL;
     1432ConnectorHeatReboiler           to REBOILER.InletQ;
     1433ConnectorHeatAccumulator        to ACCUMULATOR.InletQ;
     1434SPLITTER.Outlet1                        to ConnectorSplitterBottom;
    12821435
    12831436EQUATIONS
    1284 
     1437#Heat Connectors
     1438        HeatToReboiler  = ConnectorHeatReboiler;
     1439        HeatToAccumulator       = ConnectorHeatAccumulator;
     1440       
    12851441        ConnectorSplitterBottom.T = BottomProduct.T;
    12861442        ConnectorSplitterBottom.P = BottomProduct.P;
     
    13121468        VapourDrawOffFlow = VapourDrawOff.F;
    13131469        LiquidDrawOffFlow = LiquidDrawOff.F;
    1314        
    1315 end
    1316 
    1317 #* -------------------------------------------------------------------
    1318 *  Reactive Distillation Column
    1319 *
    1320 * ------------------------------------------------------------------*#
     1470
     1471end
     1472
    13211473Model ReactiveDistillation
    13221474       
     
    13511503       
    13521504PARAMETERS
    1353        
    1354         outer PP as Plugin(Type="PP");
    1355         outer NComp as Integer;
    1356 
    1357         NumberOfTrays as Integer(Brief="Number of TRAYS", Default=2);
    1358 
    1359         FeedTrayIndex(NumberOfTrays)                    as Integer                      (Brief="Number of trays", Default=0,Hidden=true);
    1360         LiqSideTrayIndex(NumberOfTrays)                 as Integer                      (Brief="Number of trays", Default=0,Hidden=true);
    1361         VapSideTrayIndex(NumberOfTrays)         as Integer                      (Brief="Number of trays", Default=0,Hidden=true);
    1362         FeedTrayLocation                                                                        as Integer                      (Brief="Feed tray Location", Default=2);
    1363         LiquidSideStreamLocation                                                as Integer                      (Brief="Liquid Side Stream Location", Default=2);
    1364         VapourSideStreamLocation                                        as Integer                      (Brief="Vapour Side Stream Location", Default=2);
    1365 
    1366         alfacond as Real;
    1367 
    1368         VapourFlow                      as Switcher     (Valid = ["on", "off"], Default = "off",Hidden=true);
     1505        outer PP        as Plugin       (Type="PP");
     1506        outer NComp as Integer  (Brief="Number of Components");
     1507#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1508# Section Column Feed Tray - Side Streams  Location and Numbering
     1509#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1510        NumberOfTrays                                           as Integer      (Brief="Number of TRAYS", Default=2);
     1511        FeedTrayIndex(NumberOfTrays)            as Integer      (Brief="Feed Tray Index", Default=0,Hidden=true);
     1512        LiqSideTrayIndex(NumberOfTrays)         as Integer      (Brief="Liquid Side Tray Index", Default=0,Hidden=true);
     1513        VapSideTrayIndex(NumberOfTrays)         as Integer      (Brief="Vapour Side Tray Index", Default=0,Hidden=true);
     1514        FeedTrayLocation                                        as Integer      (Brief="Feed tray Location", Default=2);
     1515        LiquidSideStreamLocation                        as Integer      (Brief="Liquid Side Stream Location", Default=2);
     1516        VapourSideStreamLocation                        as Integer      (Brief="Vapour Side Stream Location", Default=2);
     1517#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1518# Section Column Flow Model for Liquid and Vapour
     1519#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1520        VapourFlow              as Switcher     (Valid = ["on", "off"], Default = "off",Hidden=true);
    13691521        TrayVapourFlow  as Switcher     (Valid = ["on", "off"], Default = "off",Hidden=true);
    1370         TrayLiquidFlow          as Switcher     (Valid = ["on", "off"], Default = "off",Hidden=true);
    1371 
    1372         V       as volume                               (Brief="Total Volume of the tray",Hidden=true);
    1373         Q       as power                                (Brief="Rate of heat supply",Hidden=true);
    1374         Ap      as area                                         (Brief="Plate area = Atray - Adowncomer",Hidden=true);
    1375         Ah      as      area                            (Brief="Total holes area",Hidden=true);
    1376         lw      as      length                          (Brief="Weir length",Hidden=true);
    1377         g               as acceleration                 (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
    1378         hw      as      length                          (Brief="Weir height",Hidden=true);
    1379         beta as         fraction                        (Brief="Aeration fraction");
    1380         alfa    as      fraction                        (Brief="Dry pressure drop coefficient");
     1522        TrayLiquidFlow  as Switcher     (Valid = ["on", "off"], Default = "off",Hidden=true);
     1523        alfacond                as Real;
     1524#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1525# Section Column Tray Geometry and Auxiliar Parameters
     1526#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1527        V               as volume               (Brief="Total Volume of the tray",Hidden=true);
     1528        Q               as power                (Brief="Rate of heat supply",Hidden=true);
     1529        Ap              as area                 (Brief="Plate area = Atray - Adowncomer",Hidden=true);
     1530        Ah              as area                 (Brief="Total holes area",Hidden=true);
     1531        lw              as length               (Brief="Weir length",Hidden=true);
     1532        g               as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
     1533        hw              as length               (Brief="Weir height",Hidden=true);
     1534        beta    as fraction     (Brief="Aeration fraction");
     1535        alfa    as fraction     (Brief="Dry pressure drop coefficient");
    13811536
    13821537        VolumeOfTray            as volume               (Brief="Total Volume of the tray");
    13831538        HeatSupply                      as heat_rate    (Brief="Rate of heat supply");
    1384         PlateArea                               as area                         (Brief="Plate area = Atray - Adowncomer");
    1385         HolesArea                               as area                         (Brief="Total holes area");
    1386         WeirLength                              as length               (Brief="Weir length");
    1387         WeirHeight                              as length               (Brief="Weir height");
     1539        PlateArea                       as area                 (Brief="Plate area = Atray - Adowncomer");
     1540        HolesArea                       as area                 (Brief="Total holes area");
     1541        WeirLength                      as length               (Brief="Weir length");
     1542        WeirHeight                      as length               (Brief="Weir height");
    13881543
    13891544        stoic(NComp)    as Real(Brief="Stoichiometric matrix");
    13901545        Hr                                              as energy_mol;
    13911546       
    1392         TopTemperature                  as temperature;
    1393         TbottomTemperature      as temperature;
    1394         LevelFraction                                   as fraction     (Brief = "Level Fraction");
    1395 
    1396         TopComposition(NComp)                           as fraction     (Brief = "Component Molar Fraction at Top");
    1397         BottomComposition(NComp)                as fraction     (Brief = "Component Molar Fraction at Bottom");
    1398        
    13991547SET
    14001548
    1401         FeedTrayIndex(FeedTrayLocation)                 =1;
     1549        FeedTrayIndex(FeedTrayLocation)         =1;
    14021550        VapSideTrayIndex(FeedTrayLocation)      =1;
    14031551        LiqSideTrayIndex(FeedTrayLocation)      =1;
     
    14111559       
    14121560VARIABLES
    1413        
    1414         in      FeedTray                        as stream                               (Brief="Feed stream", PosX=0, PosY=0.55);
    1415        
    1416         VapourDrawOffFlow  as flow_mol          (Brief = "Stream Molar Flow Rate");
    1417         LiquidDrawOffFlow   as flow_mol                         (Brief = "Stream Molar Flow Rate");
    1418         MurphreeEff                     as Real         (Brief = "Murphree efficiency");
    1419 
    1420         out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.50,Protected = true);
    1421         out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.61,Protected = true);
    1422        
    1423         RebNoFlow       as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true);
    1424        
    1425         in              HeatToReboiler                          as power                                (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.94);
    1426         in              HeatToCondenser                 as power                                (Brief="Heat supplied to Condenser", PosX=1, PosY=0.19);
    1427 
     1561#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1562# Tray Initialization For the Whole Column Section
     1563#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1564        INITIALIZATION          as InitializeSection    (Brief = "Column Model Initialization");
     1565#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1566# Column Feed - Side Stream Flow and Murphree Efficiency
     1567#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     1568        in      FeedTray                        as stream       (Brief="Feed stream", PosX=0, PosY=0.55);
     1569                VapourDrawOffFlow       as flow_mol (Brief = "Stream Molar Flow Rate");
     1570                LiquidDrawOffFlow   as flow_mol (Brief = "Stream Molar Flow Rate");
     1571                MurphreeEff             as Real         (Brief = "Murphree efficiency");
     1572#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1573# Column Vapour and Liquid Draw Sides
     1574#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1575        out     VapourDrawOff   as vapour_stream        (Brief="Vapour Outlet in the section", PosX=1, PosY=0.395,Protected = true);
     1576        out     LiquidDrawOff   as liquid_stream        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.44,Protected = true);
     1577#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1578# Heat Ports
     1579#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1580        in      HeatToReboiler  as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.89);
     1581        in      HeatToCondenser as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.07);
     1582#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1583# Column Devices
     1584#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    14281585        TRAYS(NumberOfTrays)    as trayReac;
    1429         CONDENSER                                       as condenserReact;
    1430         REBOILER                                                as reboilerReact;
    1431         SPLITTER                                                        as splitter;
    1432         PUMP                                                                    as pump;
    1433 
    1434 out     VapourDistillate                                as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.57, PosY=0);
    1435 in              ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
    1436 
    1437 out     LiquidDistillate                                as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.39);
    1438 in              ConnectorSplitterOut    as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    1439 
    1440 out     BottomProduct                           as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=0.57, PosY=1);
    1441 in              ConnectorReboilerLout   as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
    1442 
    1443 
    1444 # Control
    1445 out     TRI as control_signal           (Brief="Temperature of Reboiler Indicator", PosX=1, PosY=0.78);
    1446 out     LRI as control_signal           (Brief="Level of Reboiler Indicator", PosX=1, PosY=0.85);
    1447 
    1448 out     TCI as control_signal           (Brief="Temperature of Condenser Indicator", PosX=1, PosY=0.01);
    1449 out     LCI as control_signal           (Brief="Level of Condenser Indicator", PosX=1, PosY=0.09);
     1586        CONDENSER                               as condenserReact;
     1587        REBOILER                                as reboilerReact;
     1588        SPLITTER                                as splitter;
     1589        PUMP                                    as pump;
     1590#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1591# Column Outlets
     1592#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1593        out     VapourDistillate        as vapour_stream        (Brief="Vapour outlet stream From Condenser", PosX=0.59, PosY=0);
     1594        out     LiquidDistillate        as liquid_stream        (Brief="Liquid outlet stream From Splitter", PosX=1, PosY=0.23);
     1595        out     BottomProduct           as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1);
     1596#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1597# Column Connectors
     1598#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1599in      ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
     1600in      ConnectorSplitterOut    as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     1601in      ConnectorReboilerLout   as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     1602#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1603# Column Control Ports
     1604#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1605        out     TRI as control_signal   (Brief="Temperature of Reboiler Indicator", PosX=1, PosY=0.83);
     1606        out     LRI as control_signal   (Brief="Level of Reboiler Indicator", PosX=1, PosY=0.855);
     1607        out     TCI as control_signal   (Brief="Temperature of Condenser Indicator", PosX=1, PosY=0.01);
     1608        out     LCI as control_signal   (Brief="Level of Condenser Indicator", PosX=1, PosY=0.04);
    14501609
    14511610CONNECTIONS
    14521611#vapor
    1453         REBOILER.OutletV                                                                to TRAYS(NumberOfTrays).InletV;
    1454         TRAYS(1).OutletV                                                                        to CONDENSER.InletV;
     1612        REBOILER.OutletV                                        to TRAYS(NumberOfTrays).InletV;
     1613        TRAYS(1).OutletV                                        to CONDENSER.InletV;
    14551614        TRAYS([2:NumberOfTrays]).OutletV        to TRAYS([1:NumberOfTrays-1]).InletV;
    14561615
    14571616#liquid
    1458         CONDENSER.OutletL                                                               to SPLITTER.Inlet;     
    1459         SPLITTER.Outlet2                                                                        to PUMP.Inlet;
    1460         PUMP.Outlet                                                                                             to TRAYS(1).InletL;
     1617        CONDENSER.OutletL                                       to SPLITTER.Inlet;     
     1618        SPLITTER.Outlet2                                        to PUMP.Inlet;
     1619        PUMP.Outlet                                             to TRAYS(1).InletL;
    14611620        TRAYS([1:NumberOfTrays-1]).OutletL      to TRAYS([2:NumberOfTrays]).InletL;
    1462         TRAYS(NumberOfTrays).OutletL                    to REBOILER.InletL;
     1621        TRAYS(NumberOfTrays).OutletL            to REBOILER.InletL;
    14631622
    14641623#Connectors
    1465 RebNoFlow.Outlet  to REBOILER.Inlet;
    1466 
    1467 CONDENSER.OutletV to ConnectorCondenserVout;
    1468 SPLITTER.Outlet1                to ConnectorSplitterOut;
    1469 REBOILER.OutletL        to ConnectorReboilerLout;
     1624        CONDENSER.OutletV       to ConnectorCondenserVout;
     1625        SPLITTER.Outlet1        to ConnectorSplitterOut;
     1626        REBOILER.OutletL        to ConnectorReboilerLout;
     1627
     1628INITIAL
     1629#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1630# Tray Initialization
     1631#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1632for i in 1:NumberOfTrays do
     1633
     1634"The initial temperature of the TRAYS"
     1635        TRAYS(i).OutletL.T = INITIALIZATION.TopTemperature+(INITIALIZATION.BottomTemperature-INITIALIZATION.TopTemperature)*((i-1)/(NumberOfTrays-1));
     1636
     1637"The initial Level of the TRAYS"
     1638        TRAYS(i).Level = INITIALIZATION.LevelFraction*hw;
     1639end
     1640
     1641for i in 1:NComp-1 do
     1642
     1643for j in 1:NumberOfTrays do
     1644
     1645"The initial composition of the TRAYS - Normalized"
     1646        TRAYS(j).OutletL.z(i) = INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) +(INITIALIZATION.BottomComposition(i)/sum(INITIALIZATION.BottomComposition)-INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) )*((j-1)/(NumberOfTrays-1));
     1647end
     1648
     1649end
    14701650
    14711651EQUATIONS
     
    15421722        FeedTray.h = TRAYS.Inlet.h;
    15431723
    1544         HeatToReboiler = REBOILER.InletQ;
    1545         HeatToCondenser         = CONDENSER.InletQ;
     1724        HeatToReboiler  = REBOILER.InletQ;
     1725        HeatToCondenser = CONDENSER.InletQ;
    15461726
    15471727"Reboiler Temperature indicator"
     
    15881768        LiquidDrawOffFlow = LiquidDrawOff.F;
    15891769
    1590 INITIAL
    1591 
    1592 for i in 1:NumberOfTrays do
    1593        
    1594 "The initial temperature of the TRAYS"
    1595         TRAYS(i).OutletL.T = TopTemperature+(TbottomTemperature-TopTemperature)*((i-1)/(NumberOfTrays-1));
    1596 
    1597 "The initial Level of the TRAYS"
    1598         TRAYS(i).Level = LevelFraction*hw;
    1599 
    1600 end
    1601 
    1602 for i in 1:NComp-1 do
    1603        
    1604 for j in 1:NumberOfTrays do
    1605 
    1606 "The initial composition of the TRAYS"
    1607         TRAYS(j).OutletL.z(i) = TopComposition(i) +(BottomComposition(i)-TopComposition(i) )*((j-1)/(NumberOfTrays-1));
    1608 
    1609 end
    1610 
    1611 end
    1612 
    1613 end
    1614 
    1615 #*----------------------------------------------------------------------
    1616 * Model of a  packed column section with:
    1617 *       - NStages = theoretical number of equilibrium stages.
    1618 *
    1619 *---------------------------------------------------------------------*#
     1770end
     1771
    16201772Model Packed_Section_ColumnBasic
    16211773        ATTRIBUTES
     
    16411793PARAMETERS
    16421794
    1643         outer PP                        as Plugin(Brief = "External Physical Properties", Type="PP");
     1795        outer PP                as Plugin(Brief = "External Physical Properties", Type="PP");
    16441796        outer NComp     as Integer;
    16451797       
    1646         NumberOfStages                                                          as Integer                      (Brief="Number of Stages", Default=3);
    1647         FeedStageIndex(NumberOfStages)  as Integer                      (Brief="Number of Stages", Default=0,Hidden=true);
    1648         FeedStageLocation                                                       as Integer                      (Brief="Feed Stage Location", Default=2);
    1649        
    1650         PackingHeight                   as length               (Brief="Height of packing");
    1651         HeatSupply                              as heat_rate    (Brief="Rate of heat supply");
     1798        NumberOfStages                                  as Integer      (Brief="Number of Stages", Default=3);
     1799        FeedStageIndex(NumberOfStages)  as Integer      (Brief="Number of Stages", Default=0,Hidden=true);
     1800        FeedStageLocation                               as Integer      (Brief="Feed Stage Location", Default=2);
     1801       
     1802        PackingHeight           as length               (Brief="Height of packing");
     1803        HeatSupply                      as heat_rate    (Brief="Rate of heat supply");
    16521804        ColumnDiameter          as length               (Brief="Column diameter");
    1653         VoidFraction                            as Real                         (Brief="Void fraction of packing, m^3/m^3");
    1654         ResistanceCoeff                 as positive             (Brief="Resistance coefficient on the liquid load", Default=1);
    1655         AreaPerPackingVol       as Real                         (Brief="surface area per packing volume", Unit='m^2/m^3');
    1656        
    1657         TopStageTemperature                     as temperature;
    1658         BottomStageTemperature          as temperature;
    1659        
    1660         TopStageComposition(NComp)                              as fraction     (Brief = "Component Molar Fraction at Top");
    1661         BottomStageComposition(NComp)                   as fraction     (Brief = "Component Molar Fraction at Bottom");
    1662         LiquidMolarHoldup                                                                               as mol          (Brief="Molar liquid holdup", Default=0.01);
    1663        
    1664         V                                               as volume                               (Brief="Total Volume of the tray",Hidden=true);
    1665         g                                                       as acceleration                 (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
    1666         hs                                              as length                               (Brief="Height of the packing stage",Hidden=true);
    1667         ColumnArea              as area                                 (Brief="Column Sectional Cross Area",Hidden=true);
     1805        VoidFraction            as Real                 (Brief="Void fraction of packing, m^3/m^3");
     1806        ResistanceCoeff         as positive     (Brief="Resistance coefficient on the liquid load", Default=1);
     1807        AreaPerPackingVol       as Real                 (Brief="surface area per packing volume", Unit='m^2/m^3');
     1808       
     1809        V                               as volume               (Brief="Total Volume of the tray",Hidden=true);
     1810        g                               as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
     1811        hs                              as length               (Brief="Height of the packing stage",Hidden=true);
     1812        ColumnArea              as area                 (Brief="Column Sectional Cross Area",Hidden=true);
    16681813
    16691814VARIABLES
     1815#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1816# Stages Initialization For the Whole Column Section
     1817#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     1818        INITIALIZATION          as InitializeStage      (Brief = "Column Model Initialization");
    16701819        in      FeedStage       as stream               (Brief="Feed stream", PosX=0, PosY=0.55);
    16711820       
    16721821        STAGES(NumberOfStages) as packedStage;
    1673         PressureDrop                                            as pressure;
     1822        PressureDrop               as pressure;
    16741823       
    16751824SET
     
    17391888
    17401889"The initial temperature of the STAGES"
    1741         STAGES(i).OutletL.T = TopStageTemperature+(BottomStageTemperature-TopStageTemperature)*((i-1)/(NumberOfStages-1));
     1890        STAGES(i).OutletL.T = INITIALIZATION.TopStageTemperature+(INITIALIZATION.BottomStageTemperature-INITIALIZATION.TopStageTemperature)*((i-1)/(NumberOfStages-1));
    17421891
    17431892"The Liquid Holdup of the STAGES"
    1744         STAGES(i).ML = LiquidMolarHoldup;
     1893        STAGES(i).ML = INITIALIZATION.LiquidMolarHoldup;
    17451894
    17461895end
     
    17511900
    17521901"The initial composition of the TRAYS"
    1753         STAGES(j).OutletL.z(i) = TopStageComposition(i) +(BottomStageComposition(i)-TopStageComposition(i) )*((j-1)/(NumberOfStages-1));
     1902        STAGES(j).OutletL.z(i) = INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) +(INITIALIZATION.BottomStageComposition(i)/sum(INITIALIZATION.BottomStageComposition)-INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) )*((j-1)/(NumberOfStages-1));
    17541903
    17551904end
     
    18251974end
    18261975
    1827 #*----------------------------------------------------------------------
    1828 * Model of a  packed distillation column containing:
    1829 *       - a section with NStages theoretical stages;
    1830 *       - a kettle reboiler;
    1831 *       - dymamic condenser;
    1832 *       - a splitter which separate reflux and distillate;
    1833 *       - a pump in reflux stream;
    1834 *---------------------------------------------------------------------*#
    18351976Model PackedDistillation_kettle_cond as Packed_Section_ColumnBasic
    18361977        ATTRIBUTES
     
    18642005PARAMETERS
    18652006
    1866         VapourFlow as Switcher  (Valid = ["on", "off"], Default = "on");
     2007        VapourFlow as Switcher  (Valid = ["on", "off"], Hidden = true ,Default = "on");
    18672008       
    18682009VARIABLES
    1869 
    1870         CONDENSER       as condenser;
    1871         REBOILER                        as reboiler;
    1872         SPLITTER                        as splitter;
    1873         PUMP                            as pump;
    1874 
    1875 out             HeatToReboiler          as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    1876 out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    1877 
    1878 RebNoFlow       as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true);
    1879 
    1880         out     VapourDistillate                                                as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.57, PosY=0);
    1881         in              ConnectorCondenserVout  as stream                               (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
    1882 
    1883         out     LiquidDistillate                                as liquid_stream                (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.225);
    1884         in              ConnectorSplitterOut            as stream                               (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    1885 
    1886         out     BottomProduct                           as liquid_stream                (Brief="Liquid outlet stream From Reboiler", PosX=0.625, PosY=1);
    1887         in              ConnectorReboilerLout   as stream                               (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     2010#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     2011# Column Devices
     2012#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     2013        CONDENSER       as condenser    (Brief="dymamic condenser");
     2014        REBOILER        as reboiler             (Brief="kettle reboiler");
     2015        SPLITTER        as splitter             (Brief="splitter which separate reflux and distillate");
     2016        PUMP            as pump                 (Brief="pump in reflux stream");
     2017#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     2018# Heat Ports
     2019#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     2020        in      HeatToReboiler  as power (Brief="Heat supplied to Reboiler",Protected = true, PosX=1, PosY=0.885);
     2021        in      HeatToCondenser as power (Brief="Heat supplied to Condenser", Protected = true, PosX=1, PosY=0.034);
     2022#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     2023# Column Products
     2024#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
     2025        out     VapourDistillate        as vapour_stream        (Brief="Vapour outlet stream From Top Condenser", PosX=0.66, PosY=0);
     2026        out     LiquidDistillate        as liquid_stream        (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.20);
     2027        out     BottomProduct           as liquid_stream        (Brief="Liquid outlet stream From Reboiler", PosX=0.68, PosY=1);
     2028#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     2029# Column Connectors
     2030#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++             
     2031        in      ConnectorCondenserVout  as stream       (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true);
     2032        in      ConnectorSplitterOut    as stream       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
     2033        in      ConnectorReboilerLout   as stream       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     2034                ConnectorHeatReboiler   as power        (Brief="Heat supplied to Reboiler", Hidden=true);
     2035                ConnectorHeatCondenser  as power        (Brief="Heat supplied to Condenser", Hidden=true);
    18882036
    18892037CONNECTIONS
     
    18942042
    18952043#liquid
    1896         CONDENSER.OutletL                                                       to SPLITTER.Inlet;     
    1897         SPLITTER.Outlet2                                                                to PUMP.Inlet;
    1898         PUMP.Outlet                                                                                     to STAGES(1).InletL;
     2044        CONDENSER.OutletL                               to SPLITTER.Inlet;     
     2045        SPLITTER.Outlet2                                to PUMP.Inlet;
     2046        PUMP.Outlet                                     to STAGES(1).InletL;
    18992047        STAGES(NumberOfStages).OutletL  to REBOILER.InletL;
    19002048
    19012049#Connectors
    1902 HeatToReboiler          to REBOILER.InletQ;
    1903 HeatToCondenser         to CONDENSER.InletQ;
     2050ConnectorHeatReboiler   to REBOILER.InletQ;
     2051ConnectorHeatCondenser  to CONDENSER.InletQ;
    19042052
    19052053CONDENSER.OutletV               to ConnectorCondenserVout;
    1906 SPLITTER.Outlet1                        to ConnectorSplitterOut;
    1907 REBOILER.OutletL                        to ConnectorReboilerLout;
     2054SPLITTER.Outlet1                to ConnectorSplitterOut;
     2055REBOILER.OutletL                to ConnectorReboilerLout;
    19082056
    19092057EQUATIONS
    1910  
     2058        HeatToReboiler  = ConnectorHeatReboiler;
     2059        HeatToCondenser = ConnectorHeatCondenser;
     2060       
    19112061# Condenser Connector Equations
    19122062        ConnectorCondenserVout.T = VapourDistillate.T;
     
    19362086                STAGES(NumberOfStages).InletV.F = 0 * 'mol/s';
    19372087                when REBOILER.OutletV.P > STAGES(NumberOfStages).OutletV.P + 1e-1 * 'atm' switchto "on";
    1938 
    1939 end
    1940 
    1941 end
    1942 
     2088end
     2089
     2090end
     2091
  • branches/gui/eml/stage_separators/condenser.mso

    r719 r721  
    162162Model condenserReact
    163163        ATTRIBUTES
    164         Pallete         = true;
     164        Pallete         = false;
    165165        Icon            = "icon/Condenser";
    166166        Brief           = "Model of a Condenser with reaction in liquid phase.";
     
    183183";
    184184       
    185         PARAMETERS
    186         outer PP as Plugin(Type="PP");
     185PARAMETERS
     186        outer PP        as Plugin(Type="PP");
    187187        outer NComp as Integer;
    188         V as volume (Brief="Condenser total volume");
    189         Across as area (Brief="Cross Section Area of reboiler");
    190 
    191         stoic(NComp) as Real(Brief="Stoichiometric matrix");
    192         Hr as energy_mol;
    193 
    194         VARIABLES
    195 in      InletV as stream(Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}");
    196 out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");
    197 out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");
    198         InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
    199 
    200         M(NComp) as mol (Brief="Molar Holdup in the tray");
    201         ML as mol (Brief="Molar liquid holdup");
    202         MV as mol (Brief="Molar vapour holdup");
    203         E as energy (Brief="Total Energy Holdup on tray");
    204         vL as volume_mol (Brief="Liquid Molar Volume");
    205         vV as volume_mol (Brief="Vapour Molar volume");
    206         Level as length (Brief="Level of liquid phase");
    207         Vol as volume;
    208         r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
    209         C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1);
    210 
    211         EQUATIONS
    212         "Molar Concentration"
     188       
     189        V               as volume (Brief="Condenser total volume");
     190        Across  as area         (Brief="Cross Section Area of reboiler");
     191
     192        stoic(NComp)    as Real                 (Brief="Stoichiometric matrix");
     193        Hr                              as energy_mol;
     194        Initial_Level                           as length                       (Brief="Initial Level of liquid phase");
     195        Initial_Temperature                     as temperature          (Brief="Initial Temperature of Condenser");
     196        Initial_Composition(NComp)      as fraction             (Brief="Initial Liquid Composition");
     197       
     198VARIABLES
     199
     200in      InletV          as stream                       (Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}");
     201out     OutletL         as liquid_stream        (Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");
     202out     OutletV         as vapour_stream        (Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");
     203        InletQ          as power                        (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
     204
     205        M(NComp)        as mol                  (Brief="Molar Holdup in the tray");
     206        ML                      as mol                  (Brief="Molar liquid holdup");
     207        MV                      as mol                  (Brief="Molar vapour holdup");
     208        E                       as energy               (Brief="Total Energy Holdup on tray");
     209        vL                      as volume_mol   (Brief="Liquid Molar Volume");
     210        vV                      as volume_mol   (Brief="Vapour Molar volume");
     211        Level           as length               (Brief="Level of liquid phase");
     212        Vol             as volume;
     213        r3                      as reaction_mol (Brief="Reaction Rates", DisplayUnit = 'mol/l/s');
     214        C(NComp)        as conc_mol     (Brief="Molar concentration", Lower = -1);
     215
     216INITIAL
     217
     218        Level                                   = Initial_Level;
     219        OutletL.T                               = Initial_Temperature;
     220        OutletL.z(1:NComp-1)    = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
     221
     222EQUATIONS
     223"Molar Concentration"
    213224        OutletL.z = vL * C;
    214225       
    215         "Reaction"
     226"Reaction"
    216227        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s';
    217228       
    218         "Component Molar Balance"
    219         diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z
    220                                 - OutletV.F*OutletV.z + stoic*r3*ML*vL;
    221 
    222         "Energy Balance"
    223         diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h
    224                                 - OutletV.F*OutletV.h + InletQ + Hr * r3 * ML*vL;
    225 
    226         "Molar Holdup"
     229"Component Molar Balance"
     230        diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
     231
     232"Energy Balance"
     233        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h- OutletV.F*OutletV.h + InletQ + Hr * r3 * ML*vL;
     234
     235"Molar Holdup"
    227236        M = ML*OutletL.z + MV*OutletV.z;
    228237       
    229         "Energy Holdup"
     238"Energy Holdup"
    230239        E = ML*OutletL.h + MV*OutletV.h - OutletV.P*V;
    231240       
    232         "Mol fraction normalisation"
     241"Mol fraction normalisation"
    233242        sum(OutletL.z)=1.0;
    234243
    235         "Liquid Volume"
     244"Liquid Volume"
    236245        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
    237         "Vapour Volume"
     246
     247"Vapour Volume"
    238248        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
    239249
    240         "Thermal Equilibrium"
     250"Thermal Equilibrium"
    241251        OutletL.T = OutletV.T;
    242252
    243         "Mechanical Equilibrium"
     253"Mechanical Equilibrium"
    244254        OutletV.P = OutletL.P;
    245255
    246         "Geometry Constraint"
     256"Geometry Constraint"
    247257        V = ML*vL + MV*vV;
    248258
    249259        Vol = ML*vL;
    250260       
    251         "Level of liquid phase"
     261"Level of liquid phase"
    252262        Level = ML*vL/Across;
    253263       
    254         "Chemical Equilibrium"
     264"Chemical Equilibrium"
    255265        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
    256266        PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
  • branches/gui/eml/stage_separators/reboiler.mso

    r715 r721  
    225225Model reboilerReact
    226226        ATTRIBUTES
    227         Pallete         = true;
     227        Pallete         = false;
    228228        Icon            = "icon/Reboiler";
    229229        Brief           = "Model of a dynamic reboiler with reaction.";
     
    248248";
    249249       
    250         PARAMETERS
     250PARAMETERS
    251251        outer PP as Plugin(Type="PP");
    252252        outer NComp as Integer;
     
    257257        Hr as energy_mol;
    258258
    259         VARIABLES
    260 in      Inlet as stream(Brief="Feed Stream", PosX=0.8127, PosY=0, Symbol="_{in}");
    261 in      InletL as stream(Brief="Liquid inlet stream", PosX=0, PosY=0.5254, Symbol="_{inL}");
    262 out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}");
    263 out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}");
    264         InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
    265 
    266         M(NComp) as mol (Brief="Molar Holdup in the tray");
    267         ML as mol (Brief="Molar liquid holdup");
    268         MV as mol (Brief="Molar vapour holdup");
    269         E as energy (Brief="Total Energy Holdup on tray");
    270         vL as volume_mol (Brief="Liquid Molar Volume");
    271         vV as volume_mol (Brief="Vapour Molar volume");
    272         Level as length (Brief="Level of liquid phase");
    273         Vol as volume;
    274         startup as Real;
    275         rhoV as dens_mass;
    276         r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
    277         C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1);
    278 
    279         EQUATIONS
    280         "Molar Concentration"
     259        Initial_Level                           as length               (Brief="Initial Level of liquid phase");
     260        Initial_Temperature                     as temperature  (Brief="Initial Temperature of Reboiler");
     261        Initial_Composition(NComp)      as fraction     (Brief="Initial Liquid Composition");
     262       
     263VARIABLES
     264in      InletL  as stream                       (Brief="Liquid inlet stream", PosX=0, PosY=0.5254, Symbol="_{inL}");
     265out     OutletL as liquid_stream        (Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}");
     266out     OutletV as vapour_stream        (Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}");
     267        InletQ  as power                        (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
     268
     269        M(NComp)        as mol                  (Brief="Molar Holdup in the tray");
     270        ML                      as mol                  (Brief="Molar liquid holdup");
     271        MV                      as mol                  (Brief="Molar vapour holdup");
     272        E                       as energy               (Brief="Total Energy Holdup on tray");
     273        vL                      as volume_mol   (Brief="Liquid Molar Volume");
     274        vV                      as volume_mol   (Brief="Vapour Molar volume");
     275        Level           as length               (Brief="Level of liquid phase");
     276        Vol             as volume;
     277        rhoV            as dens_mass;
     278        r3                      as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
     279        C(NComp)        as conc_mol     (Brief = "Molar concentration", Lower = -1);
     280
     281INITIAL
     282
     283        Level                                   = Initial_Level;
     284        OutletL.T                               = Initial_Temperature;
     285        OutletL.z(1:NComp-1)    = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
     286
     287EQUATIONS
     288"Molar Concentration"
    281289        OutletL.z = vL * C;
    282290       
    283         "Reaction"
     291"Reaction"
    284292        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s';
    285293
    286         "Component Molar Balance"
    287         diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z
    288                 - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
    289        
    290         "Energy Balance"
    291         diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h
    292                 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ + Hr * r3 * vL*ML;
    293        
    294         "Molar Holdup"
     294"Component Molar Balance"
     295        diff(M)= InletL.F*InletL.z- OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
     296       
     297"Energy Balance"
     298        diff(E) = InletL.F*InletL.h- OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ + Hr * r3 * vL*ML;
     299       
     300"Molar Holdup"
    295301        M = ML*OutletL.z + MV*OutletV.z;
    296302       
    297         "Energy Holdup"
     303"Energy Holdup"
    298304        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
    299305       
    300         "Mol fraction normalisation"
     306"Mol fraction normalisation"
    301307        sum(OutletL.z)=1.0;
    302308       
    303         "Liquid Volume"
     309"Liquid Volume"
    304310        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
    305         "Vapour Volume"
     311
     312"Vapour Volume"
    306313        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); 
    307         "Vapour Density"
     314
     315"Vapour Density"
    308316        rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z);
    309317       
    310         "Level of liquid phase"
     318"Level of liquid phase"
    311319        Level = ML*vL/Across;
    312320
    313321        Vol = ML*vL;
    314322       
    315         "Mechanical Equilibrium"
     323"Mechanical Equilibrium"
    316324        OutletL.P = OutletV.P;
    317325       
    318         "Thermal Equilibrium"
     326"Thermal Equilibrium"
    319327        OutletL.T = OutletV.T; 
    320328       
    321         "Geometry Constraint"
     329"Geometry Constraint"
    322330        V = ML*vL + MV*vV;             
    323331
    324         "Chemical Equilibrium"
     332"Chemical Equilibrium"
    325333        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
    326334        PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
  • branches/gui/eml/stage_separators/tank.mso

    r649 r721  
    5858        Across                          as area                         (Brief="Tank cross section area", Default=2);
    5959       
     60        Initial_Level                           as length               (Brief="Initial Level of the Tank");
     61        Initial_Temperature                     as temperature  (Brief="Initial Temperature of Liquid");
     62        Initial_Composition(NComp)      as fraction     (Brief="Initial Liquid Composition");
     63       
    6064VARIABLES
    6165in      Inlet                   as stream                               (Brief = "Inlet stream", PosX=0.3037, PosY=0, Symbol="_{in}");
     
    6771        vL                              as volume_mol           (Brief="Liquid Molar Volume");
    6872
     73INITIAL
     74
     75        Level                                   = Initial_Level;
     76        Outlet.T                                = Initial_Temperature;
     77        Outlet.z(1:NComp-1)     = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
     78
    6979EQUATIONS
    7080
     
    119129        radius                          as length               (Brief="Tank radius");
    120130        L                                               as length               (Brief="Tank length");
     131       
     132        Initial_Level                   as length                       (Brief="Initial Level of the Tank");
     133        Initial_Temperature             as temperature                  (Brief="Initial Temperature of Liquid");
     134        Initial_Composition(NComp)      as fraction                             (Brief="Initial Liquid Composition");
    121135       
    122136VARIABLES
     
    130144        vL                      as volume_mol           (Brief="Liquid Molar Volume");
    131145
     146INITIAL
     147
     148        Level                                   = Initial_Level;
     149        Outlet.T                                = Initial_Temperature;
     150        Outlet.z(1:NComp-1)     = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
     151
    132152EQUATIONS
    133153
Note: See TracChangeset for help on using the changeset viewer.