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 | * Model of a separator of components |
---|
17 | *-------------------------------------------------------------------- |
---|
18 | * |
---|
19 | * Streams: |
---|
20 | * * a inlet stream |
---|
21 | * * "Noutlet" outlet streams |
---|
22 | * |
---|
23 | * Assumptions: |
---|
24 | * * thermodynamics equilibrium |
---|
25 | * * adiabatic |
---|
26 | * |
---|
27 | * Specify: |
---|
28 | * * the inlet stream |
---|
29 | * * (NComp - 1) molar fractions to (Noutlet - 1) outlet streams |
---|
30 | * * (Noutlet - 1) frac (fraction of split of the outlet streams): |
---|
31 | * |
---|
32 | * frac(i) = (Mole Flow of the outlet stream "i" / |
---|
33 | * Mole Flow of the inlet stream) |
---|
34 | * where i = 1, 2,...,Noutlet |
---|
35 | * or |
---|
36 | * |
---|
37 | * (Noutlet - 1) recovery (Recovery of the component specified in the outlet stream i): |
---|
38 | * |
---|
39 | * recovery(i) = (Mole Flow of the component specified in the Outlet stream i/ |
---|
40 | * Mole Flow of the component specified in the inlet stream) |
---|
41 | * where i = 1, 2,...,Noutlet |
---|
42 | * |
---|
43 | *---------------------------------------------------------------------- |
---|
44 | * Author: Maurício Carvalho Maciel |
---|
45 | * $Id: sepComp.mso 176 2007-03-04 04:56:54Z arge $ |
---|
46 | *--------------------------------------------------------------------*# |
---|
47 | |
---|
48 | |
---|
49 | using "streams"; |
---|
50 | |
---|
51 | |
---|
52 | Model sepComp_n |
---|
53 | |
---|
54 | PARAMETERS |
---|
55 | |
---|
56 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
57 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
58 | NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); |
---|
59 | mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); |
---|
60 | |
---|
61 | VARIABLES |
---|
62 | |
---|
63 | in Inlet as stream; |
---|
64 | out Outlet(NOutlet) as stream; |
---|
65 | |
---|
66 | frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams"); |
---|
67 | recovery(NOutlet) as fraction (Brief = "Recovery of the component specified"); |
---|
68 | |
---|
69 | EQUATIONS |
---|
70 | |
---|
71 | "Flow" |
---|
72 | sum(Outlet.F) = Inlet.F; |
---|
73 | |
---|
74 | |
---|
75 | for i in [1:NOutlet-1] |
---|
76 | |
---|
77 | "Mol fraction normalisation" |
---|
78 | sum(Outlet(i).z) = 1; |
---|
79 | |
---|
80 | end |
---|
81 | |
---|
82 | |
---|
83 | for i in [1:NComp] |
---|
84 | |
---|
85 | "Composition" |
---|
86 | sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); |
---|
87 | |
---|
88 | end |
---|
89 | |
---|
90 | |
---|
91 | for i in [1:NOutlet] |
---|
92 | |
---|
93 | "Flow" |
---|
94 | Outlet(i).F = Inlet.F*frac(i); |
---|
95 | |
---|
96 | "Recovery" |
---|
97 | recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp); |
---|
98 | |
---|
99 | "Pressure" |
---|
100 | Outlet(i).P = Inlet.P; |
---|
101 | |
---|
102 | "Enthalpy" |
---|
103 | Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) + |
---|
104 | Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z); |
---|
105 | |
---|
106 | "Temperature" |
---|
107 | Outlet(i).T = Inlet.T; |
---|
108 | |
---|
109 | "Vapourization Fraction" |
---|
110 | Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z); |
---|
111 | |
---|
112 | end |
---|
113 | |
---|
114 | end |
---|
115 | |
---|
116 | |
---|
117 | Model sepComp |
---|
118 | |
---|
119 | PARAMETERS |
---|
120 | |
---|
121 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
122 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
123 | mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); |
---|
124 | |
---|
125 | VARIABLES |
---|
126 | |
---|
127 | in Inlet as stream; |
---|
128 | out Outlet1 as stream; |
---|
129 | out Outlet2 as stream; |
---|
130 | |
---|
131 | frac as fraction (Brief = "Fraction to Outlet 1"); |
---|
132 | recovery as fraction (Brief = "Recovery of the component specified"); |
---|
133 | |
---|
134 | EQUATIONS |
---|
135 | |
---|
136 | "Flow" |
---|
137 | Outlet1.F = Inlet.F * frac; |
---|
138 | Outlet1.F + Outlet2.F = Inlet.F; |
---|
139 | |
---|
140 | recovery*Inlet.z(mainComp) = frac*Outlet1.z(mainComp); |
---|
141 | |
---|
142 | sum(Outlet1.z) = 1; |
---|
143 | |
---|
144 | for i in [1:NComp] |
---|
145 | |
---|
146 | "Composition" |
---|
147 | Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i); |
---|
148 | |
---|
149 | end |
---|
150 | |
---|
151 | "Pressure" |
---|
152 | Outlet1.P = Inlet.P; |
---|
153 | Outlet2.P = Inlet.P; |
---|
154 | |
---|
155 | "Enthalpy" |
---|
156 | Outlet1.h = (1-Outlet1.v)*PP.LiquidEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z) + |
---|
157 | Outlet1.v*PP.VapourEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z); |
---|
158 | Outlet2.h = (1-Outlet2.v)*PP.LiquidEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z) + |
---|
159 | Outlet2.v*PP.VapourEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z); |
---|
160 | |
---|
161 | "Temperature" |
---|
162 | Outlet1.T = Inlet.T; |
---|
163 | Outlet2.T = Inlet.T; |
---|
164 | |
---|
165 | "Vapourization Fraction" |
---|
166 | Outlet1.v = PP.VapourFraction(Outlet1.T, Outlet1.P, Outlet1.z); |
---|
167 | Outlet2.v = PP.VapourFraction(Outlet2.T, Outlet2.P, Outlet2.z); |
---|
168 | |
---|
169 | end |
---|
170 | |
---|
171 | |
---|