Ignore:
Timestamp:
Jul 25, 2008, 5:48:22 PM (15 years ago)
Author:
gerson bicca
Message:

updated source_testing

File:
1 edited

Legend:

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

    r576 r577  
    564564        outer NComp                             as Integer                      (Brief = "Number of chemical components", Lower = 1);
    565565                  M(NComp)                              as molweight    (Brief = "Component Mol Weight");
    566                   rhoModel                              as Switcher             (Brief = "Density model", Valid = ["volume", "correlation"], Default="volume");
    567566                  CompostionBasis               as Switcher             (Brief = "Molar or Mass Compostion", Valid = ["Molar", "Mass"], Default="Molar");
     567                  ValidPhases                           as Switcher             (Brief = "Valid Phases for Flash Calculation", Valid = ["Vapour-Only", "Liquid-Only","Vapour-Liquid"], Default="Vapour-Liquid");
    568568       
    569569
     
    614614end
    615615
     616switch ValidPhases
     617       
     618        case "Liquid-Only":
     619
     620"Vapour Fraction"
     621        Outlet.v = 0;
     622
     623"Liquid Composition"
     624        x = Outlet.z;
     625
     626"Vapour Composition"
     627        y = Outlet.z;
     628
     629"Overall Enthalpy"
     630        Outlet.h = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);
     631
     632"Molar Volume"
     633        vm = PP.LiquidVolume(Outlet.T, Outlet.P, x);
     634
     635        case "Vapour-Only":
     636
     637"Vapor Fraction"
     638        Outlet.v = 1;
     639
     640"Liquid Composition"
     641        x = Outlet.z;
     642
     643"Vapour Composition"
     644        y = Outlet.z;
     645
     646"Overall Enthalpy"
     647        Outlet.h = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
     648
     649"Molar Volume"
     650        vm = PP.VapourVolume(Outlet.T, Outlet.P, y);
     651
     652
     653        case "Vapour-Liquid":
     654
     655"Flash Calculation"
     656        [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
     657
     658"Overall Enthalpy"
     659        Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
     660
     661"Molar Volume"
     662        vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y);
     663
     664end
     665
     666"Molar Density"
     667        rhom * vm = 1;
     668
    616669"Average Molecular Weight"
    617670        Mw = sum(M*Outlet.z);
    618        
    619 "Flash Calculation"
    620         [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
    621 
    622 "Overall Enthalpy"
    623         Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
    624 
    625 switch rhoModel
    626 
    627         case "volume":
    628 "Molar Density"
    629                 rhom * vm = 1;
    630                
    631 case "correlation":
    632         "Mass Density"
    633                 rho = (1-Outlet.v)*PP.LiquidDensity(Outlet.T,Outlet.P,x) + Outlet.v*PP.VapourDensity(Outlet.T,Outlet.P,y);
    634 end
    635        
     671
    636672"Mass or Molar Density"
    637673        rhom * Mw = rho;
     
    640676        Fw      =  Mw*Outlet.F;
    641677
    642 "Molar Volume"
    643         vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y);
    644        
    645678"Volumetric Flow"
    646679        Fvol = Outlet.F*vm ;
Note: See TracChangeset for help on using the changeset viewer.