Ignore:
Timestamp:
Jul 18, 2009, 6:08:44 PM (13 years ago)
Author:
gerson bicca
Message:

updated flash model

File:
1 edited

Legend:

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

    r714 r796  
    2424        Pallete         = true;
    2525        Icon            = "icon/Flash";
    26         Brief           = "Model of a dynamic flash.";
     26        Brief           = "Model of a Dynamic Flash Vessel.";
    2727        Info            =
    28 "== Assumptions ==
    29 * Both phases are perfectly mixed.
    30        
    31 == Specify ==
    32 * The feed stream;
    33 * The outlet flows: OutletVapour.F and OutletLiquid.F.
    34 
    35 == Initial Conditions ==
    36 * The flash initial temperature (Temperature_Initial);
    37 * The flash initial level (Levelpercent_Initial);
    38 *The Outlet Liquid Composition (Composition_Initial).
     28"== ASSUMPTIONS ==
     29* perfect mixing of both phases;
     30* thermodynamics equilibrium.
     31
     32== SET ==
     33*Orientation: vessel position - vertical or horizontal;
     34*Heads (bottom and top heads are identical)
     35**elliptical: 2:1 elliptical heads (25% of vessel diameter);
     36**hemispherical: hemispherical heads (50% of vessel diameter);
     37**flat: flat heads (0% of vessel diameter);
     38*Diameter: Vessel diameter;
     39*Lenght: Side length of the cylinder shell;
     40       
     41== SPECIFY ==
     42* the Inlet stream;
     43* the outlet flows: OutletVapour.F and OutletLiquid.F;
     44* the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model).
     45
     46== OPTIONAL ==
     47* the Flash model has three control ports
     48** TI OutletLiquid Temperature Indicator;
     49** PI OutletLiquid Pressure Indicator;
     50** LI Level Indicator;
     51
     52== INITIAL CONDITIONS ==
     53* Initial_Temperature :  the Flash temperature (OutletLiquid.T);
     54* Initial_Level : the Flash liquid level (Level);
     55* Initial_Composition : (NoComps) OutletLiquid compositions.
    3956";
    4057       
    4158PARAMETERS
    42 
    43 outer PP                        as Plugin       (Brief = "External Physical Properties", Type="PP");
    44 outer NComp     as Integer      (Brief = "Number of chemical components", Lower = 1);
    45 
    46         VesselVolume    as volume               (Brief="Total Volume of the flash");
    47         Mw(NComp)               as molweight    (Hidden=true);
    48         Orientation                     as Switcher     (Valid=["vertical","horizontal"],Default="vertical");
    49         Diameter                        as length               (Brief="Vessel diameter");
    50 
    51         Levelpercent_Initial                                    as positive                     (Brief="Initial liquid height in Percent", Default = 0.70);
    52         Temperature_Initial                                             as temperature  (Brief="Initial Liquid Temperature", Default = 330);
    53         Composition_Initial(NComp)              as fraction                     (Brief="Initial Composition", Default = 0.10);
    54        
     59outer PP                as Plugin       (Brief = "External Physical Properties", Type="PP");
     60outer NComp     as Integer      (Brief = "Number of components", Lower = 1);
     61
     62        Mw(NComp)               as molweight    (Brief="Mol Weight", Hidden=true);
     63        pi                      as positive             (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi");
     64       
     65        Orientation     as Switcher     (Valid=["vertical","horizontal"],Default="vertical");
     66        Heads                   as Switcher     (Valid=["elliptical","hemispherical","flat"],Default="flat");
     67        Diameter                as length               (Brief="Vessel diameter", Symbol="D_{i}");
     68        Lenght                  as length               (Brief="Side length of the cylinder shell", Symbol="L_{vessel}");
     69       
     70        Vhead_elliptical                as volume               (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}");
     71        Vhead_hemispherical     as volume               (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}");
     72        Vcylinder                               as volume               (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}");
     73        radius                                  as length               (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}");
     74       
     75        Levelpercent_Initial                    as positive     (Brief="Initial liquid height in Percent", Default = 0.70);
     76        Temperature_Initial                             as temperature  (Brief="Initial Liquid Temperature", Default = 330);
     77        Composition_Initial(NComp)              as fraction             (Brief="Initial Composition", Default = 0.10);
     78
    5579SET
    5680
    5781        Mw=PP.MolecularWeight();
    5882
     83        Vhead_elliptical        = (pi*Diameter^3)/12;
     84        Vhead_hemispherical = (pi*Diameter^3)/6;
     85        Vcylinder = 0.25*(pi*Diameter^2)*Lenght;
     86        radius = 0.5*Diameter;
     87
    5988VARIABLES
    6089
    61 in              Inlet                           as stream                               (Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}");
    62 out     OutletLiquid    as liquid_stream                (Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}");
    63 out     OutletVapour    as vapour_stream        (Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}");
    64 in              InletQ                          as power                                        (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Protected =true,Symbol="_{in}");
     90in      Inlet                   as stream                       (Brief="Feed Stream", PosX=0, PosY=0.48, Symbol="_{in}");
     91out     OutletLiquid    as liquid_stream        (Brief="Liquid outlet stream", PosX=0.43, PosY=1, Symbol="_{out}^{Liquid}");
     92out     OutletVapour    as vapour_stream        (Brief="Vapour outlet stream", PosX=0.43, PosY=0, Symbol="_{out}^{Vapour}");
     93in      InletQ                  as power                        (Brief="Heat Duty", PosX=1, PosY=0.81, Protected =true,Symbol="Q_{in}");
     94
     95        Vtotal                  as volume                       (Brief="Vessel total volume",Protected=true, Symbol="V_{total}");
     96        Vfilled                 as volume                       (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}");
    6597
    6698        TotalHoldup(NComp)              as mol  (Brief="Molar Holdup in the Vessel", Protected=true);
    67         LiquidHoldup                                            as mol  (Brief="Molar liquid holdup", Protected=true);
    68         VapourHoldup                                    as mol  (Brief="Molar vapour holdup", Protected=true);
    69        
    70         E                       as energy                       (Brief="Total Energy Holdup in the Vessel", Protected=true);
     99        LiquidHoldup                    as mol  (Brief="Molar liquid holdup", Protected=true);
     100        VapourHoldup                    as mol  (Brief="Molar vapour holdup", Protected=true);
     101       
     102        E                       as energy               (Brief="Total Energy Holdup in the Vessel", Protected=true);
    71103        vL                      as volume_mol   (Brief="Liquid Molar Volume", Protected=true);
    72104        vV                      as volume_mol   (Brief="Vapour Molar volume", Protected=true);
    73         Level           as length                       (Brief="liquid height", Protected=true);
    74         Across  as area                                 (Brief="Flash Cross section area", Protected=true);
    75         vfrac           as positive                     (Brief="Vapourization fraction", Symbol="\phi", Protected=true);
    76         Pratio          as positive                     (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true);       
     105        Level           as length               (Brief="liquid height", Protected=true);
     106        Across          as area                 (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}");
     107        vfrac           as positive     (Brief="Vapourization fraction", Symbol="\phi", Protected=true);
     108        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true);       
    77109        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true);
    78110
    79 out     TI as control_signal    (Brief="Temperature Indicator", PosX=1, PosY=0.2, Protected=true);
    80 out     PI as control_signal    (Brief="Pressure Indicator", PosX=1, PosY=0.3, Protected=true);
    81 out     LI as control_signal    (Brief="Level Indicator", PosX=1, PosY=0.4, Protected=true);
     111out     TI as control_signal    (Brief="Temperature Indicator", PosX=1, PosY=0.39, Protected=true);
     112out     PI as control_signal    (Brief="Pressure Indicator", PosX=1, PosY=0.21, Protected=true);
     113out     LI as control_signal    (Brief="Level Indicator", PosX=1, PosY=0.59, Protected=true);
    82114
    83115INITIAL
    84116
    85 # Initial level Percent
     117"Initial level Percent"
    86118        LI = Levelpercent_Initial;
    87119       
    88 # Initial Outlet Liquid Temperature
     120"Initial Outlet Liquid Temperature"
    89121        OutletLiquid.T = Temperature_Initial;
    90122       
    91 # Initial Outlet Liquid Composition Normalized
     123"Initial Outlet Liquid Composition Normalized"
    92124        OutletLiquid.z(1:NComp - 1) = Composition_Initial(1:NComp - 1)/sum(Composition_Initial);
    93125
    94126EQUATIONS
     127
     128switch Orientation
     129
     130case "vertical":
     131
     132"Vessel Cross Section Area"
     133        Across = 0.25*(pi*Diameter^2);
     134
     135switch Heads
     136
     137case "elliptical":
     138
     139"Vessel Total Volume"
     140        Vtotal = Vhead_elliptical +     Vcylinder;
     141
     142if Level < 0.25*Diameter then
     143
     144"Vessel Filled Volume"
     145        Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3);
     146
     147else
     148
     149"Vessel Filled Volume"
     150        Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3);
     151
     152end
     153
     154case "hemispherical":
     155
     156"Vessel Total Volume"
     157        Vtotal = Vhead_hemispherical + Vcylinder;
     158
     159if Level < 0.5*Diameter then
     160
     161"Vessel Filled Volume"
     162        Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3);
     163
     164else
     165
     166"Vessel Filled Volume"
     167        Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2);
     168
     169end
     170
     171case "flat":
     172
     173"Vessel Total Volume"
     174        Vtotal = Vcylinder;
     175
     176"Vessel Filled Volume"
     177        Vfilled = Across*Level;
     178
     179end
     180
     181case "horizontal":
     182
     183"Vessel Cross Section Area"
     184        Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2));
     185
     186switch Heads
     187
     188case "elliptical":
     189
     190"Vessel Total Volume"
     191        Vtotal = Vhead_elliptical +     Vcylinder;
     192
     193"Vessel Filled Volume"
     194        Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght;
     195
     196case "hemispherical":
     197
     198"Vessel Total Volume"
     199        Vtotal = Vhead_hemispherical + Vcylinder;
     200
     201"Vessel Filled Volume"
     202        Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght;
     203
     204case "flat":
     205
     206"Vessel Total Volume"
     207        Vtotal = Vcylinder;
     208
     209"Vessel Filled Volume"
     210        Vfilled = Across*Lenght;
     211
     212end
     213
     214end
    95215
    96216"Component Molar Balance"
     
    104224       
    105225"Energy Holdup"
    106         E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*VesselVolume;
     226        E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*Vtotal;
    107227       
    108228"Mol fraction normalisation"
     
    138258
    139259"Geometry Constraint"
    140         VesselVolume = LiquidHoldup * vL + VapourHoldup * vV;
    141 
    142 "Temperature indicator in Celsius Degree"
    143         TI * 'K' = OutletLiquid.T - 273.15*'K';
     260        Vtotal = LiquidHoldup * vL + VapourHoldup * vV;
     261
     262"Temperature indicator"
     263        TI * 'K' = OutletLiquid.T;
    144264
    145265"Pressure indicator"
     
    147267
    148268"Level indicator"
    149         LI*VesselVolume= Level*Across;
    150 
    151 switch Orientation
    152         case "vertical":
    153         "Cross Section Area"
    154                 Across = 0.5 * asin(1) * Diameter^2;
    155        
    156         "Liquid Level"
    157                 LiquidHoldup * vL = Across * Level;
    158                
    159         case "horizontal":
    160         "Cylindrical Side Area"
    161                 Across = 0.25*Diameter^2 * (asin(1) - asin((Diameter - 2*Level)/Diameter)) +
    162                                 (Level - 0.5*Diameter)*sqrt(Level*(Diameter - Level));
    163 
    164         "Liquid Level"
    165                 0.5 * asin(1) * Diameter^2 * LiquidHoldup* vL = Across * VesselVolume;
    166 end
     269        LI*Vtotal= Vfilled;
     270
     271"Liquid Level"
     272        LiquidHoldup * vL = Vfilled;
    167273
    168274end
Note: See TracChangeset for help on using the changeset viewer.