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 |
---|
17 | * $Id: compressor.mso 598 2008-08-15 04:54:51Z bicca $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "streams"; |
---|
21 | |
---|
22 | Model centrifugal_compressor |
---|
23 | |
---|
24 | ATTRIBUTES |
---|
25 | Pallete = true; |
---|
26 | Icon = "icon/CentrifugalCompressor"; |
---|
27 | Brief = "Testing Model of a centrifugal compressor."; |
---|
28 | |
---|
29 | |
---|
30 | PARAMETERS |
---|
31 | |
---|
32 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
33 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
34 | Rgas as positive (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true); |
---|
35 | Mw(NComp) as molweight (Brief = "Molar Weight"); |
---|
36 | CompressorType as Switcher (Brief = "Compressor Model Type",Valid=["Polytropic Operation","Isentropic Operation"], Default="Isentropic Operation"); |
---|
37 | |
---|
38 | VARIABLES |
---|
39 | |
---|
40 | PolyCoeff as positive (Brief = "Polytropic Coefficient", Lower=0); |
---|
41 | IseCoeff as positive (Brief = "Isentropic Coefficient", Lower=1e-3); |
---|
42 | Cp as cp_mol (Brief = "Heat Capacity"); |
---|
43 | Cv as cv_mol (Brief = "Heat Capacity"); |
---|
44 | Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); |
---|
45 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); |
---|
46 | |
---|
47 | Head as energy_mass (Brief = "Isentropic Head"); |
---|
48 | Tiso as temperature (Brief = "Isentropic Temperature"); |
---|
49 | |
---|
50 | PolytropicEff as efficiency (Brief = "Polytropic efficiency"); |
---|
51 | IsentropicEff as efficiency (Brief = "Isentropic efficiency"); |
---|
52 | MechanicalEff as efficiency (Brief = "Mechanical efficiency"); |
---|
53 | |
---|
54 | FluidPower as power (Brief = "Fluid Power"); |
---|
55 | Mwm as molweight (Brief = "Mixture Molar Weight"); |
---|
56 | rho as dens_mass (Brief = "Mass Density"); |
---|
57 | Zfac_in as fraction (Brief = "Compressibility factor at inlet"); |
---|
58 | Zfac_out as fraction (Brief = "Compressibility factor at outlet"); |
---|
59 | |
---|
60 | in Inlet as stream (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}"); |
---|
61 | out Outlet as streamPH (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}"); |
---|
62 | |
---|
63 | in WorkIn as power (Brief = "Work Inlet", PosX=0, PosY=0.45); |
---|
64 | |
---|
65 | SET |
---|
66 | |
---|
67 | Mw = PP.MolecularWeight(); |
---|
68 | |
---|
69 | Rgas = 8.31451*'kJ/kmol/K'; |
---|
70 | |
---|
71 | EQUATIONS |
---|
72 | |
---|
73 | "Overall Molar Balance" |
---|
74 | Outlet.F = Inlet.F; |
---|
75 | |
---|
76 | "Component Molar Balance" |
---|
77 | Outlet.z = Inlet.z; |
---|
78 | |
---|
79 | "Average Molecular Weight" |
---|
80 | Mwm = sum(Mw*Inlet.z); |
---|
81 | |
---|
82 | "Pressure Ratio" |
---|
83 | Outlet.P = Inlet.P * Pratio; |
---|
84 | |
---|
85 | "Pressure Drop" |
---|
86 | Outlet.P = Inlet.P - Pdrop; |
---|
87 | |
---|
88 | "Mass Density" |
---|
89 | rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z); |
---|
90 | |
---|
91 | "Heat Capacity at Constant Pressure" |
---|
92 | Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z); |
---|
93 | |
---|
94 | "Heat Capacity at Constant Volume" |
---|
95 | Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z); |
---|
96 | |
---|
97 | "Compressibility factor at Inlet Conditions" |
---|
98 | Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z); |
---|
99 | |
---|
100 | "Compressibility factor at Outlet Conditions" |
---|
101 | Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z); |
---|
102 | |
---|
103 | "Isentropic Coeficient" |
---|
104 | IseCoeff * Cv = Cp; |
---|
105 | |
---|
106 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
107 | switch CompressorType |
---|
108 | |
---|
109 | case "Isentropic Operation": |
---|
110 | |
---|
111 | "Isentropic Head" |
---|
112 | Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1)/IseCoeff) - 1); |
---|
113 | |
---|
114 | "Fluid Power" |
---|
115 | FluidPower*IsentropicEff = Head*sum(Mw*Inlet.z)*Inlet.F; |
---|
116 | |
---|
117 | case "Polytropic Operation": |
---|
118 | |
---|
119 | "Polytropic Head" |
---|
120 | Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1)/PolyCoeff) - 1); |
---|
121 | |
---|
122 | "Fluid Power" |
---|
123 | FluidPower*PolytropicEff = Head*sum(Mw*Inlet.z)*Inlet.F; |
---|
124 | |
---|
125 | end |
---|
126 | |
---|
127 | "Isentropic Outlet Temperature"#Mollier Method ? |
---|
128 | PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); |
---|
129 | |
---|
130 | "Discharge Temperature" |
---|
131 | IsentropicEff * (Outlet.T- Inlet.T) = (Tiso - Inlet.T); |
---|
132 | |
---|
133 | "Calculate Politropic Coefficient" |
---|
134 | PolyCoeff*(ln(Outlet.T/Inlet.T)) = (PolyCoeff-1)*(ln(Outlet.P/Inlet.P)); |
---|
135 | |
---|
136 | #"Polytropic Efficiency" |
---|
137 | #PolytropicEff * (PolyCoeff-1) * IseCoeff = PolyCoeff * (IseCoeff-1); |
---|
138 | |
---|
139 | "Fluid Power" |
---|
140 | FluidPower = -WorkIn; |
---|
141 | |
---|
142 | end |
---|