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

Last change on this file since 687 was 687, checked in by gerson bicca, 14 years ago

updated compressor model (BRANCH)

  • Property svn:keywords set to Id
File size: 8.2 KB
Line 
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 687 2008-11-20 19:42:33Z 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);
44        Mw(NComp)                       as molweight    (Brief = "Molar Weight");
45        CompressorType  as Switcher             (Brief = "Compressor Model Type",Valid=["Polytropic With GPSA Method","Isentropic With GPSA Method","Isentropic With ASME Method","Polytropic With ASME Method"], Default="Isentropic With GPSA Method");
46
47VARIABLES
48
49        Pratio          as positive             (Brief = "Pressure Ratio", Lower = 1E-6, Symbol ="P_{ratio}"); 
50        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
51        Pincrease       as press_delta  (Brief = "Pressure Increase",Lower = 0,  DisplayUnit = 'kPa', Symbol ="P_{incr}");
52        EfficiencyOperation     as positive     (Brief = "Compressor efficiency - Polytropic or Isentropic (See Compressor Type)",Lower=1E-3,Upper=1);
53        MechanicalEff                   as positive     (Brief = "Mechanical efficiency",Lower=1E-3,Upper=1);
54        PowerLoss       as power        (Brief = "Power Losses");
55        Head                                    as energy_mass  (Brief = "Actual Head", Protected=true);
56        HeadIsentropic  as energy_mass  (Brief = "Isentropic Head", Protected=true);
57        HeadPolytropic  as energy_mass  (Brief = "Polytropic Head", Protected=true);
58        HeadCorrection   as positive                    (Brief = "Schultz Polytropic Head Correction", Protected=true);
59       
60        FluidPower      as power        (Brief = "Fluid Power", Protected=true);
61        BrakePower      as power        (Brief = "Brake Power", Protected=true);
62
63        PolyCoeff                       as positive     (Brief = "Polytropic Coefficient", Lower=0.2,Protected=true);
64        IseCoeff                        as positive     (Brief = "Isentropic Coefficient", Lower=0.2,Protected=true);
65        PolytropicEff   as positive     (Brief = "Polytropic efficiency",Lower=1E-3,Upper=1,Protected=true);
66        IsentropicEff   as positive     (Brief = "Isentropic efficiency",Lower=1E-3,Upper=1,Protected=true);
67
68        Tisentropic     as temperature          (Brief = "Isentropic Temperature",Protected=true);
69        hise                    as enth_mol             (Brief = "Enthalpy at constant entropy",Hidden=true);
70        Mwm                     as molweight            (Brief = "Mixture Molar Weight",Hidden=true);
71        rho_in                  as dens_mass            (Brief = "Mass Density at inlet conditions", Lower = 1E-6, Protected=true);
72        rho_out         as dens_mass            (Brief = "Mass Density at outlet conditions", Lower = 1E-6, Protected=true);
73        rho_ise         as dens_mass            (Brief = "Mass Density at isentropic conditions", Lower = 1E-6, Hidden=true);
74        Zfac_in                 as fraction             (Brief = "Compressibility factor at inlet", Lower = 1E-3, Protected=true);
75        Zfac_out                as fraction             (Brief = "Compressibility factor at outlet", Lower = 1E-3, Protected=true);
76
77in      Inlet   as stream       (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}");
78out     Outlet  as streamPH     (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}");
79
80in      WorkIn  as power        (Brief = "Work Inlet", PosX=0, PosY=0.45, Protected=true);
81
82SET
83
84        Mw = PP.MolecularWeight();
85
86        Rgas    = 8.31451*'kJ/kmol/K';
87
88EQUATIONS
89
90"Overall Molar Balance"
91        Outlet.F = Inlet.F;
92
93"Component Molar Balance"
94        Outlet.z = Inlet.z;
95
96"Average Molecular Weight"
97        Mwm = sum(Mw*Inlet.z);
98
99"Pressure Ratio"
100        Outlet.P = Inlet.P * Pratio;
101
102"Pressure Drop"
103        Outlet.P  = Inlet.P - Pdrop;
104
105"Pressure Increase"
106        Outlet.P  = Inlet.P + Pincrease;
107
108"Mass Density at inlet conditions"
109        rho_in = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
110
111"Mass Density at outlet conditions"
112        rho_out= PP.VapourDensity(Outlet.T, Outlet.P, Outlet.z);
113
114"Mass Density at isentropic conditions"
115        rho_ise= PP.VapourDensity(Tisentropic, Outlet.P, Outlet.z);
116
117"Enthalpy at isentropic conditions"
118        hise = PP.VapourEnthalpy(Tisentropic, Outlet.P, Outlet.z);
119       
120"Compressibility factor at Inlet Conditions"
121        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
122
123"Compressibility factor at Outlet Conditions"
124        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
125
126"Isentropic Efficiency"
127        IsentropicEff*(Outlet.h-Inlet.h) = (hise-Inlet.h);
128
129"Actual Head"
130        Head*Mwm = (Outlet.h-Inlet.h);
131
132"Isentropic Outlet Temperature"
133        PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
134
135"Brake Power"
136        BrakePower = -WorkIn;
137
138"Brake Power"
139        BrakePower*MechanicalEff = FluidPower;
140
141"Power Loss"
142        PowerLoss = BrakePower - FluidPower;
143
144"Polytropic-Isentropic Relation"
145        PolytropicEff*HeadIsentropic = HeadPolytropic*IsentropicEff;
146
147"Fluid Power"
148        FluidPower = Head*Mwm*Inlet.F;
149
150switch CompressorType
151
152        case "Isentropic With GPSA Method":
153
154"Efficiency"
155        EfficiencyOperation = IsentropicEff;
156
157"Polytropic Efficiency"
158        PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1);
159
160"Isentropic Coefficient"
161        HeadIsentropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
162
163"Polytropic Coefficient"
164        HeadPolytropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1.001))*Rgas*Inlet.T*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
165
166"Head Correction"
167        HeadCorrection =1;
168
169"Isentropic Head"
170        HeadIsentropic = Head*IsentropicEff;
171       
172        case "Polytropic With GPSA Method":
173
174"Efficiency"
175        EfficiencyOperation = PolytropicEff;
176
177"Polytropic Efficiency"
178        PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1);
179
180"Isentropic Coefficient"
181        HeadIsentropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
182
183"Polytropic Coefficient"
184        HeadPolytropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1.001))*Rgas*Inlet.T*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
185
186"Head Correction"
187        HeadCorrection =1;
188
189"Isentropic Head"
190        HeadIsentropic = Head*IsentropicEff;
191       
192        case "Isentropic With ASME Method":
193
194"Efficiency"
195        EfficiencyOperation = IsentropicEff;
196
197"Isentropic Coefficient"
198        IseCoeff*ln(rho_ise/rho_in) = ln(Outlet.P/Inlet.P);
199
200"Polytropic Coefficient"
201        PolyCoeff*ln(rho_out/rho_in) = ln(Outlet.P/Inlet.P);
202
203"Isentropic Head"
204        HeadIsentropic*rho_in = (IseCoeff/(IseCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
205
206"Polytropic Head"
207        HeadPolytropic*rho_in = (PolyCoeff/(PolyCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
208
209"Schultz Polytropic Head Correction"
210        HeadCorrection*Mwm*(IseCoeff/(IseCoeff-1.001))*(Outlet.P/rho_ise -Inlet.P/rho_in) = (hise-Inlet.h);
211
212        case "Polytropic With ASME Method":
213
214"Efficiency"
215        EfficiencyOperation = PolytropicEff;
216
217"Isentropic Coefficient"
218        IseCoeff*ln(rho_ise/rho_in) = ln(Outlet.P/Inlet.P);
219
220"Polytropic Coefficient"
221        PolyCoeff*ln(rho_out/rho_in) = ln(Outlet.P/Inlet.P);
222
223"Isentropic Head"
224        HeadIsentropic*rho_in = (IseCoeff/(IseCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
225
226"Polytropic Head"
227        HeadPolytropic*rho_in = (PolyCoeff/(PolyCoeff-1.001))*Inlet.P*HeadCorrection*((Pratio)^((PolyCoeff-1.001)/PolyCoeff) - 1);
228       
229"Schultz Polytropic Head Correction"
230        HeadCorrection*Mwm*(IseCoeff/(IseCoeff-1.001))*(Outlet.P/rho_ise -Inlet.P/rho_in) =  (hise-Inlet.h);
231end
232
233end
Note: See TracBrowser for help on using the repository browser.