source: branches/gui/eml/pressure_changers/compressor.mso @ 993

Last change on this file since 993 was 864, checked in by gerson bicca, 13 years ago

revised compressor model

  • Property svn:keywords set to Id
File size: 8.2 KB
RevLine 
[739]1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*----------------------------------------------------------------------
16* Author: Marcos L. Alencastro,  Estefane S. Horn (Revised Gerson B. Bicca)
17* $Id: compressor.mso 864 2009-10-19 19:41:09Z bicca $
18*--------------------------------------------------------------------*#
19
20using "streams";
21
22Model centrifugal_compressor
23       
24ATTRIBUTES
25        Pallete         = true;
26        Icon            = "icon/CentrifugalCompressor";
27        Brief           = "Model of a centrifugal compressor.";
28        Info            =
29"To be documented
30
31== References ==
32
33[1] GPSA, 1979, Engineering Data Book, Chapter 4, 5-9 - 5-10.
34
35[2] Bloch, Heinz P., A Practical Guide to Compressor Technology, John Wiley & Sons, Incorporate, 2006.
36
37[3] Mark R. Sandberg, Equation Of State Influences On Compressor Performance Determination,PROCEEDINGS OF THE THIRTY-FOURTH TURBOMACHINERY SYMPOSIUM, 2005.";
38       
39PARAMETERS
40
41outer PP                                        as Plugin                       (Brief = "External Physical Properties", Type="PP");
42outer NComp                     as Integer              (Brief = "Number of chemical components", Lower = 1);
43        Rgas                                            as positive             (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);
[864]44        Mw(NComp)                       as molweight    (Brief = "Molar Weight",Hidden=true);
45        CompressorOperation     as Switcher             (Brief = "Compressor Operation Model",Valid=["Polytropic","Isentropic"], Default="Isentropic");
46        Method  as Switcher             (Brief = "Method of Calculation",Valid=["GPSA Method","ASME Method"], Default="GPSA Method");
[739]47
48VARIABLES
49
50        Pratio          as positive             (Brief = "Pressure Ratio", Lower = 1E-6, Symbol ="P_{ratio}"); 
51        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
52        Pincrease       as press_delta  (Brief = "Pressure Increase",Lower = 0,  DisplayUnit = 'kPa', Symbol ="P_{incr}");
53        EfficiencyOperation     as positive     (Brief = "Compressor efficiency - Polytropic or Isentropic (See Compressor Type)",Lower=1E-3,Upper=1);
54        MechanicalEff                   as positive     (Brief = "Mechanical efficiency",Lower=1E-3,Upper=1);
55        PowerLoss       as power        (Brief = "Power Losses");
56        Head                                    as energy_mass  (Brief = "Actual Head", Protected=true);
57        HeadIsentropic  as energy_mass  (Brief = "Isentropic Head", Protected=true);
58        HeadPolytropic  as energy_mass  (Brief = "Polytropic Head", Protected=true);
59        HeadCorrection   as positive                    (Brief = "Schultz Polytropic Head Correction", Protected=true);
60       
61        FluidPower      as power        (Brief = "Fluid Power", Protected=true);
62        BrakePower      as power        (Brief = "Brake Power", Protected=true);
63
64        PolyCoeff                       as positive     (Brief = "Polytropic Coefficient", Lower=0.2,Protected=true);
65        IseCoeff                        as positive     (Brief = "Isentropic Coefficient", Lower=0.2,Protected=true);
66        PolytropicEff   as positive     (Brief = "Polytropic efficiency",Lower=1E-3,Upper=1,Protected=true);
67        IsentropicEff   as positive     (Brief = "Isentropic efficiency",Lower=1E-3,Upper=1,Protected=true);
68
69        Tisentropic     as temperature          (Brief = "Isentropic Temperature",Protected=true);
70        hise                    as enth_mol             (Brief = "Enthalpy at constant entropy",Hidden=true);
71        Mwm                     as molweight            (Brief = "Mixture Molar Weight",Hidden=true);
72        rho_in                  as dens_mass            (Brief = "Mass Density at inlet conditions", Lower = 1E-6, Protected=true);
73        rho_out         as dens_mass            (Brief = "Mass Density at outlet conditions", Lower = 1E-6, Protected=true);
74        rho_ise         as dens_mass            (Brief = "Mass Density at isentropic conditions", Lower = 1E-6, Hidden=true);
75        Zfac_in                 as fraction             (Brief = "Compressibility factor at inlet", Lower = 1E-3, Protected=true);
76        Zfac_out                as fraction             (Brief = "Compressibility factor at outlet", Lower = 1E-3, Protected=true);
77
78in      Inlet   as stream       (Brief = "Inlet stream", PosX=0.16, PosY=1, Symbol="_{in}");
79out     Outlet  as streamPH     (Brief = "Outlet stream", PosX=0.87, PosY=0.0, Symbol="_{out}");
80
81in      WorkIn  as power        (Brief = "Work Inlet", PosX=0, PosY=0.45, Protected=true);
82
83SET
84
85        Mw = PP.MolecularWeight();
86
87        Rgas    = 8.31451*'kJ/kmol/K';
88
89EQUATIONS
90
91"Overall Molar Balance"
92        Outlet.F = Inlet.F;
93
94"Component Molar Balance"
95        Outlet.z = Inlet.z;
96
97"Average Molecular Weight"
98        Mwm = sum(Mw*Inlet.z);
99
100"Pressure Ratio"
101        Outlet.P = Inlet.P * Pratio;
102
103"Pressure Drop"
104        Outlet.P  = Inlet.P - Pdrop;
105
106"Pressure Increase"
107        Outlet.P  = Inlet.P + Pincrease;
108
109"Mass Density at inlet conditions"
110        rho_in = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
111
112"Mass Density at outlet conditions"
113        rho_out= PP.VapourDensity(Outlet.T, Outlet.P, Outlet.z);
114
115"Mass Density at isentropic conditions"
116        rho_ise= PP.VapourDensity(Tisentropic, Outlet.P, Outlet.z);
117
118"Enthalpy at isentropic conditions"
119        hise = PP.VapourEnthalpy(Tisentropic, Outlet.P, Outlet.z);
120       
121"Compressibility factor at Inlet Conditions"
122        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
123
124"Compressibility factor at Outlet Conditions"
125        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
126
127"Isentropic Efficiency"
128        IsentropicEff*(Outlet.h-Inlet.h) = (hise-Inlet.h);
129
130"Actual Head"
131        Head*Mwm = (Outlet.h-Inlet.h);
132
133"Isentropic Outlet Temperature"
134        PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
135
136"Brake Power"
137        BrakePower = -WorkIn;
138
139"Brake Power"
140        BrakePower*MechanicalEff = FluidPower;
141
142"Power Loss"
143        PowerLoss = BrakePower - FluidPower;
144
145"Polytropic-Isentropic Relation"
146        PolytropicEff*HeadIsentropic = HeadPolytropic*IsentropicEff;
147
148"Fluid Power"
149        FluidPower = Head*Mwm*Inlet.F;
150
[864]151switch CompressorOperation
[739]152
[864]153        case "Isentropic":
154       
155switch Method
156       
157        case "ASME Method":
[739]158
159"Efficiency"
160        EfficiencyOperation = IsentropicEff;
161
[864]162"Isentropic Coefficient"
163        IseCoeff*ln(rho_ise/rho_in) = ln(Outlet.P/Inlet.P);
164
165"Polytropic Coefficient"
166        PolyCoeff*ln(rho_out/rho_in) = ln(Outlet.P/Inlet.P);
167
168"Isentropic Head"
169        HeadIsentropic*rho_in = (IseCoeff/(IseCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
170
171"Polytropic Head"
172        HeadPolytropic*rho_in = (PolyCoeff/(PolyCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
173
174"Schultz Polytropic Head Correction"
175        HeadCorrection*Mwm*(IseCoeff/(IseCoeff-1.001))*(Outlet.P/rho_ise -Inlet.P/rho_in) = (hise-Inlet.h);
176       
177        case "GPSA Method":
178
179"Efficiency"
180        EfficiencyOperation = IsentropicEff;
181
[739]182"Polytropic Efficiency"
183        PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1);
184
185"Isentropic Coefficient"
186        HeadIsentropic*Mwm*((IseCoeff-1.001)/IseCoeff) = (0.5*Zfac_in+0.5*Zfac_out)*Rgas*Inlet.T*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
187
188"Polytropic Coefficient"
189        HeadPolytropic*Mwm*((PolyCoeff-1.001)/PolyCoeff) = (0.5*Zfac_in+0.5*Zfac_out)*Rgas*Inlet.T*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
190
191"Head Correction"
192        HeadCorrection =1;
193
194"Isentropic Head"
195        HeadIsentropic = Head*IsentropicEff;
196
[864]197end
198
199        case "Polytropic":
200
201switch Method
202
203        case "GPSA Method":
204
[739]205"Efficiency"
206        EfficiencyOperation = PolytropicEff;
207
208"Polytropic Efficiency"
209        PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1);
210
211"Isentropic Coefficient"
212        HeadIsentropic*Mwm*((IseCoeff-1.001)/IseCoeff) = (0.5*Zfac_in+0.5*Zfac_out)*Rgas*Inlet.T*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
213
214"Polytropic Coefficient"
215        HeadPolytropic*Mwm*((PolyCoeff-1.001)/PolyCoeff) = (0.5*Zfac_in+0.5*Zfac_out)*Rgas*Inlet.T*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
216
217"Head Correction"
218        HeadCorrection =1;
219
220"Isentropic Head"
221        HeadIsentropic = Head*IsentropicEff;
222       
[864]223        case "ASME Method":
[739]224
225"Efficiency"
226        EfficiencyOperation = PolytropicEff;
227
228"Isentropic Coefficient"
229        IseCoeff*ln(rho_ise/rho_in) = ln(Outlet.P/Inlet.P);
230
231"Polytropic Coefficient"
232        PolyCoeff*ln(rho_out/rho_in) = ln(Outlet.P/Inlet.P);
233
234"Isentropic Head"
235        HeadIsentropic*rho_in = (IseCoeff/(IseCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
236
237"Polytropic Head"
238        HeadPolytropic*rho_in = (PolyCoeff/(PolyCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
239       
240"Schultz Polytropic Head Correction"
241        HeadCorrection*Mwm*(IseCoeff/(IseCoeff-1.001))*(Outlet.P/rho_ise -Inlet.P/rho_in) =  (hise-Inlet.h);
242end
243
244end
[864]245
246end
Note: See TracBrowser for help on using the repository browser.