Ignore:
Timestamp:
Jul 25, 2008, 7:24:26 PM (15 years ago)
Author:
gerson bicca
Message:

starting to update the EML (new gui)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/eml/streams.mso

    r577 r578  
    125125        pressure '''P''' and the enthalpy '''h'''.
    126126       
    127         Additionally, the liquid composition '''x''' and the vapor
    128         composition '''y''' are calculated.     
     127        Additionally, the liquid composition '''x''', the vapor
     128        composition '''y''' and the stream entropy are calculated.     
    129129        ";
    130130        Pallete = false;
     
    140140"Entropy"
    141141        s = (1-v)*PP.LiquidEntropy(T, P, x) +   v*PP.VapourEntropy(T, P, y);
    142        
    143 end
    144 
    145 Model source
    146         ATTRIBUTES
    147         Pallete = true;
    148         Icon = "icon/Source";
    149         Brief = "Material stream source";
    150         Info = "
    151         This model should be used for boundary streams.
    152         Usually these streams are known and come from another process
    153         units.
    154 
    155         The user should specify:
    156          * Total molar (mass or volumetric) flow
    157          * Temperature
    158          * Pressure
    159          * Molar (mass or volumetric) composition
    160        
    161         No matter the specification set, the model will calculate some
    162         additional properties:
    163          * Mass density
    164          * Mass flow
    165          * Mass compostions
    166          * Specific volume
    167          * Vapour fraction
    168          * Volumetric flow
    169          * Liquid and Vapour compositions
    170         ";
    171 
    172         PARAMETERS
    173         outer PP                        as Plugin               (Brief = "External Physical Properties", Type="PP");
    174         outer NComp             as Integer              (Brief = "Number of chemical components", Lower = 1);
    175                   M(NComp)      as molweight    (Brief = "Component Mol Weight");
    176                   rhoModel              as Switcher             (Brief = "Density model", Valid = ["volume", "correlation"], Default="volume");
    177        
    178         SET
    179 
    180         M   = PP.MolecularWeight();
    181 
    182         VARIABLES
    183         out Outlet                      as stream                       (Brief = "Outlet stream", PosX=1, PosY=0.5256, Symbol="_{out}");
    184         x(NComp)                        as fraction                     (Brief = "Liquid Molar Fraction",Hidden=true);
    185         y(NComp)                        as fraction                     (Brief = "Vapour Molar Fraction",Hidden=true);
    186         hl                                      as enth_mol                     (Brief = "Liquid Enthalpy");
    187         hv                                      as enth_mol                     (Brief = "Vapour Enthalpy");
    188         s                                       as entr_mol                     (Brief = "Stream Entropy");
    189         sl                                      as entr_mol                     (Brief = "Liquid Entropy");
    190         sv                                      as entr_mol                     (Brief = "Vapour Entropy");     
    191         zmass(NComp)            as fraction                     (Brief = "Mass Fraction");
    192         Mw                                      as molweight            (Brief = "Average Mol Weight");
    193         vm                                      as volume_mol           (Brief = "Molar Volume");       
    194         rho                                     as dens_mass            (Brief = "Stream Mass Density");
    195         rhom                            as dens_mol                     (Brief = "Stream Molar Density");
    196         Fw                                      as flow_mass            (Brief = "Stream Mass Flow");
    197         Fvol                    as flow_vol         (Brief = "Volumetric Flow");
    198         T_Cdeg                          as temperature          (Brief = "Temperature in °C", Lower=-200);
    199        
    200         EQUATIONS
    201         "Flash Calculation"
    202         [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
    203        
    204         "Overall Enthalpy"
    205         Outlet.h = (1-Outlet.v)*hl + Outlet.v*hv;
    206 
    207         "Liquid Enthalpy"
    208         hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);
    209 
    210         "Vapour Enthalpy"
    211         hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
    212 
    213         "Overall Entropy"
    214         s = (1-Outlet.v)*sl + Outlet.v*sv;
    215 
    216         "Liquid Entropy"
    217         sl = PP.LiquidEntropy(Outlet.T, Outlet.P, x);
    218        
    219         "Vapour Entropy"
    220         sv = PP.VapourEntropy(Outlet.T, Outlet.P, y);
    221 
    222         "Average Molecular Weight"
    223         Mw = sum(M*Outlet.z);
    224 
    225         switch rhoModel
    226                 case "volume":
    227         "Molar Density"
    228                 rhom * vm = 1;
    229                
    230                 case "correlation":
    231         "Mass Density"
    232                 rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P,x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,y)) = 1;
    233         end
    234        
    235         "Mass or Molar Density"
    236         rhom * Mw = rho;
    237 
    238         "Flow Mass"
    239         Fw      =  Mw*Outlet.F;
    240 
    241         "Molar Volume"
    242         vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y);
    243        
    244         "Volumetric Flow"
    245         Fvol = Outlet.F*vm ;
    246        
    247         "Mass Fraction"
    248         zmass = M*Outlet.z / Mw;
    249        
    250         "Temperature in °C"
    251         T_Cdeg = Outlet.T - 273.15 * 'K';
    252142       
    253143end
     
    532422end
    533423
    534 Model source_testing
     424Model source
    535425
    536426ATTRIBUTES
Note: See TracChangeset for help on using the changeset viewer.