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

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

Compressor Model Finished (Missing documentation)

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