Changeset 649 for branches/gui/eml


Ignore:
Timestamp:
Sep 30, 2008, 6:42:41 PM (14 years ago)
Author:
gerson bicca
Message:

testing column model in the GUI (Distillation_thermosyphon_subcooling)

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

Legend:

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

    r648 r649  
    447447*       - a pump in reflux stream.
    448448*
    449 * ------------------------------------------------------------------
    450 Model Distillation_thermosyphon_subcoolingTeste
     449* ------------------------------------------------------------------*#
     450Model Distillation_thermosyphon_subcooling as Section_ColumnBasic
    451451        ATTRIBUTES
    452452        Pallete         = true;
     
    478478";
    479479       
    480         PARAMETERS
    481         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    482         outer NComp as Integer;
    483         NumberOfTrays as Integer(Brief="Number of trays", Default=2);
    484         topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    485         top as Integer(Brief="Number of top tray");
    486         bot as Integer(Brief="Number of bottom tray");
    487         VapourFlow as Switcher(Valid = ["on", "off"], Default = "on");
    488 
    489         SET
    490         top = (NumberOfTrays-1)*(1-topdown)/2+1;
    491         bot = NumberOfTrays/top;
    492        
    493         VARIABLES
    494         trays(NumberOfTrays) as trayTeste;
    495         cond as condenserSteady;
    496         reb as reboilerSteady;
    497         tbottom as tank;
    498         ttop as tank_cylindrical;
    499         spbottom as splitter;
    500         sptop as splitter;
    501         pump1 as pump;
    502         alfaTopo as Real;
    503 
    504         EQUATIONS
    505         switch VapourFlow
    506                 case "on":
    507                 cond.InletV.F*trays(top).vV = alfaTopo * trays(top).Ah * sqrt(2*(trays(top).OutletV.P -
    508                 cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV));
    509                 when cond.InletV.F < 1e-6 * 'kmol/h' switchto "off";
    510                
    511                 case "off":
    512                 cond.InletV.F = 0 * 'mol/s';
    513                 when trays(top).OutletV.P > cond.OutletL.P + 1e-1 * 'atm' switchto "on";
    514         end     
    515        
    516         CONNECTIONS
    517         #vapor
    518         reb.OutletV to trays(bot).InletV;
    519         trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV;
    520         trays(top).OutletV to cond.InletV;
    521        
    522         #liquid
    523         cond.OutletL to ttop.Inlet;     
    524         ttop.Outlet to sptop.Inlet;
    525         sptop.Outlet2 to pump1.Inlet;   
    526         pump1.Outlet to trays(top).InletL;
    527         trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL;
    528         trays(bot).OutletL to tbottom.Inlet;
    529         tbottom.Outlet to spbottom.Inlet;
    530         spbottom.Outlet2 to reb.InletL;
     480PARAMETERS
     481
     482        CondenserVapourFlow as Switcher(Valid = ["on", "off"], Hidden=true, Default = "on");
     483
     484VARIABLES
     485        CondenserUnity as condenserSteady;
     486        TopVessel               as tank_cylindrical;
     487        TopSplitter             as splitter;
     488        PumpUnity               as pump;
     489        ReboilerUnity   as reboilerSteady;
     490        BottomVessel    as tank;
     491        BottomSplitter  as splitter;
     492
     493
     494        alfaTopo                        as Real;
     495
     496out             HeatToCondenser         as power                                (Brief="Heat supplied to Condenser",Hidden=true);
     497out             HeatToReboiler          as power                                (Brief="Heat supplied to Reboiler",Hidden=true);
     498out             HeatToBottomVessel      as power                                (Brief="Heat supplied to Bottom Vessel",Hidden=true);
     499out             HeatToTopVessel         as power                                (Brief="Heat supplied to Top Vessel",Hidden=true);
     500
     501EQUATIONS
     502
     503switch CondenserVapourFlow
     504
     505        case "on":
     506                CondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P -
     507                CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV));
     508                when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off";
     509
     510        case "off":
     511                CondenserUnity.InletV.F = 0 * 'mol/s';
     512                when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on";
     513
     514end     
     515       
     516CONNECTIONS
     517#vapor
     518        ReboilerUnity.OutletV   to trays(NumberOfTrays).InletV;
     519        trays(1).OutletV                                to CondenserUnity.InletV;
     520
     521#liquid
     522        CondenserUnity.OutletL          to TopVessel.Inlet;     
     523        TopVessel.Outlet                                        to TopSplitter.Inlet;
     524        TopSplitter.Outlet2                             to PumpUnity.Inlet;     
     525        PumpUnity.Outlet                                        to trays(1).InletL;
     526        trays(NumberOfTrays).OutletL    to BottomVessel.Inlet;
     527        BottomVessel.Outlet                             to BottomSplitter.Inlet;
     528        BottomSplitter.Outlet2                  to ReboilerUnity.InletL;
     529
     530#Connectors
     531HeatToCondenser                         to CondenserUnity.InletQ;
     532HeatToReboiler                  to ReboilerUnity.InletQ;
     533HeatToBottomVessel      to BottomVessel.InletQ;
     534HeatToTopVessel                 to TopVessel.InletQ;
     535
    531536end
    532537
  • branches/gui/eml/stage_separators/condenser.mso

    r648 r649  
    122122* the heat supply.
    123123";
    124        
    125         PARAMETERS
    126         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
     124
     125PARAMETERS
     126        outer PP                as Plugin       (Brief = "External Physical Properties", Type="PP");
    127127        outer NComp as Integer;
    128128
    129         VARIABLES
    130 in      InletV as stream(Brief="Vapour inlet stream", PosX=0.3431, PosY=0, Symbol="_{inV}");
    131 out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.34375, PosY=1, Symbol="_{outL}");
    132 in      InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.5974, Symbol="_{in}");
    133         DP as press_delta (Brief="Pressure Drop in the condenser");
    134 
    135         EQUATIONS
    136         "Molar Balance"
     129VARIABLES
     130in      InletV          as stream                               (Brief="Vapour inlet stream", PosX=0.3431, PosY=0, Symbol="_{inV}");
     131out     OutletL as liquid_stream                (Brief="Liquid outlet stream", PosX=0.34375, PosY=1, Symbol="_{outL}");
     132in      InletQ          as power                                (Brief="Cold supplied", PosX=1, PosY=0.5974, Symbol="_{in}");
     133        DP                      as press_delta          (Brief="Pressure Drop in the condenser");
     134
     135EQUATIONS
     136
     137"Molar Balance"
    137138        InletV.F = OutletL.F;
    138139        InletV.z = OutletL.z;
    139                
    140         "Energy Balance"
     140
     141"Energy Balance"
    141142        InletV.F*InletV.h = OutletL.F*OutletL.h + InletQ;
    142        
    143         "Pressure"
     143
     144"Pressure"
    144145        DP = InletV.P - OutletL.P;
     146
    145147end
    146148
  • branches/gui/eml/stage_separators/reboiler.mso

    r648 r649  
    130130";     
    131131
    132         PARAMETERS
    133         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    134         outer NComp as Integer;
    135         DP as press_delta (Brief="Pressure Drop in the reboiler");
    136 
    137         VARIABLES
    138 in      InletL as stream(Brief="Liquid inlet stream", PosX=0.3345, PosY=1, Symbol="_{inL}");
    139 out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.3369, PosY=0, Symbol="_{outV}");
    140 in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
    141         vV as volume_mol (Brief="Vapour Molar volume");
    142         rhoV as dens_mass (Brief="Vapour Density");
    143 
    144         EQUATIONS
    145         "Molar Balance"
     132PARAMETERS
     133        outer PP                        as Plugin                       (Brief = "External Physical Properties", Type="PP");
     134        outer NComp     as Integer;
     135        DP                                      as press_delta  (Brief="Pressure Drop in the reboiler");
     136
     137VARIABLES
     138in      InletL                  as stream                                       (Brief="Liquid inlet stream", PosX=0.3345, PosY=1, Symbol="_{inL}");
     139out     OutletV         as vapour_stream                (Brief="Vapour outlet stream", PosX=0.3369, PosY=0, Symbol="_{outV}");
     140in      InletQ                  as power                                        (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
     141        vV                              as volume_mol                   (Brief="Vapour Molar volume");
     142        rhoV                    as dens_mass                    (Brief="Vapour Density");
     143
     144EQUATIONS
     145
     146"Molar Balance"
    146147        InletL.F = OutletV.F;
    147148        InletL.z = OutletV.z;
    148149       
    149         "Vapour Volume"
     150"Vapour Volume"
    150151        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
    151152       
    152         "Vapour Density"
     153"Vapour Density"
    153154        rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z);
    154155
    155         "Energy Balance"
     156"Energy Balance"
    156157        InletL.F*InletL.h + InletQ = OutletV.F*OutletV.h;
    157158       
    158         "Pressure"
     159"Pressure"
    159160        DP = InletL.P - OutletV.P;
     161
    160162end
    161163
  • branches/gui/eml/stage_separators/tank.mso

    r555 r649  
    5353";
    5454
    55         PARAMETERS
    56         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    57         outer NComp as Integer;
    58         Across as area (Brief="Tank cross section area", Default=2);
    59        
    60         VARIABLES
    61 in      Inlet  as stream (Brief = "Inlet stream", PosX=0.3037, PosY=0, Symbol="_{in}");
    62 out     Outlet as liquid_stream (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
    63 in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}");
    64         Level    as length(Brief="Tank level");
    65         M(NComp) as mol (Brief="Molar Holdup in the tank");
    66         E as energy (Brief="Total Energy Holdup on tank");
    67         vL as volume_mol (Brief="Liquid Molar Volume");
    68 
    69         EQUATIONS
    70         "Mass balance"
     55PARAMETERS
     56        outer PP                        as Plugin               (Brief = "External Physical Properties", Type="PP");
     57        outer NComp     as Integer;
     58        Across                          as area                         (Brief="Tank cross section area", Default=2);
     59       
     60VARIABLES
     61in      Inlet                   as stream                               (Brief = "Inlet stream", PosX=0.3037, PosY=0, Symbol="_{in}");
     62out     Outlet          as liquid_stream        (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
     63in      InletQ                  as power                                (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}");
     64        Level                   as length                               (Brief="Tank level");
     65        M(NComp)        as mol                                  (Brief="Molar Holdup in the tank");
     66        E                                       as energy                               (Brief="Total Energy Holdup on tank");
     67        vL                              as volume_mol           (Brief="Liquid Molar Volume");
     68
     69EQUATIONS
     70
     71"Mass balance"
    7172        diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
    72        
    73         "Energy balance"
     73
     74"Energy balance"
    7475        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ;
    7576
    76         "Energy Holdup"
     77"Energy Holdup"
    7778        E = sum(M)*Outlet.h;
    7879
    79         "Mechanical Equilibrium"
     80"Mechanical Equilibrium"
    8081        Inlet.P = Outlet.P;
    81        
    82         "Liquid Volume"
     82
     83"Liquid Volume"
    8384        vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
    84        
    85         "Composition"
     85
     86"Composition"
    8687        M = Outlet.z*sum(M);
    87        
    88         "Level of liquid phase"
     88
     89"Level of liquid phase"
    8990        Level = sum(M)*vL/Across;
     91
    9092end
    9193
     
    112114";
    113115       
    114         PARAMETERS
    115         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    116         outer NComp as Integer;
    117         radius as length(Brief="Tank radius");
    118         L as length(Brief="Tank length");
    119        
    120         VARIABLES
    121 in      Inlet  as stream (Brief = "Inlet stream", PosX=0.1825, PosY=0, Symbol="_{in}");
    122 out     Outlet as liquid_stream (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
    123 in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.6160, Symbol="_{in}");
    124         Level    as length(Brief="Tank level");
    125         Across as area (Brief="Tank cross section area", Default=2);
    126         M(NComp) as mol (Brief="Molar Holdup in the tank");
    127         E as energy (Brief="Total Energy Holdup on tank");
    128         vL as volume_mol (Brief="Liquid Molar Volume");
    129 
    130         EQUATIONS
    131         "Mass balance"
     116PARAMETERS
     117        outer PP                        as Plugin               (Brief = "External Physical Properties", Type="PP");
     118        outer NComp     as Integer;
     119        radius                          as length               (Brief="Tank radius");
     120        L                                               as length               (Brief="Tank length");
     121       
     122VARIABLES
     123in      Inlet           as stream                               (Brief = "Inlet stream", PosX=0.1825, PosY=0, Symbol="_{in}");
     124out     Outlet  as liquid_stream        (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
     125in      InletQ          as power                                (Brief="Rate of heat supply", PosX=1, PosY=0.6160, Symbol="_{in}");
     126        Level           as length                               (Brief="Tank level");
     127        Across          as area                                         (Brief="Tank cross section area", Default=2);
     128        M(NComp) as mol                                         (Brief="Molar Holdup in the tank");
     129        E                               as energy                               (Brief="Total Energy Holdup on tank");
     130        vL                      as volume_mol           (Brief="Liquid Molar Volume");
     131
     132EQUATIONS
     133
     134"Mass balance"
    132135        diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
    133136       
    134         "Energy balance"
     137"Energy balance"
    135138        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ;
    136139
    137         "Energy Holdup"
     140"Energy Holdup"
    138141        E = sum(M)*Outlet.h;
    139142       
    140         "Mechanical Equilibrium"
     143"Mechanical Equilibrium"
    141144        Inlet.P = Outlet.P;
    142145       
    143         "Liquid Volume"
     146"Liquid Volume"
    144147        vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
    145148       
    146         "Composition"
     149"Composition"
    147150        M = Outlet.z*sum(M);
    148151       
    149         "Cylindrical Area"
    150         Across = radius^2 * (asin(1) - asin((radius-Level)/radius) ) +
    151                                 (Level-radius)*sqrt(Level*(2*radius - Level));
    152 
    153         "Level of liquid phase"
     152"Cylindrical Area"
     153        Across = radius^2 * (asin(1) - asin((radius-Level)/radius) ) + (Level-radius)*sqrt(Level*(2*radius - Level));
     154
     155"Level of liquid phase"
    154156        L*Across = sum(M)*vL;
     157
    155158end
    156159
Note: See TracChangeset for help on using the changeset viewer.