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 277 2007-06-16 20:17:45Z paula $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "pressure_changers/flux_machine_basic"; |
---|
21 | |
---|
22 | Model centrifugal_compressor as flux_machine_basic_PH |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = true; |
---|
25 | 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=0); |
---|
48 | Cp as cp_mol (Brief = "Heat Capacity"); |
---|
49 | Cv as cv_mol (Brief = "Heat Capacity"); |
---|
50 | Pdiff as press_delta (Brief = "Pressure Increase", DisplayUnit='kPa'); |
---|
51 | Pratio as positive (Brief = "Pressure Ratio"); |
---|
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 efficiency (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 | |
---|
60 | SET |
---|
61 | Mw = PP.MolecularWeight(); |
---|
62 | |
---|
63 | EQUATIONS |
---|
64 | |
---|
65 | "Calculate Mwm for Inlet Mixture" |
---|
66 | Mwm = sum(Mw*Inlet.z); |
---|
67 | |
---|
68 | "Calculate Outlet Stream Pressure" |
---|
69 | Outlet.P = Inlet.P + Pdiff; |
---|
70 | |
---|
71 | "Pratio Definition" |
---|
72 | Outlet.P = Inlet.P * Pratio; |
---|
73 | |
---|
74 | "Calculate Cp Using a External Physical Properties Routine" |
---|
75 | Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z); |
---|
76 | |
---|
77 | "Calculate Cv Using a External Physical Properties Routine" |
---|
78 | Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z); |
---|
79 | |
---|
80 | "Calculate Isentropic Coeficient" |
---|
81 | k * Cv = Cp; |
---|
82 | |
---|
83 | "Calculate Isentropic Head" |
---|
84 | Ws = (k/(k-1))*R*Inlet.T*((Outlet.P/Inlet.P)^((k-1)/k) - 1); |
---|
85 | |
---|
86 | "Calculate Isentropic Outlet Temperature" |
---|
87 | Tiso = Inlet.T * (Outlet.P/Inlet.P)^((k-1)/k); |
---|
88 | |
---|
89 | "Calculate Real Outlet Temperature" |
---|
90 | Effs * (Outlet.T- Inlet.T) = (Tiso - Inlet.T); |
---|
91 | |
---|
92 | "Calculate Politropic Coefficient" |
---|
93 | n*(ln(Outlet.T/Inlet.T)) = (n-1)*(ln(Outlet.P/Inlet.P)); |
---|
94 | |
---|
95 | "Calculate Politropic Efficiency" |
---|
96 | Effp * (n-1) * k = n * (k-1); |
---|
97 | |
---|
98 | "Calculate Politropic Head" |
---|
99 | Ws*Effp = Wp*Effs; |
---|
100 | |
---|
101 | "Calculate Fluid Power" |
---|
102 | FPower*Effs = Inlet.F*Ws; |
---|
103 | |
---|
104 | "Molar Balance" |
---|
105 | Outlet.F = Inlet.F; |
---|
106 | |
---|
107 | Outlet.z = Inlet.z; |
---|
108 | end |
---|