Ignore:
Timestamp:
Aug 10, 2009, 10:28:33 PM (13 years ago)
Author:
gerson bicca
Message:

fixed initial condition for Level indicator

File:
1 edited

Legend:

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

    r820 r821  
    1919using "streams";
    2020
    21 Model tank
    22         ATTRIBUTES
    23         Pallete         = true;
    24         Icon            = "icon/Tank";
    25         Brief           = "Model of a cylindrical tank.";
    26         Info            =
    27 "== Specify ==
    28 * the Inlet stream;
    29 * the outlet flow;
    30 * the InletQ (requires an energy source).
    31 
    32 == Initial Conditions ==
    33 * the tank initial temperature;
    34 * the tank initial level;
    35 * the tank initial composition.
    36 ";
    37 
    38 PARAMETERS
    39         outer PP                as Plugin               (Brief = "External Physical Properties", Type="PP");
    40         outer NComp     as Integer;
    41        
    42         pi                      as positive     (Brief="Pi value", Default=3.141593,Hidden=true);
    43         Diameter                as length       (Brief="Tank internal Diameter",Default=1.5);
    44         Across                  as area         (Brief="Tank cross section area", Hidden=true);
    45         L                       as length       (Brief="Tank length",Default=5);
    46 
    47        
    48         Initial_Level                           as length               (Brief="Initial Level of the Tank",Default=1);
    49         Initial_Temperature                     as temperature  (Brief="Initial Temperature of Liquid",Default=300);
    50         Initial_Composition(NComp)      as positive     (Brief="Initial Liquid Composition",Lower=1E-8, Default=0.10);
    51 
    52 SET
    53 
    54         Across = 0.25*pi*(Diameter)^2;
    55        
    56 VARIABLES
    57 in      Inlet           as stream                       (Brief = "Inlet stream", PosX=0.3037, PosY=0, Symbol="_{in}");
    58 out     Outlet          as liquid_stream        (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
    59 in      InletQ          as power                        (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}",Protected=true);
    60         Vtotal          as volume                       (Brief="Tank total volume",Protected=true);
    61         Vfilled         as volume                       (Brief="Tank volume content",Protected=true);
    62         Level           as length                       (Brief="Tank level",Protected=true);
    63         E                       as energy                       (Brief="Total Energy Holdup on tank",Protected=true);
    64         vL                      as volume_mol           (Brief="Liquid Molar Volume",Protected=true);
    65         M(NComp)        as mol                          (Brief="Molar Holdup in the tank",Protected=true);
    66 
    67 INITIAL
    68 
    69 "Initial Level"
    70         Level = Initial_Level;
    71 
    72 "Initial Liquid Temperature"   
    73         Outlet.T = Initial_Temperature;
    74 
    75 "Initial Liquid Composition"   
    76         Outlet.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
    77 
    78 EQUATIONS
    79 
    80 "Tank total volume"
    81         Vtotal = Across*L;
    82 
    83 "Mass balance"
    84         diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
    85 
    86 "Energy balance"
    87         diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ;
    88 
    89 "Energy Holdup"
    90         E = sum(M)*Outlet.h;
    91 
    92 "Mechanical Equilibrium"
    93         Inlet.P = Outlet.P;
    94 
    95 "Liquid Volume"
    96         vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
    97 
    98 "Composition"
    99         M = Outlet.z*sum(M);
    100 
    101 "Level of liquid phase"
    102         Level = sum(M)*vL/Across;
    103 
    104 "Volume Filled of liquid phase"
    105         Vfilled = Level*Across;
    106        
    107 end
    108 
    10921Model TankVL
    11022
     
    14052== INITIAL CONDITIONS ==
    14153* Initial_Temperature :  the Tank temperature (OutletLiquid.T);
    142 * Initial_Level : the Tank liquid level (Level);
     54* Levelpercent_Initial : the Tank liquid level in percent (LI);
    14355* Initial_Composition : (NoComps) OutletLiquid compositions.
    14456";
     
    394306== INITIAL CONDITIONS ==
    395307* Initial_Temperature :  the Tank temperature (OutletLiquid.T);
    396 * Initial_Level : the Tank liquid level (Level);
     308* Levelpercent_Initial : the Tank liquid level in percent (LI);
    397309* Initial_Composition : (NoComps) OutletLiquid compositions.
    398310";
     
    604516
    605517== OPTIONAL ==
    606 * the TankVL model has three control ports
     518* the SumpTank model has three control ports
    607519** TI OutletLiquid Temperature Indicator;
    608520** PI OutletLiquid Pressure Indicator;
     
    611523== INITIAL CONDITIONS ==
    612524* Initial_Temperature :  the Tank temperature (OutletLiquid.T);
    613 * Initial_Level : the Tank liquid level (Level);
     525* Levelpercent_Initial : the Tank liquid level in percent (LI);
    614526* Initial_Composition : (NoComps) OutletLiquid compositions.
    615527";
     
    668580        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true);
    669581
    670         Peq                     as pressure             (Brief="Equilibrium pressure on the liquid surface", Protected=true, DisplayUnit = 'kPa', Symbol="\Delta P_ª{eq}");
     582        Peq                     as pressure             (Brief="Equilibrium pressure on the liquid surface", Protected=true, DisplayUnit = 'kPa', Symbol="P_{eq}");
    671583        Pstatic         as pressure             (Brief="Static head at the bottom of the tank", Protected = true, DisplayUnit = 'kPa', Symbol="P_{static}^{Liquid}");
    672584
     
    794706end
    795707
    796 Model tank_feed
    797         ATTRIBUTES
    798         Pallete         = false;
    799         Icon            = "icon/Tank";
    800         Brief           = "Model of a tank with feed stream.";
    801         Info            =
    802 "== Specify ==
    803 * the Inlet stream;
    804 * the Feed stream;
    805 * the outlet flow;
    806 * the tank Q.
    807 
    808 == Initial Conditions ==
    809 * the tank initial temperature (OutletL.T);
    810 * the tank initial level (Level);
    811 * (NoComps - 1) OutletL (OR OutletV) compositions.
    812 ";
    813 
    814         PARAMETERS
    815         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    816         outer NComp as Integer;
    817         Across as area (Brief="Tank cross section area", Default=2);
    818        
    819         VARIABLES
    820 in      Feed as stream (Brief = "Feed stream", PosX=0.32, PosY=0, Symbol="_{feed}");   
    821 in      Inlet  as stream (Brief = "Inlet stream", PosX=0.3037, PosY=0, Symbol="_{in}");
    822 out     Outlet as liquid_stream (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}");
    823 in      InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7859, Symbol="_{in}");
    824 
    825         Level    as length(Brief="Tank level");
    826         M(NComp) as mol (Brief="Molar Holdup in the tank");
    827         E as energy (Brief="Total Energy Holdup on tank");
    828         vL as volume_mol (Brief="Liquid Molar Volume");
    829 
    830         EQUATIONS
    831         "Mass balance"
    832         diff(M) = Feed.F*Feed.z + Inlet.F*Inlet.z - Outlet.F*Outlet.z;
    833        
    834         "Energy balance"
    835         diff(E) = Feed.F*Feed.h + Inlet.F*Inlet.h - Outlet.F*Outlet.h + InletQ;
    836 
    837         "Energy Holdup"
    838         E = sum(M)*Outlet.h;
    839 
    840         "Mechanical Equilibrium"
    841         Inlet.P = Outlet.P;
    842        
    843         "Liquid Volume"
    844         vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
    845        
    846         "Composition"
    847         M = Outlet.z*sum(M);
    848        
    849         "Level of liquid phase"
    850         Level = sum(M)*vL/Across;
    851 end
Note: See TracChangeset for help on using the changeset viewer.