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

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

updates

  • Property svn:keywords set to Id
File size: 5.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 606 2008-08-23 20:26:51Z 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        PolyCoeff       as positive             (Brief = "Polytropic Coefficient", Lower=0.2);
42        IseCoeff        as positive     (Brief = "Isentropic Coefficient", Lower=0.2);
43        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
44        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
45        Pincrease       as press_delta  (Brief = "Pressure Increase", DisplayUnit = 'kPa', Symbol ="P_{incr}");
46
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");
51       
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");
56       
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");
64
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}");
67
68in      WorkIn  as power        (Brief = "Work Inlet", PosX=0, PosY=0.45);
69
70SET
71
72        Mw = PP.MolecularWeight();
73
74        Rgas    = 8.31451*'kJ/kmol/K';
75
76EQUATIONS
77
78"Overall Molar Balance"
79        Outlet.F = Inlet.F;
80
81"Component Molar Balance"
82        Outlet.z = Inlet.z;
83
84"Average Molecular Weight"
85        Mwm = sum(Mw*Inlet.z);
86
87"Pressure Ratio"
88        Outlet.P = Inlet.P * Pratio;
89
90"Pressure Drop"
91        Outlet.P  = Inlet.P - Pdrop;
92
93"Pressure Increase"
94        Outlet.P  = Inlet.P + Pincrease;
95
96"Mass Density"
97        rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
98
99"Compressibility factor at Inlet Conditions"
100        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
101
102"Compressibility factor at Outlet Conditions"
103        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
104
105"Isentropic Head"
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);
113
114"Fluid Power"
115        FluidPower = Head*sum(Mw*Inlet.z)*Inlet.F;
116
117"Brake Power"
118        BrakePower = -WorkIn;
119
120"Brake Power"
121        BrakePower = FluidPower/MechanicalEff;
122
123"Power Loss"
124        PowerLoss = BrakePower - FluidPower;
125
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
153end
154
155
156end
Note: See TracBrowser for help on using the repository browser.