Ignore:
Timestamp:
Nov 9, 2009, 2:11:31 PM (13 years ago)
Author:
gerson bicca
Message:

updated dynamic models

File:
1 edited

Legend:

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

    r825 r879  
    1717*--------------------------------------------------------------------*#
    1818
    19 using "streams";
     19using "tank";
    2020
    2121Model flash
     
    6161
    6262        Mw(NComp)               as molweight    (Brief="Mol Weight", Hidden=true);
    63         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        
    66         Orientation     as Switcher     (Valid=["vertical","horizontal"],Default="vertical");
    67         Heads                   as Switcher     (Valid=["elliptical","hemispherical","flat"],Default="flat");
    68         Diameter                as length               (Brief="Vessel diameter", Symbol="D_{i}");
    69         Lenght                  as length               (Brief="Side length of the cylinder shell", Symbol="L_{vessel}");
    70        
    71         Vhead_elliptical                as volume               (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}");
    72         Vhead_hemispherical     as volume               (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}");
    73         Vcylinder                               as volume               (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}");
    74         radius                                  as length               (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}");
     63        Gconst          as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);
    7564       
    7665        Levelpercent_Initial                    as positive     (Brief="Initial liquid height in Percent", Default = 0.70);
     
    8271        Mw=PP.MolecularWeight();
    8372
    84         Vhead_elliptical        = (pi*Diameter^3)/12;
    85         Vhead_hemispherical = (pi*Diameter^3)/6;
    86         Vcylinder = 0.25*(pi*Diameter^2)*Lenght;
    87         radius = 0.5*Diameter;
    88         g = 9.81 * 'm/(s^2)';
     73        Gconst  = 9.81 * 'm/(s^2)';
    8974
    9075VARIABLES
     76
     77        Geometry                as VesselVolume (Brief="Vessel Geometry", Symbol=" ");
    9178
    9279in      Inlet                   as stream                       (Brief="Feed Stream", PosX=0, PosY=0.48, Symbol="_{in}");
     
    9582in      InletQ                  as power                        (Brief="Heat Duty", PosX=1, PosY=0.81, Protected =true,Symbol="Q_{in}");
    9683
    97         Vtotal                  as volume                       (Brief="Vessel total volume",Protected=true, Symbol="V_{total}");
    98         Vfilled                 as volume                       (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}");
    99 
    10084        TotalHoldup(NComp)              as mol  (Brief="Molar Holdup in the Vessel", Protected=true);
    10185        LiquidHoldup                    as mol  (Brief="Molar liquid holdup", Protected=true);
     
    10589        vL                      as volume_mol   (Brief="Liquid Molar Volume", Protected=true);
    10690        vV                      as volume_mol   (Brief="Vapour Molar volume", Protected=true);
    107         Level           as length               (Brief="liquid height", Protected=true);
    108         Across          as area                 (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}");
    10991        vfrac           as positive     (Brief="Vapourization fraction", Symbol="\phi", Protected=true);
    11092        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true);       
     
    131113EQUATIONS
    132114
    133 switch Orientation
    134 
    135 case "vertical":
    136 
    137 "Vessel Cross Section Area"
    138         Across = 0.25*(pi*Diameter^2);
    139 
    140 switch Heads
    141 
    142 case "elliptical":
    143 
    144 "Vessel Total Volume"
    145         Vtotal = Vhead_elliptical +     Vcylinder;
    146 
    147 if Level < 0.25*Diameter then
    148 
    149 "Vessel Filled Volume"
    150         Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3);
    151 
    152 else
    153 
    154 "Vessel Filled Volume"
    155         Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3);
    156 
    157 end
    158 
    159 case "hemispherical":
    160 
    161 "Vessel Total Volume"
    162         Vtotal = Vhead_hemispherical + Vcylinder;
    163 
    164 if Level < 0.5*Diameter then
    165 
    166 "Vessel Filled Volume"
    167         Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3);
    168 
    169 else
    170 
    171 "Vessel Filled Volume"
    172         Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2);
    173 
    174 end
    175 
    176 case "flat":
    177 
    178 "Vessel Total Volume"
    179         Vtotal = Vcylinder;
    180 
    181 "Vessel Filled Volume"
    182         Vfilled = Across*Level;
    183 
    184 end
    185 
    186 case "horizontal":
    187 
    188 "Vessel Cross Section Area"
    189         Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2));
    190 
    191 switch Heads
    192 
    193 case "elliptical":
    194 
    195 "Vessel Total Volume"
    196         Vtotal = Vhead_elliptical +     Vcylinder;
    197 
    198 "Vessel Filled Volume"
    199         Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght;
    200 
    201 case "hemispherical":
    202 
    203 "Vessel Total Volume"
    204         Vtotal = Vhead_hemispherical + Vcylinder;
    205 
    206 "Vessel Filled Volume"
    207         Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght;
    208 
    209 case "flat":
    210 
    211 "Vessel Total Volume"
    212         Vtotal = Vcylinder;
    213 
    214 "Vessel Filled Volume"
    215         Vfilled = Across*Lenght;
    216 
    217 end
    218 
    219 end
    220 
    221115"Component Molar Balance"
    222116        diff(TotalHoldup)=Inlet.F*Inlet.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z;
     
    229123       
    230124"Energy Holdup"
    231         E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*Vtotal;
     125        E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*Geometry.Vtotal;
    232126       
    233127"Mol fraction normalisation"
     
    257151       
    258152"Static Head"   
    259         Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * g * Level;
     153        Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * Gconst * Geometry.Level;
    260154
    261155"Mechanical Equilibrium for the Liquid Phase"
     
    269163
    270164"Geometry Constraint"
    271         Vtotal = LiquidHoldup * vL + VapourHoldup * vV;
     165        Geometry.Vtotal = LiquidHoldup * vL + VapourHoldup * vV;
    272166
    273167"Temperature indicator"
     
    278172
    279173"Level indicator"
    280         LI*Vtotal= Vfilled;
     174        LI*Geometry.Vtotal= Geometry.Vfilled;
    281175
    282176"Liquid Level"
    283         LiquidHoldup * vL = Vfilled;
     177        LiquidHoldup * vL = Geometry.Vfilled;
    284178
    285179end
Note: See TracChangeset for help on using the changeset viewer.