Ignore:
Timestamp:
Aug 23, 2008, 5:26:51 PM (15 years ago)
Author:
gerson bicca
Message:

updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/eml/pressure_changers/compressor.mso

    r601 r606  
    3131PARAMETERS
    3232
    33 outer PP                as Plugin               (Brief = "External Physical Properties", Type="PP");
    34 outer NComp     as Integer              (Brief = "Number of chemical components", Lower = 1);
    35         Rgas            as positive     (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);
    36         Mw(NComp)       as molweight    (Brief = "Molar Weight");
    37         CompressorType  as Switcher     (Brief = "Compressor Model Type",Valid=["Polytropic Operation","Isentropic Operation"], Default="Isentropic Operation");
     33outer PP                                        as Plugin                       (Brief = "External Physical Properties", Type="PP");
     34outer NComp                     as Integer                      (Brief = "Number of chemical components", Lower = 1);
     35        Rgas                                            as positive             (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);
     36        Mw(NComp)                       as molweight    (Brief = "Molar Weight");
     37        CompressorType  as Switcher             (Brief = "Compressor Model Type",Valid=["Polytropic Operation","Isentropic Operation"], Default="Isentropic Operation");
    3838
    3939VARIABLES
    4040
    41         PolyCoeff       as positive             (Brief = "Polytropic Coefficient", Lower=1E-6);
    42         IseCoeff        as positive     (Brief = "Isentropic Coefficient", Lower=1E-6);
    43         Cp              as cp_mol               (Brief = "Heat Capacity at constant Pressure");
    44         Cv                      as cv_mol               (Brief = "Heat Capacity at constant Volume");
     41        PolyCoeff       as positive             (Brief = "Polytropic Coefficient", Lower=0.2);
     42        IseCoeff        as positive     (Brief = "Isentropic Coefficient", Lower=0.2);
    4543        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
    4644        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    4745        Pincrease       as press_delta  (Brief = "Pressure Increase", DisplayUnit = 'kPa', Symbol ="P_{incr}");
    4846
    49         Head            as energy_mass  (Brief = "Head");
    50         Tiso            as temperature  (Brief = "Isentropic Temperature");
     47        Head                    as energy_mass  (Brief = "Actual Head");
     48        HeadIsentropic  as energy_mass  (Brief = "Isentropic Head");
     49        HeadPolytropic  as energy_mass  (Brief = "Polytropic Head");
     50        Tisentropic             as temperature  (Brief = "Isentropic Temperature");
    5151       
    52         PolytropicEff   as efficiency   (Brief = "Polytropic efficiency");
    53         IsentropicEff   as efficiency   (Brief = "Isentropic efficiency");
    54         MechanicalEff   as efficiency   (Brief = "Mechanical efficiency");
     52        PolytropicEff                           as efficiency   (Brief = "Polytropic efficiency");
     53        IsentropicEff                           as efficiency   (Brief = "Isentropic efficiency");
     54        EfficiencyOperation             as efficiency   (Brief = "Compressor efficiency - Polytropic or Isentropic (See Compressor Type)");
     55        MechanicalEff                           as efficiency   (Brief = "Mechanical efficiency");
    5556       
    56         FluidPower      as power                (Brief = "Fluid Power");
    57         BrakePower      as power                (Brief = "Brake Power");
    58         PowerLoss       as power                (Brief = "Power Losses");
    59         Mwm                     as molweight    (Brief = "Mixture Molar Weight");
    60         rho                     as dens_mass    (Brief = "Mass Density");
    61         Zfac_in         as fraction     (Brief = "Compressibility factor at inlet");
    62         Zfac_out        as fraction     (Brief = "Compressibility factor at outlet");
     57        FluidPower      as power                        (Brief = "Fluid Power");
     58        BrakePower      as power                        (Brief = "Brake Power");
     59        PowerLoss       as power                        (Brief = "Power Losses");
     60        Mwm                     as molweight            (Brief = "Mixture Molar Weight");
     61        rho                     as dens_mass            (Brief = "Mass Density");
     62        Zfac_in         as fraction             (Brief = "Compressibility factor at inlet");
     63        Zfac_out        as fraction             (Brief = "Compressibility factor at outlet");
    6364
    64 in      Inlet           as stream       (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}");
    65 out     Outlet          as streamPH     (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}");
     65in      Inlet   as stream       (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}");
     66out     Outlet  as streamPH     (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}");
    6667
    67 in      WorkIn          as power        (Brief = "Work Inlet", PosX=0, PosY=0.45);
     68in      WorkIn  as power        (Brief = "Work Inlet", PosX=0, PosY=0.45);
    6869
    6970SET
     
    9596"Mass Density"
    9697        rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
    97        
    98 "Heat Capacity at Constant Pressure"
    99         Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z);
    100        
    101 "Heat Capacity at Constant Volume"
    102         Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z);
    103        
     98
    10499"Compressibility factor at Inlet Conditions"
    105100        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
    106        
     101
    107102"Compressibility factor at Outlet Conditions"
    108103        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
    109        
    110 "Isentropic Coeficient"
    111         IseCoeff * Cv = Cp;
    112104
    113 switch CompressorType
    114        
    115         case "Isentropic Operation":
    116        
    117105"Isentropic Head"
    118         Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff) - 1);
     106        HeadIsentropic*Mwm = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h);
     107
     108"Actual Head"
     109        Head*Mwm = (Outlet.h-Inlet.h);
     110
     111"Isentropic Outlet Temperature"
     112        PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
    119113
    120114"Fluid Power"
    121         FluidPower*IsentropicEff = Head*sum(Mw*Inlet.z)*Inlet.F;
    122 
    123 "Discharge Temperature"
    124         Outlet.T = Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff));
    125 
    126         case "Polytropic Operation":
    127        
    128 "Polytropic Head"
    129         Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1.001)/PolyCoeff) - 1);
    130 
    131 "Fluid Power"
    132         FluidPower*PolytropicEff = Head*sum(Mw*Inlet.z)*Inlet.F;
    133 
    134 "Discharge Temperature"
    135         Outlet.T = Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1.001)/PolyCoeff));
    136 
    137 end
    138 
    139 "Isentropic Outlet Temperature"
    140         PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
    141 
    142 "Polytropic Efficiency"
    143         PolytropicEff * (PolyCoeff-1) * IseCoeff = PolyCoeff * (IseCoeff-1);
     115        FluidPower = Head*sum(Mw*Inlet.z)*Inlet.F;
    144116
    145117"Brake Power"
     
    147119
    148120"Brake Power"
    149         BrakePower = (FluidPower/MechanicalEff)-PowerLoss;
     121        BrakePower = FluidPower/MechanicalEff;
    150122
    151123"Power Loss"
    152124        PowerLoss = BrakePower - FluidPower;
    153125
     126"Isentropic Efficiency"
     127        IsentropicEff*(PP.VapourEnthalpy(Outlet.T,Outlet.P,Outlet.z)-Inlet.h) = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h);
     128
     129"Polytropic-Isentropic Relation"
     130        PolytropicEff*HeadIsentropic = HeadPolytropic*IsentropicEff;
     131
     132"Polytropic Efficiency"
     133        PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1);
     134
     135"Isentropic Coefficient"
     136        HeadIsentropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff) - 1);
     137
     138"Polytropic Coefficient"
     139        HeadPolytropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1.001)/PolyCoeff) - 1);
     140
     141switch CompressorType
     142
     143        case "Isentropic Operation":
     144
     145"Discharge Temperature"
     146        EfficiencyOperation = IsentropicEff;
     147
     148        case "Polytropic Operation":
     149
     150"Discharge Temperature"
     151        EfficiencyOperation = PolytropicEff;
     152
    154153end
     154
     155
     156end
Note: See TracChangeset for help on using the changeset viewer.