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

testing the new language

Location:
branches/newlanguage/eml
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/newlanguage/eml/heat_exchangers/HEX_Engine.mso

    r146 r147  
    8686VARIABLES
    8787# Must be streamPH
    88 Hot     as vapour_stream (Brief="Outlet Hot Stream");
    89 Cold    as liquid_stream (Brief="Outlet Cold Stream");
     88Hot     as streamPH (Brief="Outlet Hot Stream");
     89Cold    as streamPH (Brief="Outlet Cold Stream");
    9090
    9191end
  • branches/newlanguage/eml/heat_exchangers/HeatExchangerSimplified.mso

    r146 r147  
    3030PARAMETERS
    3131outer PP                as Plugin               (Brief="External Physical Properties");
    32                 HE              as Plugin               (Brief="STHE Calculations",File="heatex");
    3332outer NComp     as Integer      (Brief="Number of Components");
    3433                M(NComp)  as molweight  (Brief="Component Mol Weight");
     
    553552VARIABLES
    554553
    555 R               as positive;
    556 P               as positive;
    557 Pc              as positive;
    558 Rho     as positive;
    559 #Phi    as positive;
     554R                       as positive;
     555P                       as positive;
     556Pc                      as positive;
     557Rho             as positive;
     558Phi     as positive;
     559lambdaN as positive;
     560lambda1 as positive;
    560561
    561562EQUATIONS
     
    564565        Rho*(1-P*R) = (1-P);
    565566
    566 "Capacity Ratio for LMTD Correction Fator"
     567"R: Capacity Ratio for LMTD Correction Fator"
    567568        R*(Outlet.Cold.T - Inlet.Cold.T ) = (Inlet.Hot.T-Outlet.Hot.T);
    568569
    569 "Non - Dimensional Variable for LMTD Correction Fator"
     570"P: Non - Dimensional Variable for LMTD Correction Fator"
    570571        P*(Inlet.Hot.T- Inlet.Cold.T)= (Outlet.Cold.T-Inlet.Cold.T);
    571572       
     
    575576"Temperature Difference at Outlet"
    576577        DTL = Outlet.Hot.T - Inlet.Cold.T;
    577        
     578
     579switch LMTDcorrection
     580       
     581        case "Bowmann":
     582       
     583        lambdaN =1;
     584        lambda1 =1;
     585        Phi = 1;
     586
    578587if R equal 1
    579588       
    580589        then
    581590        Pc*(2-P)= P;
    582        
    583591        Fc= (sqrt(2)*Pc)/((1-Pc)*ln( abs( ( 2-Pc*0.585786)/( 2-Pc*3.414214))));
    584592       
    585593        else
    586594        Pc = (sqrt(abs(( 1-P*R)/(1-P)))-1)/(sqrt(abs(( 1-P*R)/(1-P)))-R);
    587         Fc =sqrt(R*R+1)*ln(abs((1-Pc*R)/(1-Pc)))/((1-R)*ln( abs( ( 2-Pc*(R+1-sqrt(R*R+1)))/ ( 2-Pc*(R + 1 + sqrt(R*R+1))))));
    588        
    589 end
    590 
    591 
    592 end
    593 
     595        Fc = sqrt(R*R+1)*ln(abs((1-Pc*R)/(1-Pc)))/((1-R)*ln( abs( ( 2-Pc*(R+1-sqrt(R*R+1)))/ ( 2-Pc*(R + 1 + sqrt(R*R+1))))));
     596       
     597end
     598
     599        case "Fakeri":
     600        Pc = P;
     601        Phi = (sqrt(((Inlet.Hot.T - Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T -  Inlet.Cold.T)*(Outlet.Cold.T -  Inlet.Cold.T))))/(2*((Inlet.Hot.T + Outlet.Hot.T)-( Inlet.Cold.T + Outlet.Cold.T)));
     602
     603if Rho equal 1
     604       
     605        then
     606        lambdaN =       1;
     607        lambda1 =       1;
     608        Fc = (2*Phi )/(ln(abs((1+Phi )/(1-Phi ))));
     609       
     610        else
     611
     612        lambdaN = (1/ln(sqrt(abs(Rho))))*((2*sqrt(abs(Rho))-2)/(sqrt(abs(Rho))+1));
     613       
     614        lambda1 = (1/ln(abs(Rho)))*((2*Rho-2)/(Rho+1));
     615
     616        Fc =    ((2*Phi *(lambdaN/lambda1))/(ln(abs((1+Phi *(lambdaN/lambda1))/(1-Phi *(lambdaN/lambda1))))))*(1/lambdaN);
     617
     618end
     619
     620
     621end
     622
     623
     624end
    594625#=====================================================================
    595626# NTU Method
  • branches/newlanguage/eml/heat_exchangers/Mheatex.mso

    r144 r147  
    6767
    6868VARIABLES
    69 # Must be streamPH
    70         Hot  (Nhot)     as liquid_stream (Brief="Outlet Hot Streams");
    71         Cold (Ncold)    as liquid_stream (Brief="Outlet Cold Streams");
     69
     70Hot  (Nhot)     as streamPH (Brief="Outlet Hot Streams");
     71Cold (Ncold)    as streamPH (Brief="Outlet Cold Streams");
    7272       
    7373end
  • 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.