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

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

fixed some equations (compressor model)

  • Property svn:keywords set to Id
File size: 5.4 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 608 2008-08-25 05:11:12Z 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       
31PARAMETERS
32
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");
38
39VARIABLES
40
41        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
42        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
43        Pincrease       as press_delta  (Brief = "Pressure Increase", DisplayUnit = 'kPa', Symbol ="P_{incr}");
44
45        Head                    as energy_mass  (Brief = "Actual Head",Hidden=true);
46        HeadIsentropic  as energy_mass  (Brief = "Isentropic Head");
47        HeadPolytropic  as energy_mass  (Brief = "Polytropic Head");
48       
49        EfficiencyOperation     as positive     (Brief = "Compressor efficiency - Polytropic or Isentropic (See Compressor Type)",Lower=1E-3,Upper=1);
50        MechanicalEff                   as positive     (Brief = "Mechanical efficiency",Lower=1E-3,Upper=1);
51       
52        FluidPower      as power        (Brief = "Fluid Power");
53        BrakePower      as power        (Brief = "Brake Power");
54        PowerLoss       as power        (Brief = "Power Losses");
55       
56        PolyCoeff                       as positive             (Brief = "Polytropic Coefficient", Lower=0.2,Protected=true);
57        IseCoeff                        as positive     (Brief = "Isentropic Coefficient", Lower=0.2,Protected=true);
58        PolytropicEff           as positive     (Brief = "Polytropic efficiency",Lower=1E-3,Upper=1,Protected=true);
59        IsentropicEff           as positive     (Brief = "Isentropic efficiency",Lower=1E-3,Upper=1,Protected=true);
60
61        Tisentropic     as temperature          (Brief = "Isentropic Temperature",Protected=true);
62        Mwm                     as molweight            (Brief = "Mixture Molar Weight",Protected=true);
63        rho                     as dens_mass            (Brief = "Mass Density",Protected=true);
64        Zfac_in         as fraction             (Brief = "Compressibility factor at inlet",Protected=true);
65        Zfac_out        as fraction             (Brief = "Compressibility factor at outlet",Protected=true);
66
67in      Inlet   as stream       (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}");
68out     Outlet  as streamPH     (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}");
69
70in      WorkIn  as power        (Brief = "Work Inlet", PosX=0, PosY=0.45);
71
72SET
73
74        Mw = PP.MolecularWeight();
75
76        Rgas    = 8.31451*'kJ/kmol/K';
77
78EQUATIONS
79
80"Overall Molar Balance"
81        Outlet.F = Inlet.F;
82
83"Component Molar Balance"
84        Outlet.z = Inlet.z;
85
86"Average Molecular Weight"
87        Mwm = sum(Mw*Inlet.z);
88
89"Pressure Ratio"
90        Outlet.P = Inlet.P * Pratio;
91
92"Pressure Drop"
93        Outlet.P  = Inlet.P - Pdrop;
94
95"Pressure Increase"
96        Outlet.P  = Inlet.P + Pincrease;
97
98"Mass Density"
99        rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
100
101"Compressibility factor at Inlet Conditions"
102        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
103
104"Compressibility factor at Outlet Conditions"
105        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
106
107"Isentropic Head"
108        HeadIsentropic*Mwm = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h);
109
110"Actual Head"
111        Head*Mwm = (Outlet.h-Inlet.h);
112
113"Isentropic Outlet Temperature"
114        PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
115
116"Brake Power"
117        BrakePower = -WorkIn;
118
119"Brake Power"
120        BrakePower*MechanicalEff = FluidPower;
121
122"Power Loss"
123        PowerLoss = BrakePower - FluidPower;
124
125"Isentropic Efficiency"
126        IsentropicEff*(PP.VapourEnthalpy(Outlet.T,Outlet.P,Outlet.z)-Inlet.h) = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h);
127
128"Polytropic-Isentropic Relation"
129        PolytropicEff*HeadIsentropic = HeadPolytropic*IsentropicEff;
130
131"Polytropic Efficiency"
132        PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1);
133
134"Isentropic Coefficient"
135        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);
136
137"Polytropic Coefficient"
138        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);
139
140"Fluid Power"
141        FluidPower = Head*sum(Mw*Inlet.z)*Inlet.F*EfficiencyOperation+PowerLoss;
142
143switch CompressorType
144
145        case "Isentropic Operation":
146
147"Efficiency"
148        EfficiencyOperation = IsentropicEff;
149       
150        case "Polytropic Operation":
151
152"Efficiency"
153        EfficiencyOperation = PolytropicEff;
154
155end
156
157
158end
Note: See TracBrowser for help on using the repository browser.