Ignore:
Timestamp:
Nov 23, 2008, 10:39:38 PM (14 years ago)
Author:
gerson bicca
Message:

updates

File:
1 edited

Legend:

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

    r693 r694  
    4040#*----------------------------------------------------------------------
    4141* Model of a  column section with:
    42 *       - NumberOfTrays=number of trays.
     42*       - NumberOfTrays = number of trays.
    4343*
    4444*---------------------------------------------------------------------*#
     
    138138        in      FeedTray                                as stream                               (Brief="Feed stream", PosX=0, PosY=0.55);
    139139       
    140         trays(NumberOfTrays) as tray                    (Brief="Number of trays");
     140        TRAYS(NumberOfTrays) as tray                    (Brief="Number of trays");
    141141
    142142                VapourDrawOffFlow  as flow_mol                  (Brief = "Stream Molar Flow Rate");
     
    147147CONNECTIONS
    148148
    149         trays([2:NumberOfTrays]).OutletV        to trays([1:NumberOfTrays-1]).InletV;
    150         trays([1:NumberOfTrays-1]).OutletL      to trays([2:NumberOfTrays]).InletL;
     149        TRAYS([2:NumberOfTrays]).OutletV        to TRAYS([1:NumberOfTrays-1]).InletV;
     150        TRAYS([1:NumberOfTrays-1]).OutletL      to TRAYS([2:NumberOfTrays]).InletL;
    151151       
    152152       
    153153EQUATIONS
    154154# Connecting Trays
    155         FeedTray.F*FeedTrayIndex= trays.Inlet.F;
    156         FeedTray.T = trays.Inlet.T;
    157         FeedTray.P = trays.Inlet.P;
    158         FeedTray.z = trays.Inlet.z;
    159         FeedTray.v = trays.Inlet.v;
    160         FeedTray.h = trays.Inlet.h;
     155        FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F;
     156        FeedTray.T = TRAYS.Inlet.T;
     157        FeedTray.P = TRAYS.Inlet.P;
     158        FeedTray.z = TRAYS.Inlet.z;
     159        FeedTray.v = TRAYS.Inlet.v;
     160        FeedTray.h = TRAYS.Inlet.h;
    161161       
    162162for i in [1:NumberOfTrays] do
    163163
    164164"Murphree Efficiency"
    165         trays(i).OutletV.z =  MurphreeEff * (trays(i).yideal - trays(i).InletV.z) + trays(i).InletV.z;
     165        TRAYS(i).OutletV.z =  MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletV.z) + TRAYS(i).InletV.z;
    166166
    167167"Level of clear liquid over the weir"
    168         trays(i).Level = trays(i).ML*trays(i).vL/Ap;
     168        TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/Ap;
    169169
    170170"Geometry Constraint"
    171         V = trays(i).ML* trays(i).vL + trays(i).MV*trays(i).vV;
     171        V = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV;
    172172
    173173"Energy Holdup"
    174         trays(i).E = trays(i).ML*trays(i).OutletL.h + trays(i).MV*trays(i).OutletV.h - trays(i).OutletL.P*V;
     174        TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletL.h + TRAYS(i).MV*TRAYS(i).OutletV.h - TRAYS(i).OutletL.P*V;
    175175
    176176"Energy Balance"
    177         diff(trays(i).E) = ( trays(i).Inlet.F*trays(i).Inlet.h + trays(i).InletL.F*trays(i).InletL.h + trays(i).InletV.F*trays(i).InletV.h- trays(i).OutletL.F*trays(i).OutletL.h - trays(i).OutletV.F*trays(i).OutletV.h
    178         -trays(i).VapourSideStream.F*trays(i).VapourSideStream.h - trays(i).LiquidSideStream.F*trays(i).LiquidSideStream.h + Q );
     177        diff(TRAYS(i).E) = ( TRAYS(i).Inlet.F*TRAYS(i).Inlet.h + TRAYS(i).InletL.F*TRAYS(i).InletL.h + TRAYS(i).InletV.F*TRAYS(i).InletV.h- TRAYS(i).OutletL.F*TRAYS(i).OutletL.h - TRAYS(i).OutletV.F*TRAYS(i).OutletV.h
     178        -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + Q );
    179179
    180180switch LiquidFlow
     
    183183                                case "default":
    184184                                "Francis Equation"
    185                                 trays(i).OutletL.F*trays(i).vL = 1.84*'1/s'*lw*((trays(i).Level-(beta*hw))/(beta))^2;
     185                                TRAYS(i).OutletL.F*TRAYS(i).vL = 1.84*'1/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^2;
    186186                       
    187187                                case "Wang_Fl":
    188                                 trays(i).OutletL.F*trays(i).vL = 1.84*'m^0.5/s'*lw*((trays(i).Level-(beta*hw))/(beta))^1.5;
     188                                TRAYS(i).OutletL.F*TRAYS(i).vL = 1.84*'m^0.5/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^1.5;
    189189                       
    190190                                case "Olsen":
    191                                 trays(i).OutletL.F / 'mol/s'= lw*Np*trays(i).rhoL/sum(Mw*trays(i).OutletV.z)/(0.665*fw)^1.5 * ((trays(i).ML*sum(Mw*trays(i).OutletL.z)/trays(i).rhoL/Ap)-hw)^1.5 * 'm^0.5/mol';
     191                                TRAYS(i).OutletL.F / 'mol/s'= lw*Np*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletV.z)/(0.665*fw)^1.5 * ((TRAYS(i).ML*sum(Mw*TRAYS(i).OutletL.z)/TRAYS(i).rhoL/Ap)-hw)^1.5 * 'm^0.5/mol';
    192192                       
    193193                                case "Feehery_Fl":
    194                                 trays(i).OutletL.F = lw*trays(i).rhoL/sum(Mw*trays(i).OutletL.z) * ((trays(i).Level-hw)/750/'mm')^1.5 * 'm^2/s';
     194                                TRAYS(i).OutletL.F = lw*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletL.z) * ((TRAYS(i).Level-hw)/750/'mm')^1.5 * 'm^2/s';
    195195                       
    196196                                case "Roffel_Fl":
    197                                 trays(i).OutletL.F = 2/3*sqrt(2*g)*trays(i).rhoL/sum(Mw*trays(i).OutletL.z)*lw*(2*trays(i).btemp-1)*(trays(i).ML*sum(Mw*trays(i).OutletL.z)/(Ap*1.3)/trays(i).rhoL/(2*trays(i).btemp-1))^1.5;
     197                                TRAYS(i).OutletL.F = 2/3*sqrt(2*g)*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletL.z)*lw*(2*TRAYS(i).btemp-1)*(TRAYS(i).ML*sum(Mw*TRAYS(i).OutletL.z)/(Ap*1.3)/TRAYS(i).rhoL/(2*TRAYS(i).btemp-1))^1.5;
    198198                        end
    199                 when trays(i).Level < (beta *hw) switchto "off";
     199                when TRAYS(i).Level < (beta *hw) switchto "off";
    200200               
    201201                case "off":
    202202                "Low level"
    203                 trays(i).OutletL.F = 0 * 'mol/h';
    204                 when trays(i).Level > (beta * hw) + 1e-6*'m' switchto "on";
     203                TRAYS(i).OutletL.F = 0 * 'mol/h';
     204                when TRAYS(i).Level > (beta * hw) + 1e-6*'m' switchto "on";
    205205        end
    206206       
    207         trays(i).btemp = 1 - 0.3593/'Pa^0.0888545'*abs(trays(i).OutletV.F*sum(Mw*trays(i).OutletV.z)/(Ap*1.3)/sqrt(trays(i).rhoV))^0.177709; #/'(kg/m)^0.0888545/s^0.177709';
     207        TRAYS(i).btemp = 1 - 0.3593/'Pa^0.0888545'*abs(TRAYS(i).OutletV.F*sum(Mw*TRAYS(i).OutletV.z)/(Ap*1.3)/sqrt(TRAYS(i).rhoV))^0.177709; #/'(kg/m)^0.0888545/s^0.177709';
    208208
    209209switch VapourFlow
     
    211211                        switch VapourFlowModel
    212212                                case "Reepmeyer":
    213                                 trays(i).InletV.F*trays(i).vV = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/(trays(i).rhoV*alfa))*Ah;
     213                                TRAYS(i).InletV.F*TRAYS(i).vV = sqrt((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)/(TRAYS(i).rhoV*alfa))*Ah;
    214214                       
    215215                                case "Feehery_Fv":
    216                                 trays(i).InletV.F = trays(i).rhoV/Ap/w/sum(Mw*trays(i).OutletV.z) * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-(trays(i).rhoV*g*trays(i).ML*trays(i).vL/Ap))/trays(i).rhoV);
     216                                TRAYS(i).InletV.F = TRAYS(i).rhoV/Ap/w/sum(Mw*TRAYS(i).OutletV.z) * sqrt(((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)-(TRAYS(i).rhoV*g*TRAYS(i).ML*TRAYS(i).vL/Ap))/TRAYS(i).rhoV);
    217217                       
    218218                                case "Roffel_Fv":
    219                                 trays(i).InletV.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (trays(i).InletV.P - trays(i).OutletV.P)*1e5 - (beta*sum(trays(i).M*Mw)/(Ap*1.3)*g*1e5) * (trays(i).rhoV*Ah/sum(Mw*trays(i).OutletV.z))^1.08 * 'm^1.08/mol^1.08';
     219                                TRAYS(i).InletV.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (TRAYS(i).InletV.P - TRAYS(i).OutletV.P)*1e5 - (beta*sum(TRAYS(i).M*Mw)/(Ap*1.3)*g*1e5) * (TRAYS(i).rhoV*Ah/sum(Mw*TRAYS(i).OutletV.z))^1.08 * 'm^1.08/mol^1.08';
    220220                       
    221221                                case "Klingberg":
    222                                 trays(i).InletV.F * trays(i).vV = Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV);
     222                                TRAYS(i).InletV.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV);
    223223                       
    224224                                case "Wang_Fv":
    225                                 trays(i).InletV.F * trays(i).vV = Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV*alfa);
     225                                TRAYS(i).InletV.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV*alfa);
    226226                               
    227227                                case "Elgue":
    228                                 trays(i).InletV.F  = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/btray);
     228                                TRAYS(i).InletV.F  = sqrt((TRAYS(i).InletV.P - TRAYS(i).OutletV.P)/btray);
    229229                        end
    230                 when trays(i).InletV.F < 1e-6 * 'kmol/h' switchto "off";
     230                when TRAYS(i).InletV.F < 1e-6 * 'kmol/h' switchto "off";
    231231               
    232232                case "off":
    233                 trays(i).InletV.F = 0 * 'mol/s';
    234                 when trays(i).InletV.P > trays(i).OutletV.P + trays(i).Level*g*trays(i).rhoL + 1e-1 * 'atm' switchto "on";
     233                TRAYS(i).InletV.F = 0 * 'mol/s';
     234                when TRAYS(i).InletV.P > TRAYS(i).OutletV.P + TRAYS(i).Level*g*TRAYS(i).rhoL + 1e-1 * 'atm' switchto "on";
    235235        end
    236236
     
    241241for i in 1:NumberOfTrays do
    242242       
    243 "The initial temperature of the trays"
    244         trays(i).OutletL.T = TopTemperature+(TbottomTemperature-TopTemperature)*((i-1)/(NumberOfTrays-1));
    245 
    246 "The initial Level of the trays"
    247         trays(i).Level = LevelFraction*hw;
     243"The initial temperature of the TRAYS"
     244        TRAYS(i).OutletL.T = TopTemperature+(TbottomTemperature-TopTemperature)*((i-1)/(NumberOfTrays-1));
     245
     246"The initial Level of the TRAYS"
     247        TRAYS(i).Level = LevelFraction*hw;
    248248
    249249end
     
    253253for j in 1:NumberOfTrays do
    254254
    255 "The initial composition of the trays"
    256         trays(j).OutletL.z(i) = TopComposition(i) +(BottomComposition(i)-TopComposition(i) )*((j-1)/(NumberOfTrays-1));
     255"The initial composition of the TRAYS"
     256        TRAYS(j).OutletL.z(i) = TopComposition(i) +(BottomComposition(i)-TopComposition(i) )*((j-1)/(NumberOfTrays-1));
    257257
    258258end
     
    270270        Info            =
    271271"== Model of a column section containing ==
    272 * NumberOfTrays trays.
     272* NumberOfTrays TRAYS.
    273273       
    274274== Specify ==
     
    279279       
    280280== Initial Conditions ==
    281 * the trays temperature (OutletL.T);
    282 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     281* the TRAYS temperature (OutletL.T);
     282* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    283283* (NoComps - 1) OutletL (OR OutletV) compositions for each tray.
    284284";
     
    295295        out     LiquidOutlet            as liquid_stream                (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1);
    296296       
    297         LiquidConnector as stream       (Brief="Liquid connection at the middle trays", PosX=0.75, PosY=1,Hidden=true);
    298         VapourConnector as stream       (Brief="Vapour connection at the middle trays", PosX=0.55, PosY=0,Hidden=true);
     297        LiquidConnector as stream       (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
     298        VapourConnector as stream       (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
    299299
    300300CONNECTIONS
    301301
    302         LiquidConnector to trays(1).InletL;
    303         VapourConnector to trays(NumberOfTrays).InletV;
     302        LiquidConnector to TRAYS(1).InletL;
     303        VapourConnector to TRAYS(NumberOfTrays).InletV;
    304304       
    305305EQUATIONS
     
    319319        VapourConnector.h = VapourInlet.h;
    320320       
    321         LiquidOutlet.F= trays(NumberOfTrays).OutletL.F;
    322         LiquidOutlet.T = trays(NumberOfTrays).OutletL.T;
    323         LiquidOutlet.P = trays(NumberOfTrays).OutletL.P;
    324         LiquidOutlet.z = trays(NumberOfTrays).OutletL.z;
    325        
    326         VapourOutlet.F= trays(1).OutletV.F;
    327         VapourOutlet.T = trays(1).OutletV.T;
    328         VapourOutlet.P = trays(1).OutletV.P;
    329         VapourOutlet.z = trays(1).OutletV.z;
    330 
    331         VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;
    332         VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;
    333         VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;
    334         VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;
    335 
    336         LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;
    337         LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;
    338         LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;
    339         LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;
     321        LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F;
     322        LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T;
     323        LiquidOutlet.P = TRAYS(NumberOfTrays).OutletL.P;
     324        LiquidOutlet.z = TRAYS(NumberOfTrays).OutletL.z;
     325       
     326        VapourOutlet.F= TRAYS(1).OutletV.F;
     327        VapourOutlet.T = TRAYS(1).OutletV.T;
     328        VapourOutlet.P = TRAYS(1).OutletV.P;
     329        VapourOutlet.z = TRAYS(1).OutletV.z;
     330
     331        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     332        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     333        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     334        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     335
     336        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     337        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     338        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     339        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    340340
    341341        VapourDrawOffFlow = VapourDrawOff.F;
     
    368368       
    369369== Initial Conditions ==
    370 * the trays temperature (OutletL.T);
    371 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     370* the TRAYS temperature (OutletL.T);
     371* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    372372* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    373373       
     
    388388        out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true);
    389389       
    390         CondenserUnity  as condenser;
    391         ReboilerUnity           as reboiler;
    392         SplitterTop                     as splitter;
    393         PumpUnity                       as pump;
     390        CONDENSER       as condenser;
     391        REBOILER                as reboiler;
     392        SPLITTERtop     as splitter;
     393        PUMP                            as pump;
    394394        alfaTopo                                as Real;
    395395
     
    413413
    414414        case "on":
    415                 CondenserUnity.InletV.F*trays(1).vV = alfaTopo *Ah * sqrt(2*(trays(1).OutletV.P -
    416                 CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));
    417                 when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";
     415                CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo *Ah * sqrt(2*(TRAYS(1).OutletV.P -
     416                CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV));
     417                when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off";
    418418
    419419        case "off":
    420                 CondenserUnity.InletV.F = 0 * 'mol/s';
    421                 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";
     420                CONDENSER.InletV.F = 0 * 'mol/s';
     421                when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on";
    422422
    423423end     
     
    441441        ConnectorReboilerLout.z = BottomProduct.z;
    442442
    443 VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;
    444         VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;
    445         VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;
    446         VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;
    447 
    448         LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;
    449         LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;
    450         LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;
    451         LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;
     443        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     444        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     445        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     446        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     447
     448        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     449        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     450        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     451        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    452452
    453453        VapourDrawOffFlow = VapourDrawOff.F;
     
    456456CONNECTIONS
    457457#vapor
    458         ReboilerUnity.OutletV   to      trays(NumberOfTrays).InletV;
    459         trays(1).OutletV                                to      CondenserUnity.InletV;
     458        REBOILER.OutletV        to      TRAYS(NumberOfTrays).InletV;
     459        TRAYS(1).OutletV                                to      CONDENSER.InletV;
    460460
    461461#liquid
    462         CondenserUnity.OutletL          to      SplitterTop.Inlet;     
    463         SplitterTop.Outlet2                             to      PumpUnity.Inlet;
    464         PumpUnity.Outlet                                        to      trays(1).InletL;
    465         trays(NumberOfTrays).OutletL    to      ReboilerUnity.InletL;
     462        CONDENSER.OutletL               to      SPLITTERtop.Inlet;     
     463        SPLITTERtop.Outlet2                             to      PUMP.Inlet;
     464        PUMP.Outlet                                     to      TRAYS(1).InletL;
     465        TRAYS(NumberOfTrays).OutletL    to      REBOILER.InletL;
    466466
    467467#Connectors
    468 HeatToReboiler  to ReboilerUnity.InletQ;
    469 HeatToCondenser         to CondenserUnity.InletQ;
    470 RebNoFlow.Outlet  to ReboilerUnity.Inlet;
    471 
    472 CondenserUnity.OutletV to ConnectorCondenserVout;
    473 SplitterTop.Outlet1             to ConnectorSplitterOut;
    474 ReboilerUnity.OutletL   to ConnectorReboilerLout;
     468HeatToReboiler  to REBOILER.InletQ;
     469HeatToCondenser         to CONDENSER.InletQ;
     470RebNoFlow.Outlet  to REBOILER.Inlet;
     471
     472CONDENSER.OutletV to ConnectorCondenserVout;
     473SPLITTERtop.Outlet1             to ConnectorSplitterOut;
     474REBOILER.OutletL        to ConnectorReboilerLout;
    475475
    476476end
     
    507507       
    508508== Initial Conditions ==
    509 * the trays temperature (OutletL.T);
    510 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     509* the TRAYS temperature (OutletL.T);
     510* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    511511* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    512512       
     
    519519* (NoComps - 1) OutletL (OR OutletV) compositions.
    520520";
    521        
     521
    522522PARAMETERS
    523523
     
    528528        out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true);
    529529        out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.515,Protected = true);
    530        
    531         CondenserUnity as condenserSteady;
    532         TopVessel               as tank_cylindrical;
    533         TopSplitter             as splitter;
    534         PumpUnity               as pump;
    535         ReboilerUnity   as reboilerSteady;
    536         BottomVessel    as tank;
    537         BottomSplitter  as splitter;
    538 
    539 
    540         alfaTopo                        as Real;
     530
     531        CONDENSER               as condenserSteady;
     532        TANKtop                                 as tank_cylindrical;
     533        SPLITTERtop             as splitter;
     534        PUMP                                    as pump;
     535        REBOILER                        as reboilerSteady;
     536        TANKbottom                      as tank;
     537        SPLITTERbottom  as splitter;
     538        alfaTopo                                        as Real;
    541539
    542540out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    543 out             HeatToReboiler          as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
     541out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    544542out             HeatToBottomVessel      as power                                (Brief="Heat supplied to Bottom Vessel",Hidden=true);
    545543out             HeatToTopVessel         as power                                (Brief="Heat supplied to Top Vessel",Hidden=true);
     
    565563        ConnectorSplitterBottom.z = BottomProduct.z;
    566564
    567         VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;
    568         VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;
    569         VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;
    570         VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;
    571 
    572         LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;
    573         LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;
    574         LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;
    575         LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;
     565        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     566        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     567        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     568        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     569
     570        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     571        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     572        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     573        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    576574
    577575        VapourDrawOffFlow = VapourDrawOff.F;
    578576        LiquidDrawOffFlow = LiquidDrawOff.F;
    579        
     577
    580578switch CondenserVapourFlow
    581579
    582580        case "on":
    583                 CondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -
    584                 CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));
    585                 when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";
     581                CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P -
     582                CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV));
     583                when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off";
    586584
    587585        case "off":
    588                 CondenserUnity.InletV.F = 0 * 'mol/s';
    589                 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";
     586                CONDENSER.InletV.F = 0 * 'mol/s';
     587                when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on";
    590588
    591589end     
    592        
     590
    593591CONNECTIONS
    594592#vapor
    595         ReboilerUnity.OutletV   to trays(NumberOfTrays).InletV;
    596         trays(1).OutletV                                to CondenserUnity.InletV;
     593        REBOILER.OutletV        to TRAYS(NumberOfTrays).InletV;
     594        TRAYS(1).OutletV                        to CONDENSER.InletV;
    597595
    598596#liquid
    599         CondenserUnity.OutletL          to TopVessel.Inlet;     
    600         TopVessel.Outlet                                        to TopSplitter.Inlet;
    601         TopSplitter.Outlet2                             to PumpUnity.Inlet;     
    602         PumpUnity.Outlet                                        to trays(1).InletL;
    603         trays(NumberOfTrays).OutletL    to BottomVessel.Inlet;
    604         BottomVessel.Outlet                             to BottomSplitter.Inlet;
    605         BottomSplitter.Outlet2                  to ReboilerUnity.InletL;
     597        CONDENSER.OutletL                               to TANKtop.Inlet;       
     598        TANKtop.Outlet                                                  to SPLITTERtop.Inlet;
     599        SPLITTERtop.Outlet2                             to PUMP.Inlet; 
     600        PUMP.Outlet                                                             to TRAYS(1).InletL;
     601        TRAYS(NumberOfTrays).OutletL    to TANKbottom.Inlet;
     602        TANKbottom.Outlet                                       to SPLITTERbottom.Inlet;
     603        SPLITTERbottom.Outlet2                          to REBOILER.InletL;
    606604
    607605#Connectors
    608 HeatToCondenser                         to CondenserUnity.InletQ;
    609 HeatToReboiler                  to ReboilerUnity.InletQ;
    610 HeatToBottomVessel      to BottomVessel.InletQ;
    611 HeatToTopVessel                 to TopVessel.InletQ;
    612 TopSplitter.Outlet1             to ConnectorSplitterTop;
    613 BottomSplitter.Outlet1  to ConnectorSplitterBottom;
     606HeatToCondenser                         to CONDENSER.InletQ;
     607HeatToReboiler                          to REBOILER.InletQ;
     608HeatToBottomVessel      to TANKbottom.InletQ;
     609HeatToTopVessel                 to TANKtop.InletQ;
     610SPLITTERtop.Outlet1     to ConnectorSplitterTop;
     611SPLITTERbottom.Outlet1  to ConnectorSplitterBottom;
    614612
    615613end
     
    644642       
    645643== Initial Conditions ==
    646 * the trays temperature (OutletL.T);
    647 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     644* the TRAYS temperature (OutletL.T);
     645* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    648646* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    649647       
     
    665663        out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.515,Protected = true);
    666664       
    667         CondenserUnity as condenser;
    668         SplitterTop             as splitter;
    669         PumpUnity               as pump;
    670         BottomVessel    as tank;
    671         SplitterBottom  as splitter;
    672         ReboilerUnity   as reboilerSteady;
     665        CONDENSER as condenser;
     666        SPLITTERtop             as splitter;
     667        PUMP            as pump;
     668        TANKbottom      as tank;
     669        SPLITTERbottom  as splitter;
     670        REBOILER        as reboilerSteady;
    673671        alfaTopo                        as Real;
    674672
     
    706704        ConnectorSplitterBottom.z = BottomProduct.z;
    707705
    708         VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;
    709         VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;
    710         VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;
    711         VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;
    712 
    713         LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;
    714         LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;
    715         LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;
    716         LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;
     706        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     707        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     708        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     709        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     710
     711        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     712        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     713        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     714        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    717715
    718716        VapourDrawOffFlow = VapourDrawOff.F;
     
    721719switch CondenserVapourFlow
    722720                case "on":
    723                 CondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -
    724                 CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));
    725                 when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";
     721                CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P -
     722                CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV));
     723                when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off";
    726724               
    727725                case "off":
    728                 CondenserUnity.InletV.F = 0 * 'mol/s';
    729                 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";
     726                CONDENSER.InletV.F = 0 * 'mol/s';
     727                when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on";
    730728end     
    731729
    732730CONNECTIONS
    733731#vapor
    734         ReboilerUnity.OutletV   to trays(NumberOfTrays).InletV;
    735         trays(1).OutletV                                to CondenserUnity.InletV;
     732        REBOILER.OutletV        to TRAYS(NumberOfTrays).InletV;
     733        TRAYS(1).OutletV                                to CONDENSER.InletV;
    736734
    737735#liquid
    738         CondenserUnity.OutletL          to SplitterTop.Inlet;   
    739         SplitterTop.Outlet2                             to PumpUnity.Inlet;
    740         PumpUnity.Outlet                                        to trays(1).InletL;
    741         trays(NumberOfTrays).OutletL    to BottomVessel.Inlet;
    742         BottomVessel.Outlet                             to SplitterBottom.Inlet;
    743         SplitterBottom.Outlet2                  to ReboilerUnity.InletL;
     736        CONDENSER.OutletL               to SPLITTERtop.Inlet;   
     737        SPLITTERtop.Outlet2                             to PUMP.Inlet;
     738        PUMP.Outlet                                     to TRAYS(1).InletL;
     739        TRAYS(NumberOfTrays).OutletL    to TANKbottom.Inlet;
     740        TANKbottom.Outlet                               to SPLITTERbottom.Inlet;
     741        SPLITTERbottom.Outlet2                  to REBOILER.InletL;
    744742
    745743#Connectors
    746 HeatToCondenser                         to CondenserUnity.InletQ;
    747 HeatToReboiler                          to ReboilerUnity.InletQ;
    748 HeatToBottomVessel      to BottomVessel.InletQ;
    749 CondenserUnity.OutletV to ConnectorCondenserVout;
    750 SplitterTop.Outlet1             to ConnectorSplitterTop;
    751 SplitterBottom.Outlet1  to ConnectorSplitterBottom;
     744HeatToCondenser                         to CONDENSER.InletQ;
     745HeatToReboiler                          to REBOILER.InletQ;
     746HeatToBottomVessel      to TANKbottom.InletQ;
     747CONDENSER.OutletV to ConnectorCondenserVout;
     748SPLITTERtop.Outlet1             to ConnectorSplitterTop;
     749SPLITTERbottom.Outlet1  to ConnectorSplitterBottom;
    752750
    753751end
     
    782780       
    783781== Initial Conditions ==
    784 * the trays temperature (OutletL.T);
    785 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     782* the TRAYS temperature (OutletL.T);
     783* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    786784* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    787785       
     
    801799        out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.46,Protected = true);
    802800        out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true);
    803         CondenserUnity as condenserSteady;
    804         TopVessel               as tank_cylindrical;
    805         SplitterTop             as splitter;
    806         PumpUnity               as pump;
    807         ReboilerUnity   as reboiler;
     801       
     802        CONDENSER as condenserSteady;
     803        TANKtop as tank_cylindrical;
     804        SPLITTERtop             as splitter;
     805        PUMP            as pump;
     806        REBOILER        as reboiler;
    808807        alfaTopo as Real;
    809808
     
    834833        ConnectorReboilerLout.z = BottomProduct.z;
    835834       
    836         VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;
    837         VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;
    838         VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;
    839         VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;
    840 
    841         LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;
    842         LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;
    843         LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;
    844         LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;
     835        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     836        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     837        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     838        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     839
     840        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     841        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     842        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     843        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    845844
    846845        VapourDrawOffFlow = VapourDrawOff.F;
     
    849848        switch CondenserVapourFlow
    850849                case "on":
    851                 CondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -
    852                 CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));
    853                 when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";
     850                CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P -
     851                CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV));
     852                when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off";
    854853               
    855854                case "off":
    856                 CondenserUnity.InletV.F = 0 * 'mol/s';
    857                 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";
     855                CONDENSER.InletV.F = 0 * 'mol/s';
     856                when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on";
    858857end     
    859858
    860859CONNECTIONS
    861860#vapor
    862         ReboilerUnity.OutletV to trays(NumberOfTrays).InletV;
    863         trays(1).OutletV to CondenserUnity.InletV;
     861        REBOILER.OutletV to TRAYS(NumberOfTrays).InletV;
     862        TRAYS(1).OutletV to CONDENSER.InletV;
    864863
    865864#liquid
    866         CondenserUnity.OutletL          to TopVessel.Inlet;     
    867         TopVessel.Outlet                                        to SplitterTop.Inlet;
    868         SplitterTop.Outlet2                             to PumpUnity.Inlet;     
    869         PumpUnity.Outlet                                        to trays(1).InletL;
    870         trays(NumberOfTrays).OutletL    to ReboilerUnity.InletL;
     865        CONDENSER.OutletL               to TANKtop.Inlet;       
     866        TANKtop.Outlet                                  to SPLITTERtop.Inlet;
     867        SPLITTERtop.Outlet2                             to PUMP.Inlet; 
     868        PUMP.Outlet                                     to TRAYS(1).InletL;
     869        TRAYS(NumberOfTrays).OutletL    to REBOILER.InletL;
    871870
    872871#Connectors
    873 HeatToCondenser                         to CondenserUnity.InletQ;
    874 HeatToReboiler                          to ReboilerUnity.InletQ;
    875 HeatToTopVessel                         to TopVessel.InletQ;
    876 RebNoFlow.Outlet                to ReboilerUnity.Inlet;
    877 
    878 SplitterTop.Outlet1             to ConnectorSplitterOut;
    879 ReboilerUnity.OutletL   to ConnectorReboilerLout;
     872HeatToCondenser                         to CONDENSER.InletQ;
     873HeatToReboiler                          to REBOILER.InletQ;
     874HeatToTopVessel                         to TANKtop.InletQ;
     875RebNoFlow.Outlet                to REBOILER.Inlet;
     876
     877SPLITTERtop.Outlet1             to ConnectorSplitterOut;
     878REBOILER.OutletL        to ConnectorReboilerLout;
    880879
    881880end
     
    906905       
    907906== Initial Conditions ==
    908 * the trays temperature (OutletL.T);
    909 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     907* the TRAYS temperature (OutletL.T);
     908* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    910909* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    911910       
     
    923922        out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true);
    924923       
    925         CondenserUnity as condenser;
    926         SplitterTop as splitter;
    927         PumpUnity as pump;
     924        CONDENSER as condenser;
     925        SPLITTERtop as splitter;
     926        PUMP as pump;
    928927        alfaTopo as Real;
    929928
     
    936935        out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
    937936        in              ConnectorSplitterOut    as stream                       (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true);
    938         VapourConnector as stream       (Brief="Vapour connection at the middle trays", PosX=0.55, PosY=0,Hidden=true);
     937        VapourConnector as stream       (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
    939938       
    940939EQUATIONS
     
    943942
    944943        case "on":
    945                 CondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -
    946                 CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));
    947                 when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";
     944                CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletV.P -
     945                CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV));
     946                when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off";
    948947               
    949948        case "off":
    950                 CondenserUnity.InletV.F = 0 * 'mol/s';
    951                 when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";
     949                CONDENSER.InletV.F = 0 * 'mol/s';
     950                when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on";
    952951
    953952end     
     
    965964        ConnectorSplitterOut.z = LiquidDistillate.z;
    966965       
    967         LiquidOutlet.F= trays(NumberOfTrays).OutletL.F;
    968         LiquidOutlet.T = trays(NumberOfTrays).OutletL.T;
    969         LiquidOutlet.P = trays(NumberOfTrays).OutletL.P;
    970         LiquidOutlet.z = trays(NumberOfTrays).OutletL.z;
     966        LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F;
     967        LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T;
     968        LiquidOutlet.P = TRAYS(NumberOfTrays).OutletL.P;
     969        LiquidOutlet.z = TRAYS(NumberOfTrays).OutletL.z;
    971970
    972971        VapourConnector.F= VapourInlet.F;
     
    977976        VapourConnector.h = VapourInlet.h;
    978977
    979         VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;
    980         VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;
    981         VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;
    982         VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;
    983 
    984         LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;
    985         LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;
    986         LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;
    987         LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;
     978        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     979        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     980        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     981        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     982
     983        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     984        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     985        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     986        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    988987
    989988        VapourDrawOffFlow = VapourDrawOff.F;
     
    992991CONNECTIONS
    993992#vapor
    994         trays(1).OutletV to CondenserUnity.InletV;
     993        TRAYS(1).OutletV to CONDENSER.InletV;
    995994
    996995#liquid
    997         CondenserUnity.OutletL to SplitterTop.Inlet;   
    998         SplitterTop.Outlet2 to PumpUnity.Inlet;
    999         PumpUnity.Outlet to trays(1).InletL;
     996        CONDENSER.OutletL to SPLITTERtop.Inlet;
     997        SPLITTERtop.Outlet2 to PUMP.Inlet;     
     998        PUMP.Outlet to TRAYS(1).InletL;
    1000999
    10011000#Connectors
    1002 HeatToCondenser         to CondenserUnity.InletQ;
    1003 VapourConnector to trays(NumberOfTrays).InletV;
    1004 SplitterTop.Outlet1             to ConnectorSplitterOut;
    1005 CondenserUnity.OutletV to ConnectorCondenserVout;
     1001HeatToCondenser         to CONDENSER.InletQ;
     1002VapourConnector to TRAYS(NumberOfTrays).InletV;
     1003SPLITTERtop.Outlet1             to ConnectorSplitterOut;
     1004CONDENSER.OutletV to ConnectorCondenserVout;
    10061005
    10071006end
     
    10371036       
    10381037== Initial Conditions ==
    1039 * the trays temperature (OutletL.T);
    1040 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     1038* the TRAYS temperature (OutletL.T);
     1039* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    10411040* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    10421041       
     
    10501049
    10511050VARIABLES
    1052         CondenserUnity as condenserSteady;
    1053         TopVessel               as tank_cylindrical;
    1054         SplitterTop             as splitter;
    1055         PumpUnity               as pump;
     1051        CONDENSER as condenserSteady;
     1052        TANKtop                 as tank_cylindrical;
     1053        SPLITTERtop             as splitter;
     1054        PUMP            as pump;
    10561055        alfaTopo                        as Real;
    10571056
     
    10641063        out             HeatToTopVessel         as power                                (Brief="Heat supplied to Top Vessel",Hidden=true);
    10651064
    1066         VapourConnector as stream               (Brief="Vapour connection at the middle trays", PosX=0.55, PosY=0,Hidden=true);
     1065        VapourConnector as stream               (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true);
    10671066
    10681067EQUATIONS
    10691068
    1070         LiquidOutlet.F= trays(NumberOfTrays).OutletL.F;
    1071         LiquidOutlet.T = trays(NumberOfTrays).OutletL.T;
    1072         LiquidOutlet.P = trays(NumberOfTrays).OutletL.P;
    1073         LiquidOutlet.z = trays(NumberOfTrays).OutletL.z;
     1069        LiquidOutlet.F= TRAYS(NumberOfTrays).OutletL.F;
     1070        LiquidOutlet.T = TRAYS(NumberOfTrays).OutletL.T;
     1071        LiquidOutlet.P = TRAYS(NumberOfTrays).OutletL.P;
     1072        LiquidOutlet.z = TRAYS(NumberOfTrays).OutletL.z;
    10741073
    10751074        VapourConnector.F= VapourInlet.F;
     
    10891088
    10901089        case "on":
    1091                 CondenserUnity.InletV.F*trays(1).vV = alfaTopo *Ah * sqrt(2*(trays(1).OutletV.P -
    1092                 CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));
    1093         when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";
     1090                CONDENSER.InletV.F*TRAYS(1).vV = alfaTopo *Ah * sqrt(2*(TRAYS(1).OutletV.P -
     1091                CONDENSER.OutletL.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV));
     1092        when CONDENSER.InletV.F < 1e-6 * 'kmol/h' switchto "off";
    10941093               
    10951094        case "off":
    1096                 CondenserUnity.InletV.F = 0 * 'mol/s';
    1097         when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";
     1095                CONDENSER.InletV.F = 0 * 'mol/s';
     1096        when TRAYS(1).OutletV.P > CONDENSER.OutletL.P + 1e-1 * 'atm' switchto "on";
    10981097
    10991098end     
    1100        
     1099
    11011100CONNECTIONS
    11021101#vapor
    1103         trays(1).OutletV to CondenserUnity.InletV;
    1104        
     1102        TRAYS(1).OutletV to CONDENSER.InletV;
     1103
    11051104#liquid
    1106         CondenserUnity.OutletL to TopVessel.Inlet;     
    1107         TopVessel.Outlet                        to SplitterTop.Inlet;
    1108         SplitterTop.Outlet2             to PumpUnity.Inlet;     
    1109         PumpUnity.Outlet                        to trays(1).InletL;
     1105        CONDENSER.OutletL               to TANKtop.Inlet;       
     1106        TANKtop.Outlet                                  to SPLITTERtop.Inlet;
     1107        SPLITTERtop.Outlet2             to PUMP.Inlet; 
     1108        PUMP.Outlet                                             to TRAYS(1).InletL;
    11101109
    11111110#Connectors
    1112         VapourConnector                 to trays(NumberOfTrays).InletV;
    1113         HeatToCondenser                 to CondenserUnity.InletQ;
    1114         SplitterTop.Outlet1     to ConnectorSplitterTop;
    1115         HeatToTopVessel         to TopVessel.InletQ;
    1116        
     1111        VapourConnector                         to TRAYS(NumberOfTrays).InletV;
     1112        HeatToCondenser                         to CONDENSER.InletQ;
     1113        SPLITTERtop.Outlet1     to ConnectorSplitterTop;
     1114        HeatToTopVessel                 to TANKtop.InletQ;
     1115
    11171116end
    11181117
     
    11261125* ------------------------------------------------------------------*#
    11271126Model Reboiled_Stripping_kettle as Section_ColumnBasic
    1128        
    1129         # calculo da vazao de vapor ?????
    11301127       
    11311128ATTRIBUTES
     
    11431140       
    11441141== Initial Conditions ==
    1145 * the trays temperature (OutletL.T);
    1146 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     1142* the TRAYS temperature (OutletL.T);
     1143* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    11471144* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    11481145       
     
    11631160        out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
    11641161       
    1165         LiquidConnector as stream                               (Brief="Liquid connection at the middle trays", PosX=0.75, PosY=1,Hidden=true);
     1162        LiquidConnector as stream                               (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
    11661163        RebNoFlow               as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true);
    11671164       
     
    11701167CONNECTIONS
    11711168#vapor
    1172         REBOILER.OutletV to trays(NumberOfTrays).InletV;
     1169        REBOILER.OutletV to TRAYS(NumberOfTrays).InletV;
    11731170       
    11741171#liquid
    1175         trays(NumberOfTrays).OutletL to REBOILER.InletL;
     1172        TRAYS(NumberOfTrays).OutletL to REBOILER.InletL;
    11761173
    11771174#Connectors
    11781175REBOILER.OutletL        to ConnectorReboilerLout;
    1179 LiquidConnector                 to trays(1).InletL;
     1176LiquidConnector                 to TRAYS(1).InletL;
    11801177RebNoFlow.Outlet        to REBOILER.Inlet;
    11811178HeatToReboiler                  to REBOILER.InletQ;
     
    11901187        LiquidConnector.h = LiquidInlet.h;
    11911188       
    1192         VapourOutlet.F= trays(1).OutletV.F;
    1193         VapourOutlet.T = trays(1).OutletV.T;
    1194         VapourOutlet.P = trays(1).OutletV.P;
    1195         VapourOutlet.z = trays(1).OutletV.z;
     1189        VapourOutlet.F= TRAYS(1).OutletV.F;
     1190        VapourOutlet.T = TRAYS(1).OutletV.T;
     1191        VapourOutlet.P = TRAYS(1).OutletV.P;
     1192        VapourOutlet.z = TRAYS(1).OutletV.z;
    11961193       
    11971194# Reboiler Connector Equations
     
    12011198        ConnectorReboilerLout.z = BottomProduct.z;
    12021199       
    1203         VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F;
    1204         VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T;
    1205         VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P;
    1206         VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z;
    1207 
    1208         LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F;
    1209         LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T;
    1210         LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P;
    1211         LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z;
     1200        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     1201        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     1202        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     1203        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     1204
     1205        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     1206        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     1207        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     1208        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
    12121209
    12131210        VapourDrawOffFlow = VapourDrawOff.F;
     
    12251222*       - steady state reboiler (thermosyphon);
    12261223*
    1227 * ------------------------------------------------------------------*
    1228 Model Reboiled_Stripping_thermosyphon
    1229         ATTRIBUTES
     1224* ------------------------------------------------------------------*#
     1225Model Reboiled_Stripping_thermosyphon as Section_ColumnBasic
     1226
     1227ATTRIBUTES
    12301228        Pallete         = true;
    12311229        Icon            = "icon/ReboiledThermosyphon";
     
    12421240       
    12431241== Initial Conditions ==
    1244 * the trays temperature (OutletL.T);
    1245 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     1242* the TRAYS temperature (OutletL.T);
     1243* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    12461244* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    12471245
     
    12511249";
    12521250       
    1253         PARAMETERS
    1254         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    1255         outer NComp as Integer;
    1256         NumberOfTrays as Integer(Brief="Number of trays", Default=2);
    1257         topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    1258         top as Integer(Brief="Number of top tray");
    1259         bot as Integer(Brief="Number of bottom tray");
    1260 
    1261         SET
    1262         top = (NumberOfTrays-1)*(1-topdown)/2+1;
    1263         bot = NumberOfTrays/top;
    1264        
    1265         VARIABLES
    1266         trays(NumberOfTrays) as trayTeste;
    1267         reb as reboilerSteady;
    1268         spbottom as splitter;
    1269         tbottom as tank;
    1270 
    1271         CONNECTIONS
    1272         #vapor
    1273         reb.OutletV to trays(bot).InletV;
    1274         trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    1275        
    1276         #liquid
    1277         trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
    1278         trays(bot).OutletL to tbottom.Inlet;
    1279         tbottom.Outlet to spbottom.Inlet;
    1280         spbottom.Outlet2 to reb.InletL;
     1251VARIABLES
     1252        out     VapourDrawOff   as vapour_stream                (Brief="Vapour Outlet in the section", PosX=1, PosY=0.32,Protected = true);
     1253        out     LiquidDrawOff           as liquid_stream                        (Brief="Liquid Outlet in the section", PosX=1, PosY=0.44,Protected = true);
     1254       
     1255        in              LiquidInlet                                             as      stream                  (Brief="Liquid Inlet in the section", PosX=0.32, PosY=0);
     1256        out     VapourOutlet                                    as vapour_stream        (Brief="Vapour Outlet in the section", PosX=0.20, PosY=0);
     1257        out     BottomProduct                           as liquid_stream                (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=1);
     1258        LiquidConnector                                         as stream                               (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true);
     1259        out             HeatToReboiler                  as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
     1260        out             HeatToTANKbottom        as power                                (Brief="Heat supplied to Bottom Vessel",Hidden=true);
     1261        in              ConnectorSplitterBottom         as stream                       (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true);
     1262       
     1263        REBOILER                                as reboilerSteady;
     1264        SPLITTERbottom  as splitter;
     1265        TANKbottom                      as tank;
     1266
     1267CONNECTIONS
     1268#vapor
     1269        REBOILER.OutletV to TRAYS(NumberOfTrays).InletV;
     1270       
     1271#liquid
     1272        TRAYS(NumberOfTrays).OutletL                            to TANKbottom.Inlet;
     1273        TANKbottom.Outlet                                                               to SPLITTERbottom.Inlet;
     1274        SPLITTERbottom.Outlet2                                          to REBOILER.InletL;
     1275
     1276#Connectors
     1277LiquidConnector                                 to TRAYS(1).InletL;
     1278HeatToReboiler                                  to REBOILER.InletQ;
     1279HeatToTANKbottom                        to TANKbottom.InletQ;
     1280SPLITTERbottom.Outlet1  to ConnectorSplitterBottom;
     1281
     1282EQUATIONS
     1283
     1284        ConnectorSplitterBottom.T = BottomProduct.T;
     1285        ConnectorSplitterBottom.P = BottomProduct.P;
     1286        ConnectorSplitterBottom.F = BottomProduct.F;
     1287        ConnectorSplitterBottom.z = BottomProduct.z;
     1288       
     1289        LiquidConnector.F= LiquidInlet.F;
     1290        LiquidConnector.T = LiquidInlet.T;
     1291        LiquidConnector.P = LiquidInlet.P;
     1292        LiquidConnector.z = LiquidInlet.z;
     1293        LiquidConnector.v = LiquidInlet.v;
     1294        LiquidConnector.h = LiquidInlet.h;
     1295       
     1296        VapourOutlet.F= TRAYS(1).OutletV.F;
     1297        VapourOutlet.T = TRAYS(1).OutletV.T;
     1298        VapourOutlet.P = TRAYS(1).OutletV.P;
     1299        VapourOutlet.z = TRAYS(1).OutletV.z;
     1300       
     1301        VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F;
     1302        VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T;
     1303        VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P;
     1304        VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z;
     1305
     1306        LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F;
     1307        LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T;
     1308        LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P;
     1309        LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z;
     1310
     1311        VapourDrawOffFlow = VapourDrawOff.F;
     1312        LiquidDrawOffFlow = LiquidDrawOff.F;
     1313       
    12811314end
    12821315
     
    12851318*
    12861319* ------------------------------------------------------------------*
    1287 Model ReactiveDistillationTeste
    1288         ATTRIBUTES
     1320Model ReactiveDistillation
     1321       
     1322ATTRIBUTES
    12891323        Pallete         = true;
    12901324        Icon            = "icon/DistillationKettleCond";
     
    13021336       
    13031337== Initial Conditions ==
    1304 * the trays temperature (OutletL.T);
    1305 * the trays liquid level (Level) OR the trays liquid flow (OutletL.F);
     1338* the TRAYS temperature (OutletL.T);
     1339* the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletL.F);
    13061340* (NoComps - 1) OutletL (OR OutletV) compositions for each tray;
    13071341       
     
    13181352        outer PP as Plugin(Type="PP");
    13191353        outer NComp as Integer;
    1320         NumberOfTrays as Integer(Brief="Number of trays", Default=2);
     1354        NumberOfTrays as Integer(Brief="Number of TRAYS", Default=2);
    13211355        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    13221356        top as Integer(Brief="Number of top tray");
     
    13311365       
    13321366        VARIABLES
    1333         trays(NumberOfTrays) as trayReactTeste;
     1367        TRAYS(NumberOfTrays) as trayReactTeste;
    13341368        cond as condenserReact;
    13351369        reb as reboilerReact;
     
    13421376                case "on":
    13431377                "Pressure Drop through the condenser"
    1344                 cond.InletV.F*trays(top).vV / 'm^2' =
    1345                         sqrt((trays(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm')/(trays(top).rhoV*alfacond));
    1346                 when trays(top).OutletV.P < cond.OutletL.P switchto "off";
     1378                cond.InletV.F*TRAYS(top).vV / 'm^2' =
     1379                        sqrt((TRAYS(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm')/(TRAYS(top).rhoV*alfacond));
     1380                when TRAYS(top).OutletV.P < cond.OutletL.P switchto "off";
    13471381               
    13481382                case "off":
    13491383                "Prato selado"
    13501384                cond.InletV.F = 0.0 * 'mol/s';
    1351                 when trays(top).OutletV.P > cond.OutletL.P + 1e-3 * 'atm' switchto "on";
     1385                when TRAYS(top).OutletV.P > cond.OutletL.P + 1e-3 * 'atm' switchto "on";
    13521386        end
    13531387
    13541388        CONNECTIONS
    13551389        #vapor
    1356         reb.OutletV to trays(bot).InletV;
    1357         trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    1358         trays(top).OutletV to cond.InletV;
     1390        reb.OutletV to TRAYS(bot).InletV;
     1391        TRAYS([top+topdown:topdown:bot]).OutletV to TRAYS([top:topdown:bot-topdown]).InletV;
     1392        TRAYS(top).OutletV to cond.InletV;
    13591393       
    13601394        #liquid
    13611395        cond.OutletL to sp.Inlet;       
    13621396        sp.Outlet2 to p.Inlet;
    1363         p.Outlet to trays(top).InletL;
    1364         trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
    1365         trays(bot).OutletL to reb.InletL;
     1397        p.Outlet to TRAYS(top).InletL;
     1398        TRAYS([top:topdown:bot-topdown]).OutletL to TRAYS([top+topdown:topdown:bot]).InletL;
     1399        TRAYS(bot).OutletL to reb.InletL;
    13661400       
    13671401end
     
    13961430        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    13971431        outer NComp as Integer;
    1398         NStages as Integer(Brief="Number of trays", Default=2);
     1432        NStages as Integer(Brief="Number of TRAYS", Default=2);
    13991433        topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    14001434        top as Integer(Brief="Number of top tray");
Note: See TracChangeset for help on using the changeset viewer.