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 595 2008-08-08 21:55:17Z 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 | R as positive (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true); |
---|
35 | Mw(NComp) as molweight (Brief = "Molar Weight"); |
---|
36 | |
---|
37 | VARIABLES |
---|
38 | |
---|
39 | n as positive (Brief = "Politropic Coefficient", Lower=0); |
---|
40 | k as positive (Brief = "Isentropic Coefficient", Lower=1e-3); |
---|
41 | Cp as cp_mol (Brief = "Heat Capacity"); |
---|
42 | Cv as cv_mol (Brief = "Heat Capacity"); |
---|
43 | Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); |
---|
44 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); |
---|
45 | Wp as energy_mol (Brief = "Politropic Head"); |
---|
46 | Ws as energy_mol (Brief = "Isentropic Head"); |
---|
47 | Tiso as temperature (Brief = "Isentropic Temperature"); |
---|
48 | Effp as positive (Brief = "Politropic efficiency"); |
---|
49 | Effs as efficiency (Brief = "Isentropic efficiency"); |
---|
50 | FPower as power (Brief = "Fluid Power"); |
---|
51 | Mwm as molweight (Brief = "Mixture Molar Weight"); |
---|
52 | |
---|
53 | in Inlet as stream (Brief = "Inlet stream", PosX=0.35, PosY=0, Symbol="_{in}"); |
---|
54 | out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.85, Symbol="_{out}"); |
---|
55 | |
---|
56 | in WorkIn as power (Brief = "Work Inlet", PosX=0, PosY=0.55); |
---|
57 | |
---|
58 | SET |
---|
59 | |
---|
60 | Mw = PP.MolecularWeight(); |
---|
61 | |
---|
62 | R = 8.31451*'kJ/kmol/K'; |
---|
63 | |
---|
64 | EQUATIONS |
---|
65 | |
---|
66 | "Calculate Mwm for Inlet Mixture" |
---|
67 | Mwm = sum(Mw*Inlet.z); |
---|
68 | |
---|
69 | "Pressure Ratio" |
---|
70 | Outlet.P = Inlet.P * Pratio; |
---|
71 | |
---|
72 | "Pressure Drop" |
---|
73 | Outlet.P = Inlet.P - Pdrop; |
---|
74 | |
---|
75 | "Calculate Cp Using a External Physical Properties Routine" |
---|
76 | Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z); |
---|
77 | |
---|
78 | "Calculate Cv Using a External Physical Properties Routine" |
---|
79 | Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z); |
---|
80 | |
---|
81 | "Calculate Isentropic Coeficient" |
---|
82 | k * Cv = Cp; |
---|
83 | |
---|
84 | "Calculate Isentropic Head" |
---|
85 | Ws = (k/(k-1))*R*Inlet.T*((Outlet.P/Inlet.P)^((k-1)/k) - 1); |
---|
86 | |
---|
87 | "Calculate Isentropic Outlet Temperature" |
---|
88 | # Tiso = Inlet.T * (Outlet.P/Inlet.P)^((k-1)/k); |
---|
89 | PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); |
---|
90 | |
---|
91 | "Calculate Real Outlet Temperature" |
---|
92 | Effs * (Outlet.T- Inlet.T) = (Tiso - Inlet.T); |
---|
93 | |
---|
94 | "Calculate Politropic Coefficient" |
---|
95 | n*(ln(Outlet.T/Inlet.T)) = (n-1)*(ln(Outlet.P/Inlet.P)); |
---|
96 | |
---|
97 | "Calculate Politropic Efficiency" |
---|
98 | Effp * (n-1) * k = n * (k-1); |
---|
99 | |
---|
100 | "Calculate Politropic Head" |
---|
101 | Ws*Effp = Wp*Effs; |
---|
102 | |
---|
103 | "Overall Molar Balance" |
---|
104 | Outlet.F = Inlet.F; |
---|
105 | |
---|
106 | "Component Molar Balance" |
---|
107 | Outlet.z = Inlet.z; |
---|
108 | |
---|
109 | # Testing Equations |
---|
110 | |
---|
111 | "Fluid Power" |
---|
112 | FPower*Effs = Inlet.F*Ws; |
---|
113 | |
---|
114 | "Fluid Power" |
---|
115 | FPower = WorkIn; |
---|
116 | |
---|
117 | end |
---|