Changeset 612 for branches/gui


Ignore:
Timestamp:
Aug 27, 2008, 7:31:54 PM (15 years ago)
Author:
gerson bicca
Message:

updates in column model

Location:
branches/gui
Files:
3 edited

Legend:

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

    r611 r612  
    7070        NTrays                          as Integer      (Brief="Number of trays", Default=2);
    7171        FeedTray                        as Integer      (Brief="Number of Feed tray", Default=2);
    72         topdown                         as Integer      (Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1);
    73         top                                     as Integer      (Brief="Number of top tray");
    74         bot                                     as Integer      (Brief="Number of bottom tray");
     72        topdown                         as Integer      (Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1,Hidden=true);
     73        top                                     as Integer      (Brief="Number of top tray",Hidden=true);
     74        bot                                     as Integer      (Brief="Number of bottom tray",Hidden=true);
     75        g                                               as acceleration         (Default=9.81,Hidden=true);
     76       
     77        VapourFlow                              as Switcher     (Valid = ["on", "off"], Default = "on",Hidden=true);
     78        LiquidFlow                              as Switcher     (Valid = ["on", "off"], Default = "on",Hidden=true);
     79        VapourFlowModel         as Switcher     (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer");
     80        LiquidFlowModel                 as Switcher     (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default");
    7581
    7682SET
     
    8086VARIABLES
    8187        zero                    as stream                               (Brief="Dummy stream",Hidden=true);
    82         cond                    as liquid_stream;
    83         in      Inlet           as stream                               (Brief="Feed stream", PosX=0, PosY=0.5);
     88        in      Inlet           as stream                               (Brief="Feed stream", PosX=0, PosY=0.50);
    8489        trays(NTrays) as trayTeste;
    85         reb                             as vapour_stream;
     90       
     91        in      Lin             as      stream          (Brief="Feed stream", PosX=0.75, PosY=0);
     92        in      Vin             as stream               (Brief="Feed stream", PosX=0.55, PosY=1);
     93       
     94        out     Lout            as liquid_stream                (Brief="Feed stream", PosX=0.75, PosY=1);
     95        out     Vout            as vapour_stream        (Brief="Feed stream", PosX=0.55, PosY=0);
    8696
    8797CONNECTIONS
    8898        trays([top+topdown:topdown:bot]).OutletV        to trays([top:topdown:bot-topdown]).InletV;
    8999        trays([top:topdown:bot-topdown]).OutletL        to trays([top+topdown:topdown:bot]).InletL;
    90        
    91         reb             to trays(2).InletV;
    92         cond    to trays(1).InletL;
    93100       
    94101EQUATIONS
     
    109116        Inlet.v = trays(FeedTray).Inlet.v;
    110117        Inlet.h = trays(FeedTray).Inlet.h;
    111        
    112 for i in [1:FeedTray-1] do # pay atention to index
     118
     119if FeedTray equal 1
     120
     121        then
     122
     123for i in [2:NTrays] do
    113124       
    114125        zero.F = trays(i).Inlet.F;
     
    121132end
    122133
    123 end
    124 
     134        else
     135
     136if FeedTray equal NTrays
     137       
     138        then
     139       
     140for i in [1:NTrays-1] do
     141
     142        zero.F = trays(i).Inlet.F;
     143        zero.T = trays(i).Inlet.T;
     144        zero.P = trays(i).Inlet.P;
     145        zero.z = trays(i).Inlet.z;
     146        zero.v = trays(i).Inlet.v;
     147        zero.h = trays(i).Inlet.h;
     148
     149end
     150
     151        else
     152
     153for i in [2:FeedTray-1] do
     154
     155        zero.F = trays(i).Inlet.F;
     156        zero.T = trays(i).Inlet.T;
     157        zero.P = trays(i).Inlet.P;
     158        zero.z = trays(i).Inlet.z;
     159        zero.v = trays(i).Inlet.v;
     160        zero.h = trays(i).Inlet.h;
     161
     162end
     163
     164for i in [FeedTray+1: NTrays-1] do
     165
     166        zero.F = trays(i).Inlet.F;
     167        zero.T = trays(i).Inlet.T;
     168        zero.P = trays(i).Inlet.P;
     169        zero.z = trays(i).Inlet.z;
     170        zero.v = trays(i).Inlet.v;
     171        zero.h = trays(i).Inlet.h;
     172
     173end
     174
     175end
     176
     177end
     178
     179for i in [1:NTrays] do
     180
     181switch LiquidFlow
     182                case "on":
     183                        switch LiquidFlowModel
     184                                case "default":
     185                                "Francis Equation"
     186                                trays(i).OutletL.F*trays(i).vL = 1.84*'1/s'*trays(i).lw*((trays(i).Level-(trays(i).beta*trays(i).hw))/(trays(i).beta))^2;
     187                       
     188                                case "Wang_Fl":
     189                                trays(i).OutletL.F*trays(i).vL = 1.84*'m^0.5/s'*trays(i).lw*((trays(i).Level-(trays(i).beta*trays(i).hw))/(trays(i).beta))^1.5;
     190                       
     191                                case "Olsen":
     192                                trays(i).OutletL.F / 'mol/s'= trays(i).lw*trays(i).Np*trays(i).rhoL/sum(trays(i).Mw*trays(i).OutletV.z)/(0.665*trays(i).fw)^1.5 * ((trays(i).ML*sum(trays(i).Mw*trays(i).OutletL.z)/trays(i).rhoL/trays(i).Ap)-trays(i).hw)^1.5 * 'm^0.5/mol';
     193                       
     194                                case "Feehery_Fl":
     195                                trays(i).OutletL.F = trays(i).lw*trays(i).rhoL/sum(trays(i).Mw*trays(i).OutletL.z) * ((trays(i).Level-trays(i).hw)/750/'mm')^1.5 * 'm^2/s';
     196                       
     197                                case "Roffel_Fl":
     198                                trays(i).OutletL.F = 2/3*sqrt(2*g)*trays(i).rhoL/sum(trays(i).Mw*trays(i).OutletL.z)*trays(i).lw*(2*trays(i).btemp-1)*(trays(i).ML*sum(trays(i).Mw*trays(i).OutletL.z)/(trays(i).Ap*1.3)/trays(i).rhoL/(2*trays(i).btemp-1))^1.5;
     199                        end
     200                when trays(i).Level < (trays(i).beta * trays(i).hw) switchto "off";
     201               
     202                case "off":
     203                "Low level"
     204                trays(i).OutletL.F = 0 * 'mol/h';
     205                when trays(i).Level > (trays(i).beta * trays(i).hw) + 1e-6*'m' switchto "on";
     206        end
     207       
     208        trays(i).btemp = 1 - 0.3593/'Pa^0.0888545'*abs(trays(i).OutletV.F*sum(trays(i).Mw*trays(i).OutletV.z)/(trays(i).Ap*1.3)/sqrt(trays(i).rhoV))^0.177709; #/'(kg/m)^0.0888545/s^0.177709';
     209
     210switch VapourFlow
     211                case "on":
     212                        switch VapourFlowModel
     213                                case "Reepmeyer":
     214                                trays(i).InletV.F*trays(i).vV = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/(trays(i).rhoV*trays(i).alfa))*trays(i).Ah;
     215                       
     216                                case "Feehery_Fv":
     217                                trays(i).InletV.F = trays(i).rhoV/trays(i).Ap/trays(i).w/sum(trays(i).Mw*trays(i).OutletV.z) * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-(trays(i).rhoV*g*trays(i).ML*trays(i).vL/trays(i).Ap))/trays(i).rhoV);
     218                       
     219                                case "Roffel_Fv":
     220                                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 - (trays(i).beta*sum(trays(i).M*trays(i).Mw)/(trays(i).Ap*1.3)*g*1e5) * (trays(i).rhoV*trays(i).Ah/sum(trays(i).Mw*trays(i).OutletV.z))^1.08 * 'm^1.08/mol^1.08';
     221                       
     222                                case "Klingberg":
     223                                trays(i).InletV.F * trays(i).vV = trays(i).Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV);
     224                       
     225                                case "Wang_Fv":
     226                                trays(i).InletV.F * trays(i).vV = trays(i).Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV*trays(i).alfa);
     227                               
     228                                case "Elgue":
     229                                trays(i).InletV.F  = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/trays(i).btray);
     230                        end
     231                when trays(i).InletV.F < 1e-6 * 'kmol/h' switchto "off";
     232               
     233                case "off":
     234                trays(i).InletV.F = 0 * 'mol/s';
     235                when trays(i).InletV.P > trays(i).OutletV.P + trays(i).Level*g*trays(i).rhoL + 1e-1 * 'atm' switchto "on";
     236        end
     237
     238end
     239
     240end
    125241
    126242#*----------------------------------------------------------------------
  • branches/gui/eml/stage_separators/trayTeste.mso

    r611 r612  
    4646VARIABLES
    4747
    48 #in     Inlet                   as stream                               (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
    4948        Inlet                   as stream                               (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");
    5049in      InletL                  as stream                               (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}");
     
    5352out     OutletV         as vapour_stream        (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}");
    5453
    55         M(NComp) as mol (Brief="Molar Holdup in the tray");
    56         ML as mol (Brief="Molar liquid holdup");
    57         MV as mol (Brief="Molar vapour holdup");
    58         E as energy (Brief="Total Energy Holdup on tray");
    59         vL as volume_mol (Brief="Liquid Molar Volume");
    60         vV as volume_mol (Brief="Vapour Molar volume");
    61         Level as length (Brief="Height of clear liquid on plate");
    62         yideal(NComp) as fraction;
    63         Emv as Real (Brief = "Murphree efficiency");
    64        
    65         EQUATIONS
     54        M(NComp)                        as mol                          (Brief="Molar Holdup in the tray");
     55        ML                                              as mol                          (Brief="Molar liquid holdup");
     56        MV                                              as mol                          (Brief="Molar vapour holdup");
     57        E                                                       as energy                       (Brief="Total Energy Holdup on tray");
     58        vL                                              as volume_mol   (Brief="Liquid Molar Volume");
     59        vV                                              as volume_mol   (Brief="Vapour Molar volume");
     60        Level                                   as length                       (Brief="Height of clear liquid on plate");
     61        yideal(NComp)           as fraction;
     62        Emv                                             as Real                         (Brief = "Murphree efficiency");
     63       
     64EQUATIONS
    6665        "Component Molar Balance"
    67         diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z
    68                 - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
    69        
    70         "Energy Balance"
    71         diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h
    72                 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q );
    73        
    74         "Molar Holdup"
     66        diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z- OutletL.F*OutletL.z - OutletV.F*OutletV.z;
     67       
     68"Energy Balance"
     69        diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h- OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q );
     70       
     71"Molar Holdup"
    7572        M = ML*OutletL.z + MV*OutletV.z;
    7673       
    77         "Energy Holdup"
     74"Energy Holdup"
    7875        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
    7976       
    80         "Mol fraction normalisation"
     77"Mol fraction normalisation"
    8178        sum(OutletL.z)= 1.0;
    8279        sum(OutletL.z)= sum(OutletV.z);
    8380       
    84         "Liquid Volume"
     81"Liquid Volume"
    8582        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
    86         "Vapour Volume"
     83       
     84"Vapour Volume"
    8785        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
    8886       
    89         "Chemical Equilibrium"
    90         PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
    91                 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
    92 
    93         "Murphree Efficiency"
     87"Chemical Equilibrium"
     88        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal;
     89
     90"Murphree Efficiency"
    9491        OutletV.z = Emv * (yideal - InletV.z) + InletV.z;
    9592       
    96         "Thermal Equilibrium"
     93"Thermal Equilibrium"
    9794        OutletV.T = OutletL.T;
    9895       
    99         "Mechanical Equilibrium"
     96"Mechanical Equilibrium"
    10097        OutletV.P = OutletL.P;
    10198       
    102         "Geometry Constraint"
     99"Geometry Constraint"
    103100        V = ML* vL + MV*vV;
    104101       
    105         "Level of clear liquid over the weir"
     102"Level of clear liquid over the weir"
    106103        Level = ML*vL/Ap;
     104
    107105end
    108106
     
    139137";     
    140138
    141         PARAMETERS
    142         Ah as area (Brief="Total holes area");
    143         lw as length (Brief="Weir length");
    144         g as acceleration (Default=9.81);
    145         hw as length (Brief="Weir height");
    146         beta as fraction (Brief="Aeration fraction");
    147         alfa as fraction (Brief="Dry pressure drop coefficient");
    148         w as Real (Brief="Feehery's correlation coefficient", Unit='1/m^4', Default=1);
    149         btray as Real (Brief="Elgue's correlation coefficient", Unit='kg/m/mol^2', Default=1);
    150         fw as Real      (Brief = "Olsen's correlation coefficient", Default=1);
    151         Np as Real      (Brief = "Number of liquid passes in the tray", Default=1);
    152         Mw(NComp)       as molweight    (Brief = "Component Mol Weight");
    153        
    154         VapourFlow as Switcher(Valid = ["on", "off"], Default = "on");
    155         LiquidFlow as Switcher(Valid = ["on", "off"], Default = "on");
    156         VapourFlowModel as Switcher(Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer");
    157         LiquidFlowModel as Switcher(Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default");
    158 
    159         SET
     139PARAMETERS
     140        Ah                              as area                                 (Brief="Total holes area");
     141        lw                              as length                       (Brief="Weir length");
     142        hw                              as length                       (Brief="Weir height");
     143        beta                            as fraction             (Brief="Aeration fraction");
     144        alfa                            as fraction             (Brief="Dry pressure drop coefficient");
     145        w                                       as Real                         (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1);
     146        btray                   as Real                         (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1);
     147        fw                              as Real                         (Brief="Olsens correlation coefficient", Default=1);
     148        Np                              as Real                         (Brief="Number of liquid passes in the tray", Default=1);
     149        Mw(NComp)       as molweight    (Brief="Component Mol Weight");
     150       
     151#       VapourFlow                              as Switcher     (Valid = ["on", "off"], Default = "on",Hidden=true);
     152#       LiquidFlow                              as Switcher     (Valid = ["on", "off"], Default = "on",Hidden=true);
     153#       VapourFlowModel         as Switcher     (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer");
     154#       LiquidFlowModel                 as Switcher     (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default");
     155
     156SET
    160157        Mw = PP.MolecularWeight();
    161158       
    162         VARIABLES
     159VARIABLES
    163160        rhoL as dens_mass;
    164161        rhoV as dens_mass;
    165162
    166         btemp as Real (Brief="Temporary variable of Roffel's liquid flow equation");
    167        
    168         EQUATIONS
    169         "Liquid Density"
     163        btemp as Real (Brief="Temporary variable of Roffels liquid flow equation");
     164       
     165EQUATIONS
     166
     167"Liquid Density"
    170168        rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z);
    171         "Vapour Density"
     169       
     170"Vapour Density"
    172171        rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z);
    173172
    174         switch LiquidFlow
     173#*      switch LiquidFlow
    175174                case "on":
    176175                        switch LiquidFlowModel
     
    228227                when InletV.P > OutletV.P + Level*g*rhoL + 1e-1 * 'atm' switchto "on";
    229228        end
    230 
     229*#
    231230end
    232231
  • branches/gui/sample/stage_separators/sample_columnTeste.mso

    r611 r612  
    4343        sec             as Section_ColumnTeste;
    4444        feed            as liquid_stream;
     45        reb             as vapour_stream;
     46        cond    as liquid_stream;
    4547
    4648SET
     
    5759        feed.z = [0.5, 0.5];
    5860
    59         sec.cond.F = 68 * 'kmol/h';
    60         sec.cond.P = 150 * 'kPa';
    61         sec.cond.T = 281.75 * 'K';
    62         sec.cond.z = [0.6664, 0.3336];
     61        cond.F = 68 * 'kmol/h';
     62        cond.P = 150 * 'kPa';
     63        cond.T = 281.75 * 'K';
     64        cond.z = [0.6664, 0.3336];
    6365
    64         sec.reb.P = 185 * 'kPa';
    65         sec.reb.T = 328.12 * 'K';
    66         sec.reb.z = [0.001848, 0.9982];
     66        reb.P = 185 * 'kPa';
     67        reb.T = 328.12 * 'K';
     68        reb.z = [0.001848, 0.9982];
    6769       
    6870        sec.trays.Emv = 1;
Note: See TracChangeset for help on using the changeset viewer.