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 393 2007-10-17 23:50:09Z arge $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "streams"; |
---|
21 | |
---|
22 | Model centrifugal_compressor |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = true; |
---|
25 | Icon = "icon/CentrifugalCompressor"; |
---|
26 | Brief = "Model of a centrifugal compressor."; |
---|
27 | Info = |
---|
28 | "== Assumptions == |
---|
29 | * Steady State; |
---|
30 | * Only Vapor; |
---|
31 | * Adiabatic. |
---|
32 | |
---|
33 | == Specify == |
---|
34 | * the inlet stream; |
---|
35 | * the outlet pressure (Outlet.P); |
---|
36 | * the Isentropic efficiency (Effs). |
---|
37 | "; |
---|
38 | |
---|
39 | PARAMETERS |
---|
40 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
41 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
42 | R as positive (Default = 8.31451, Brief = "Constant of Gases", Unit= 'kJ/kmol/K'); |
---|
43 | Mw(NComp) as molweight (Brief = "Molar Weight"); |
---|
44 | |
---|
45 | VARIABLES |
---|
46 | n as positive (Brief = "Politropic Coefficient", Lower=0); |
---|
47 | k as positive (Brief = "Isentropic Coefficient", Lower=1e-3); |
---|
48 | Cp as cp_mol (Brief = "Heat Capacity"); |
---|
49 | Cv as cv_mol (Brief = "Heat Capacity"); |
---|
50 | Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); |
---|
51 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); |
---|
52 | Wp as energy_mol (Brief = "Politropic Head"); |
---|
53 | Ws as energy_mol (Brief = "Isentropic Head"); |
---|
54 | Tiso as temperature (Brief = "Isentropic Temperature"); |
---|
55 | Effp as positive (Brief = "Politropic efficiency"); |
---|
56 | Effs as efficiency (Brief = "Isentropic efficiency"); |
---|
57 | FPower as power (Brief = "Fluid Power"); |
---|
58 | Mwm as molweight (Brief = "Mixture Molar Weight"); |
---|
59 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5086, Symbol="_{in}"); |
---|
60 | out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5022, Symbol="_{out}"); |
---|
61 | |
---|
62 | SET |
---|
63 | Mw = PP.MolecularWeight(); |
---|
64 | |
---|
65 | EQUATIONS |
---|
66 | |
---|
67 | "Calculate Mwm for Inlet Mixture" |
---|
68 | Mwm = sum(Mw*Inlet.z); |
---|
69 | |
---|
70 | "Pressure Ratio" |
---|
71 | Outlet.P = Inlet.P * Pratio; |
---|
72 | |
---|
73 | "Pressure Drop" |
---|
74 | Outlet.P = Inlet.P - Pdrop; |
---|
75 | |
---|
76 | "Calculate Cp Using a External Physical Properties Routine" |
---|
77 | Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z); |
---|
78 | |
---|
79 | "Calculate Cv Using a External Physical Properties Routine" |
---|
80 | Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z); |
---|
81 | |
---|
82 | "Calculate Isentropic Coeficient" |
---|
83 | k * Cv = Cp; |
---|
84 | |
---|
85 | "Calculate Isentropic Head" |
---|
86 | Ws = (k/(k-1))*R*Inlet.T*((Outlet.P/Inlet.P)^((k-1)/k) - 1); |
---|
87 | |
---|
88 | "Calculate Isentropic Outlet Temperature" |
---|
89 | # Tiso = Inlet.T * (Outlet.P/Inlet.P)^((k-1)/k); |
---|
90 | PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = |
---|
91 | PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); |
---|
92 | |
---|
93 | "Calculate Real Outlet Temperature" |
---|
94 | Effs * (Outlet.T- Inlet.T) = (Tiso - Inlet.T); |
---|
95 | |
---|
96 | "Calculate Politropic Coefficient" |
---|
97 | n*(ln(Outlet.T/Inlet.T)) = (n-1)*(ln(Outlet.P/Inlet.P)); |
---|
98 | |
---|
99 | "Calculate Politropic Efficiency" |
---|
100 | Effp * (n-1) * k = n * (k-1); |
---|
101 | |
---|
102 | "Calculate Politropic Head" |
---|
103 | Ws*Effp = Wp*Effs; |
---|
104 | |
---|
105 | "Calculate Fluid Power" |
---|
106 | FPower*Effs = Inlet.F*Ws; |
---|
107 | |
---|
108 | "Overall Molar Balance" |
---|
109 | Outlet.F = Inlet.F; |
---|
110 | |
---|
111 | "Component Molar Balance" |
---|
112 | Outlet.z = Inlet.z; |
---|
113 | end |
---|