Ignore:
Timestamp:
Aug 14, 2009, 5:20:34 PM (13 years ago)
Author:
gerson bicca
Message:

updates

File:
1 edited

Legend:

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

    r828 r831  
    6262        Mw(NComp)               as molweight    (Brief="Mol Weight", Hidden=true);
    6363        pi                      as positive             (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi");
     64        g                               as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
     65
    6466       
    6567        Orientation     as Switcher     (Valid=["vertical","horizontal"],Default="vertical");
     
    7375        radius                                  as length               (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}");
    7476       
     77        low_flow        as flow_mol     (Brief = "Low Flow",Default = 1E-6, Hidden=true);
     78        zero_flow       as flow_mol     (Brief = "No Flow",Default = 0, Hidden=true);
     79        KfConst         as Real                 (Brief="Constant for K factor pressure drop", Unit= 'mol/(s*(Pa^0.5))',Default = 1, Hidden=true);
     80        Kfactor as positive (Brief="K factor for pressure drop", Lower = 1E-8, Default = 2);
     81       
     82        NormalFlow      as Switcher     (Brief="Normal Flow", Valid = ["on", "off"], Default = "on",Hidden=true);
     83
    7584        Levelpercent_Initial                    as positive     (Brief="Initial liquid height in Percent", Default = 0.70);
    7685        Temperature_Initial                             as temperature  (Brief="Initial Liquid Temperature", Default = 330);
     
    8089
    8190        Mw=PP.MolecularWeight();
    82 
     91        g = 9.81 * 'm/(s^2)';
    8392        Vhead_elliptical        = (pi*Diameter^3)/12;
    8493        Vhead_hemispherical = (pi*Diameter^3)/6;
    8594        Vcylinder = 0.25*(pi*Diameter^2)*Lenght;
    8695        radius = 0.5*Diameter;
     96       
     97        low_flow = 1E-6 * 'kmol/h';
     98        zero_flow = 0 * 'kmol/h';
     99        KfConst = 1*'mol/(s*(Pa^0.5))';
    87100
    88101VARIABLES
     
    105118        Level           as length               (Brief="liquid height", Protected=true);
    106119        Across          as area                 (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}");
    107         Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true);       
    108120        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true);
     121        Peq                     as pressure             (Brief="Equilibrium pressure on the liquid surface", Protected=true, Symbol="\Delta P_{eq}");
     122        Pstatic         as pressure             (Brief="Static head at the bottom of the tank", Protected = true, Symbol="P_{static}^{Liquid}");
    109123
    110124out     TI as control_signal    (Brief="Temperature Indicator", PosX=0.525, PosY=0, Protected=true);
     
    213227end
    214228
     229switch NormalFlow
     230
     231case "on":
     232        Inlet.F = Kfactor *sqrt(Pdrop)*KfConst;
     233
     234        when Inlet.F < low_flow switchto "off";
     235
     236case "off":
     237        Inlet.F = zero_flow;
     238
     239        when Inlet.P > OutletVapour.P switchto "on";
     240
     241end
     242
    215243"Component Molar Balance"
    216244        diff(TotalHoldup)=Inlet.F*Inlet.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z;
     
    232260
    233261"Liquid Volume"
    234         vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
     262        vL = PP.LiquidVolume(OutletLiquid.T, Peq, OutletLiquid.z);
    235263
    236264"Vapour Volume"
    237         vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
     265        vV = PP.VapourVolume(OutletVapour.T, Peq, OutletVapour.z);
    238266       
    239267"Chemical Equilibrium"
    240         PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =
    241                 PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;
     268        PP.LiquidFugacityCoefficient(OutletLiquid.T, Peq, OutletLiquid.z)*OutletLiquid.z =
     269                PP.VapourFugacityCoefficient(OutletVapour.T, Peq, OutletVapour.z)*OutletVapour.z;
    242270       
    243271"Thermal Equilibrium"
     
    245273       
    246274"Mechanical Equilibrium"
    247         OutletVapour.P = OutletLiquid.P;
     275        OutletVapour.P = Peq;
     276
     277"Static Head"   
     278        Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * g * Level;
     279
     280"Mechanical Equilibrium for the Liquid Phase"
     281        OutletLiquid.P = Peq + Pstatic;
    248282
    249283"Pressure Drop"
    250         OutletLiquid.P  = Inlet.P - Pdrop;
    251 
    252 "Pressure Ratio"
    253         OutletLiquid.P = Inlet.P * Pratio;
     284        Pdrop = Inlet.P - OutletVapour.P;
    254285
    255286"Geometry Constraint"
     
    323354        radius                                  as length               (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}");
    324355       
     356        low_flow        as flow_mol     (Brief = "Low Flow",Default = 1E-6, Hidden=true);
     357        zero_flow       as flow_mol     (Brief = "No Flow",Default = 0, Hidden=true);
     358        KfConst         as Real                 (Brief="Constant for K factor pressure drop", Unit= 'mol/(s*(Pa^0.5))',Default = 1, Hidden=true);
     359        Kfactor as positive (Brief="K factor for pressure drop", Lower = 1E-8, Default = 2);
     360       
     361        NormalFlow      as Switcher     (Brief="Normal Flow", Valid = ["on", "off"], Default = "on",Hidden=true);
     362
     363
    325364        Levelpercent_Initial                    as positive     (Brief="Initial liquid height in Percent", Default = 0.70);
    326365        Temperature_Initial                             as temperature  (Brief="Initial Liquid Temperature", Default = 330);
     
    333372        Vcylinder = 0.25*(pi*Diameter^2)*Lenght;
    334373        radius = 0.5*Diameter;
     374       
     375        low_flow = 1E-6 * 'kmol/h';
     376        zero_flow = 0 * 'kmol/h';
     377        KfConst = 1*'mol/(s*(Pa^0.5))';
    335378
    336379VARIABLES
     
    457500end
    458501
     502#*
     503switch NormalFlow
     504
     505case "on":
     506        Inlet.F = Kfactor *sqrt(Pstatic)*KfConst;
     507
     508        when Inlet.F < low_flow switchto "off";
     509
     510case "off":
     511        Inlet.F = zero_flow;
     512
     513        when Inlet.P > OutletLiquid.P switchto "on";
     514
     515end
     516*#
    459517"Component Molar Balance"
    460518        diff(TotalHoldup)=Inlet.F*Inlet.z - OutletLiquid.F*OutletLiquid.z;
Note: See TracChangeset for help on using the changeset viewer.