Ignore:
Timestamp:
Jan 31, 2007, 5:02:46 PM (17 years ago)
Author:
gerson bicca
Message:

testing the new language

File:
1 edited

Legend:

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

    r125 r147  
    107107
    108108        PARAMETERS
    109         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    110         outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);
    111        
     109        outer PP                        as Plugin               (Brief = "External Physical Properties", Type="PP");
     110        outer NComp             as Integer              (Brief = "Number of chemical components", Lower = 1);
     111                        M(NComp)  as molweight  (Brief="Component Mol Weight");
     112       
     113        SET
     114
     115        M   = PP.MolecularWeight();
     116
    112117        VARIABLES
    113118        out Outlet as stream;
     
    116121        hl as enth_mol;
    117122        hv as enth_mol;
     123        zmass(NComp)    as fraction                     (Brief = "Mass Fraction");
     124        Mw                                      as molweight            (Brief="Average Mol Weight");
     125        vm                                      as volume_mol   (Brief="Molar Volume");
     126        rho                                     as dens_mass            (Brief="Stream Density");
     127        Fw                                      as flow_mass            (Brief="Stream Mass Flow");
     128        Fvol                            as flow_vol         (Brief = "Volumetric Flow");
    118129       
    119130        EQUATIONS
    120131        "Flash Calculation"
    121132        [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);
     133       
    122134        "Overall Enthalpy"
    123135        Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) +
     
    126138        hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);
    127139        hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);
     140       
     141        "Average Molecular Weight"
     142        Mw = sum(M*Outlet.z);
     143
     144        "Mass Density"
     145        rho =   (1-Outlet.v)*PP.LiquidDensity(Outlet.T,Outlet.P,x) + Outlet.v*PP.VapourDensity(Outlet.T,Outlet.P,y);
     146
     147        "Flow Mass"
     148        Fw      =  Mw*Outlet.F;
     149
     150        "Molar Volume"
     151        vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y);
     152       
     153        "Volumetric Flow"
     154        Fvol = Outlet.F*vm ;
     155       
     156"Mass Fraction"
     157        zmass = M*Outlet.z / Mw;       
     158       
    128159end
    129160
     
    135166
    136167        PARAMETERS
    137         outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
    138         outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);
     168        outer PP                        as Plugin               (Brief = "External Physical Properties", Type="PP");
     169        outer NComp             as Integer              (Brief = "Number of chemical components", Lower = 1);
     170                        M(NComp)  as molweight  (Brief="Component Mol Weight");
     171       
     172        SET
     173
     174        M   = PP.MolecularWeight();
    139175       
    140176        VARIABLES
    141177        in Inlet as stream;
    142178        v as fraction;
    143         x(NComp) as fraction(Brief = "Liquid Molar Fraction");
    144         y(NComp) as fraction(Brief = "Vapour Molar Fraction");
     179        x(NComp)        as fraction                     (Brief = "Liquid Molar Fraction");
     180        y(NComp)        as fraction                     (Brief = "Vapour Molar Fraction");
     181        zmass(NComp)    as fraction     (Brief = "Mass Fraction");
     182        Mw                      as molweight            (Brief="Average Mol Weight");
     183        vm                      as volume_mol   (Brief="Molar Volume");
     184        rho                     as dens_mass            (Brief="Stream Density");
     185        Fw                      as flow_mass            (Brief="Stream Mass Flow");
     186        Fvol          as flow_vol          (Brief = "Volumetric Flow");
    145187       
    146188        EQUATIONS
    147189        "Flash Calculation"
    148190        [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z);
    149 end
     191       
     192        "Average Molecular Weight"
     193        Mw = sum(M*Inlet.z);
     194
     195        "Mass Density"
     196        rho =   (1-v)*PP.LiquidDensity(Inlet.T,Inlet.P,x) + v*PP.VapourDensity(Inlet.T,Inlet.P,y);
     197
     198        "Flow Mass"
     199        Fw      =  Mw*Inlet.F;
     200
     201        "Molar Volume"
     202        vm = (1-v)*PP.LiquidVolume(Inlet.T, Inlet.P, x) + v*PP.VapourVolume(Inlet.T,Inlet.P,y);
     203       
     204        "Volumetric Flow"
     205        Fvol = Inlet.F*vm ;
     206       
     207        "Mass Fraction"
     208        zmass = M*Inlet.z / Mw;
     209       
     210end
Note: See TracChangeset for help on using the changeset viewer.