Changeset 598


Ignore:
Timestamp:
Aug 15, 2008, 1:54:51 AM (14 years ago)
Author:
gerson bicca
Message:

updated compressor model e added sample diagram

Location:
branches/gui
Files:
1 added
2 edited

Legend:

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

    r596 r598  
    3030PARAMETERS
    3131
    32 outer PP                        as Plugin                       (Brief = "External Physical Properties", Type="PP");
    33 outer NComp     as Integer                      (Brief = "Number of chemical components", Lower = 1);
    34         R                                       as positive             (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);
     32outer PP                as Plugin               (Brief = "External Physical Properties", Type="PP");
     33outer NComp     as Integer              (Brief = "Number of chemical components", Lower = 1);
     34        Rgas            as positive     (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);
    3535        Mw(NComp)       as molweight    (Brief = "Molar Weight");
     36        CompressorType  as Switcher     (Brief = "Compressor Model Type",Valid=["Polytropic Operation","Isentropic Operation"], Default="Isentropic Operation");
    3637
    3738VARIABLES
    3839
    39         n                               as positive             (Brief = "Politropic Coefficient", Lower=0);
    40         k                               as positive             (Brief = "Isentropic Coefficient", Lower=1e-3);
    41         Cp              as cp_mol                       (Brief = "Heat Capacity");
    42         Cv                      as cv_mol                       (Brief = "Heat Capacity");
     40        PolyCoeff       as positive             (Brief = "Polytropic Coefficient", Lower=0);
     41        IseCoeff        as positive     (Brief = "Isentropic Coefficient", Lower=1e-3);
     42        Cp              as cp_mol               (Brief = "Heat Capacity");
     43        Cv                      as cv_mol               (Brief = "Heat Capacity");
    4344        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
    4445        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
    45         Wp                      as energy_mol   (Brief = "Politropic Head");
    46         Ws                      as energy_mol   (Brief = "Isentropic Head");
    47         Tiso                    as temperature          (Brief = "Isentropic Temperature");
    48         Effp                    as positive             (Brief = "Politropic efficiency");
    49         Effs                    as efficiency           (Brief = "Isentropic efficiency");
    50         FPower          as power                        (Brief = "Fluid Power");
    51         Mwm                     as molweight            (Brief = "Mixture Molar Weight");
    5246
    53 in              Inlet           as stream               (Brief = "Inlet stream", PosX=0.35, PosY=1, Symbol="_{in}");
    54 out     Outlet          as streamPH     (Brief = "Outlet stream", PosX=1, PosY=0.0, Symbol="_{out}");
     47        Head            as energy_mass  (Brief = "Isentropic Head");
     48        Tiso            as temperature  (Brief = "Isentropic Temperature");
     49       
     50        PolytropicEff   as efficiency   (Brief = "Polytropic efficiency");
     51        IsentropicEff   as efficiency   (Brief = "Isentropic efficiency");
     52        MechanicalEff   as efficiency   (Brief = "Mechanical efficiency");
     53       
     54        FluidPower      as power                (Brief = "Fluid Power");
     55        Mwm                     as molweight    (Brief = "Mixture Molar Weight");
     56        rho                     as dens_mass    (Brief = "Mass Density");
     57        Zfac_in         as fraction     (Brief = "Compressibility factor at inlet");
     58        Zfac_out        as fraction     (Brief = "Compressibility factor at outlet");
    5559
    56 in      WorkIn          as power                (Brief = "Work Inlet", PosX=0, PosY=0.46);
     60in      Inlet           as stream       (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}");
     61out     Outlet          as streamPH     (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}");
     62
     63in      WorkIn          as power        (Brief = "Work Inlet", PosX=0, PosY=0.45);
    5764
    5865SET
     
    6067        Mw = PP.MolecularWeight();
    6168
    62         R       = 8.31451*'kJ/kmol/K';
     69        Rgas    = 8.31451*'kJ/kmol/K';
    6370
    6471EQUATIONS
    6572
    66 "Calculate Mwm for Inlet Mixture"
     73"Overall Molar Balance"
     74        Outlet.F = Inlet.F;
     75
     76"Component Molar Balance"
     77        Outlet.z = Inlet.z;
     78
     79"Average Molecular Weight"
    6780        Mwm = sum(Mw*Inlet.z);
    6881
     
    7386        Outlet.P  = Inlet.P - Pdrop;
    7487
    75 "Calculate Cp Using a External Physical Properties Routine"
     88"Mass Density"
     89        rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
     90       
     91"Heat Capacity at Constant Pressure"
    7692        Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z);
    7793       
    78 "Calculate Cv Using a External Physical Properties Routine"
     94"Heat Capacity at Constant Volume"
    7995        Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z);
    8096       
    81 "Calculate Isentropic Coeficient"
    82         k * Cv = Cp;
     97"Compressibility factor at Inlet Conditions"
     98        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
    8399       
    84 "Calculate Isentropic Head"
    85         Ws = (k/(k-1))*R*Inlet.T*((Outlet.P/Inlet.P)^((k-1)/k) - 1);
     100"Compressibility factor at Outlet Conditions"
     101        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
    86102       
    87 "Calculate Isentropic Outlet Temperature"
    88 #       Tiso = Inlet.T * (Outlet.P/Inlet.P)^((k-1)/k);
     103"Isentropic Coeficient"
     104        IseCoeff * Cv = Cp;
     105
     106#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     107switch CompressorType
     108       
     109        case "Isentropic Operation":
     110       
     111"Isentropic Head"
     112        Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1)/IseCoeff) - 1);
     113
     114"Fluid Power"
     115        FluidPower*IsentropicEff = Head*sum(Mw*Inlet.z)*Inlet.F;
     116
     117        case "Polytropic Operation":
     118       
     119"Polytropic Head"
     120        Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1)/PolyCoeff) - 1);
     121
     122"Fluid Power"
     123        FluidPower*PolytropicEff = Head*sum(Mw*Inlet.z)*Inlet.F;
     124
     125end
     126
     127"Isentropic Outlet Temperature"#Mollier Method ?
    89128        PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
    90129
    91 "Calculate Real Outlet Temperature"
    92         Effs * (Outlet.T- Inlet.T) = (Tiso - Inlet.T);
    93        
     130"Discharge Temperature"
     131        IsentropicEff * (Outlet.T- Inlet.T) = (Tiso - Inlet.T);
     132
    94133"Calculate Politropic Coefficient"
    95         n*(ln(Outlet.T/Inlet.T)) = (n-1)*(ln(Outlet.P/Inlet.P));
    96        
    97 "Calculate Politropic Efficiency"
    98         Effp * (n-1) * k = n * (k-1);
    99        
    100 "Calculate Politropic Head"
    101         Ws*Effp = Wp*Effs;
     134        PolyCoeff*(ln(Outlet.T/Inlet.T)) = (PolyCoeff-1)*(ln(Outlet.P/Inlet.P));
    102135
    103 "Overall Molar Balance"
    104         Outlet.F = Inlet.F;
    105 
    106 "Component Molar Balance"
    107         Outlet.z = Inlet.z;
    108 
    109 # Testing Equations
     136#"Polytropic Efficiency"
     137        #PolytropicEff * (PolyCoeff-1) * IseCoeff = PolyCoeff * (IseCoeff-1);
    110138
    111139"Fluid Power"
    112         FPower*Effs = Inlet.F*Ws;
    113 
    114 "Fluid Power"
    115         FPower = WorkIn;
     140        FluidPower = -WorkIn;
    116141
    117142end
  • branches/gui/sample/pressure_changers/sample_compressor.mso

    r597 r598  
    5252        S1.ValidPhases = "Vapour-Only";
    5353        S1.CompositionBasis = "Molar";
     54        C1.CompressorType = "Isentropic Operation";
    5455
    5556        SPECIFY
    56         C1.Effs = 0.75;
     57        C1.IsentropicEff        = 0.75;
     58        C1.PolytropicEff        = 0.75;
     59        C1.MechanicalEff        = 0.98;
    5760        S1.F = 41.05            * 'kmol/h';
    5861        S1.P = 1                        * 'atm';
     
    6972                Type="PP",
    7073                Components = ["propane"],
    71                 LiquidModel = "IdealLiquid",
    72                 VapourModel = "Ideal"
     74                LiquidModel = "PR",
     75                VapourModel = "PR"
    7376        );
    7477        NComp   as Integer              (Default= 1);
     
    8992        S1.ValidPhases = "Vapour-Only";
    9093        S1.CompositionBasis = "Molar";
     94        C1.CompressorType = "Polytropic Operation";
    9195
    9296        SPECIFY
    93         C1.Effs = 0.75;
    94         S1.F = 41.05            * 'kmol/h';
    95         S1.P = 1                        * 'atm';
     97        C1.IsentropicEff        = 0.75;
     98        C1.PolytropicEff        = 0.75;
     99        C1.MechanicalEff        = 0.98;
     100       
     101        #W1.Work = 2*'kW';
     102       
     103        S1.F = 4                * 'kmol/h';
     104        S1.P = 100                      * 'kPa';
    96105        S1.T = 298                      * 'K' ;
    97         S1.Composition = [01];
     106        S1.Composition = [1];
    98107       
    99         C1.Outlet.P = 3 * 'atm';
     108        C1.Outlet.P = 400       * 'kPa';
    100109end
Note: See TracChangeset for help on using the changeset viewer.