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: Maurício Carvalho Maciel, Paula B. Staudt, Rafael P. Soares |
---|
17 | * $Id: splitter.mso 838 2009-08-26 00:15:37Z bicca $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | |
---|
21 | using "streams"; |
---|
22 | |
---|
23 | Model splitter_n |
---|
24 | ATTRIBUTES |
---|
25 | Pallete = false; |
---|
26 | Icon = "icon/splitter_n"; |
---|
27 | Brief = "Model of a splitter (NOT Handled by the GUI)"; |
---|
28 | Info = |
---|
29 | "== Assumptions == |
---|
30 | * thermodynamics equilibrium |
---|
31 | * adiabatic |
---|
32 | |
---|
33 | == Specify == |
---|
34 | * the inlet stream |
---|
35 | * (Noutlet - 1) fraction of split of the outlet streams: |
---|
36 | |
---|
37 | frac(i) = (Mole Flow of the outlet stream i / |
---|
38 | Mole Flow of the inlet stream) |
---|
39 | where i = 1, 2,...,Noutlet |
---|
40 | "; |
---|
41 | |
---|
42 | PARAMETERS |
---|
43 | NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); |
---|
44 | |
---|
45 | VARIABLES |
---|
46 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{in}"); |
---|
47 | out Outlet(NOutlet) as stream (Brief = "Outlet streams", PosX=1, PosY=0.5, Symbol="_{out}"); |
---|
48 | frac(NOutlet) as fraction (Brief = "Distribution of Outlets", Default=0.5, Symbol="\phi"); |
---|
49 | |
---|
50 | EQUATIONS |
---|
51 | |
---|
52 | sum(frac) = 1; |
---|
53 | |
---|
54 | for i in [1:NOutlet] do |
---|
55 | |
---|
56 | "Flow" |
---|
57 | Outlet(i).F = Inlet.F*frac(i); |
---|
58 | |
---|
59 | "Composition" |
---|
60 | Outlet(i).z = Inlet.z; |
---|
61 | |
---|
62 | "Pressure" |
---|
63 | Outlet(i).P = Inlet.P; |
---|
64 | |
---|
65 | "Enthalpy" |
---|
66 | Outlet(i).h = Inlet.h; |
---|
67 | |
---|
68 | "Temperature" |
---|
69 | Outlet(i).T = Inlet.T; |
---|
70 | |
---|
71 | "Vapourisation Fraction" |
---|
72 | Outlet(i).v = Inlet.v; |
---|
73 | end |
---|
74 | |
---|
75 | end |
---|
76 | |
---|
77 | Model splitter2 |
---|
78 | ATTRIBUTES |
---|
79 | Pallete = true; |
---|
80 | Icon = "icon/splitter_column"; |
---|
81 | Brief = "Splitter with 2 outlet streams"; |
---|
82 | Info = |
---|
83 | "== Assumptions == |
---|
84 | *Thermodynamics equilibrium |
---|
85 | *Adiabatic |
---|
86 | |
---|
87 | == Specify == |
---|
88 | * The inlet stream |
---|
89 | * One FlowRatios of split of the outlet streams: |
---|
90 | |
---|
91 | FlowRatios(i) = (Mole Flow of the outlet stream i / |
---|
92 | Mole Flow of the inlet stream) |
---|
93 | where i = 1, 2 |
---|
94 | "; |
---|
95 | |
---|
96 | VARIABLES |
---|
97 | in Inlet as stream (Brief = "Inlet stream", PosX=0.5, PosY=0, Symbol="_{in}"); |
---|
98 | out Outlet1 as stream (Brief = "Outlet stream 1", PosX=0.25, PosY=1, Symbol="_{out1}"); |
---|
99 | out Outlet2 as stream (Brief = "Outlet stream 2", PosX=0.75, PosY=1, Symbol="_{out2}"); |
---|
100 | FlowRatios(2) as fraction (Brief = "Distribution of Outlets", Default=0.33, Symbol="\phi"); |
---|
101 | |
---|
102 | EQUATIONS |
---|
103 | |
---|
104 | "Normalize Flow Ratios" |
---|
105 | sum(FlowRatios) = 1; |
---|
106 | |
---|
107 | "Flow" |
---|
108 | Outlet1.F = Inlet.F * FlowRatios(1); |
---|
109 | Outlet1.F + Outlet2.F = Inlet.F; |
---|
110 | |
---|
111 | "Composition" |
---|
112 | Outlet1.z = Inlet.z; |
---|
113 | Outlet2.z = Inlet.z; |
---|
114 | |
---|
115 | "Pressure" |
---|
116 | Outlet1.P = Inlet.P; |
---|
117 | Outlet2.P = Inlet.P; |
---|
118 | |
---|
119 | "Enthalpy" |
---|
120 | Outlet1.h = Inlet.h; |
---|
121 | Outlet2.h = Inlet.h; |
---|
122 | |
---|
123 | "Temperature" |
---|
124 | Outlet1.T = Inlet.T; |
---|
125 | Outlet2.T = Inlet.T; |
---|
126 | |
---|
127 | "Vapourisation Fraction" |
---|
128 | Outlet1.v = Inlet.v; |
---|
129 | Outlet2.v = Inlet.v; |
---|
130 | |
---|
131 | end |
---|
132 | |
---|
133 | Model splitter3 |
---|
134 | ATTRIBUTES |
---|
135 | Pallete = true; |
---|
136 | Icon = "icon/splitter"; |
---|
137 | Brief = "Model of a splitter with 3 outlet streams"; |
---|
138 | Info = |
---|
139 | "== Assumptions == |
---|
140 | * Thermodynamics equilibrium |
---|
141 | * Adiabatic |
---|
142 | |
---|
143 | == Specify == |
---|
144 | *The inlet stream |
---|
145 | *Two FlowRatios of split of the outlet streams: |
---|
146 | |
---|
147 | FlowRatios(i) = (Mole Flow of the outlet stream i / |
---|
148 | Mole Flow of the inlet stream) |
---|
149 | where i = 1, 2, 3 |
---|
150 | "; |
---|
151 | |
---|
152 | VARIABLES |
---|
153 | |
---|
154 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{in}"); |
---|
155 | out Outlet1 as stream (Brief = "Outlet stream 1", PosX=1, PosY=0.25, Symbol="_{Out1}"); |
---|
156 | out Outlet2 as stream (Brief = "Outlet stream 2", PosX=1, PosY=0.5059, Symbol="_{Out2}"); |
---|
157 | out Outlet3 as stream (Brief = "Outlet stream 3", PosX=1, PosY=0.75, Symbol="_{Out3}"); |
---|
158 | |
---|
159 | FlowRatios(3) as fraction (Brief = "Distribution of Outlets", Default=0.33, Symbol="\phi"); |
---|
160 | |
---|
161 | EQUATIONS |
---|
162 | |
---|
163 | "Normalize Flow Ratios" |
---|
164 | sum(FlowRatios) = 1; |
---|
165 | |
---|
166 | "Outlet1 Flow" |
---|
167 | Outlet1.F = Inlet.F*FlowRatios(1); |
---|
168 | |
---|
169 | "Outlet2 Flow" |
---|
170 | Outlet2.F = Inlet.F*FlowRatios(2); |
---|
171 | |
---|
172 | "Outlet3 Flow" |
---|
173 | Outlet3.F = Inlet.F*FlowRatios(3); |
---|
174 | |
---|
175 | "Outlet1 Composition" |
---|
176 | Outlet1.z = Inlet.z; |
---|
177 | |
---|
178 | "Outlet2 Composition" |
---|
179 | Outlet2.z = Inlet.z; |
---|
180 | |
---|
181 | "Outlet3 Composition" |
---|
182 | Outlet3.z = Inlet.z; |
---|
183 | |
---|
184 | "Outlet1 Pressure" |
---|
185 | Outlet1.P = Inlet.P; |
---|
186 | |
---|
187 | "Outlet2 Pressure" |
---|
188 | Outlet2.P = Inlet.P; |
---|
189 | |
---|
190 | "Outlet3 Pressure" |
---|
191 | Outlet3.P = Inlet.P; |
---|
192 | |
---|
193 | "Outlet1 Enthalpy" |
---|
194 | Outlet1.h = Inlet.h; |
---|
195 | |
---|
196 | "Outlet2 Enthalpy" |
---|
197 | Outlet2.h = Inlet.h; |
---|
198 | |
---|
199 | "Outlet3 Enthalpy" |
---|
200 | Outlet3.h = Inlet.h; |
---|
201 | |
---|
202 | "Outlet1 Temperature" |
---|
203 | Outlet1.T = Inlet.T; |
---|
204 | |
---|
205 | "Outlet2 Temperature" |
---|
206 | Outlet2.T = Inlet.T; |
---|
207 | |
---|
208 | "Outlet3 Temperature" |
---|
209 | Outlet3.T = Inlet.T; |
---|
210 | |
---|
211 | "Outlet1 Vapourisation Fraction" |
---|
212 | Outlet1.v = Inlet.v; |
---|
213 | |
---|
214 | "Outlet2 Vapourisation Fraction" |
---|
215 | Outlet2.v = Inlet.v; |
---|
216 | |
---|
217 | "Outlet3 Vapourisation Fraction" |
---|
218 | Outlet3.v = Inlet.v; |
---|
219 | |
---|
220 | end |
---|
221 | |
---|
222 | Model splitter_column |
---|
223 | |
---|
224 | ATTRIBUTES |
---|
225 | Pallete = true; |
---|
226 | Icon = "icon/splitter_column"; |
---|
227 | Brief = "Splitter with 2 outlet streams to be used with column section model"; |
---|
228 | Info = |
---|
229 | "== Assumptions == |
---|
230 | *Thermodynamics equilibrium |
---|
231 | *Adiabatic |
---|
232 | |
---|
233 | == Specify == |
---|
234 | * The inlet stream |
---|
235 | * One Split Flow of the outlet stream: |
---|
236 | **SplitFlow_RefluxStream: split of the outlet Reflux stream |
---|
237 | **SplitFlow_DistillateStream: split of the outlet Distillate stream |
---|
238 | |
---|
239 | OR |
---|
240 | |
---|
241 | * The inlet stream and the RefluxRatio |
---|
242 | "; |
---|
243 | |
---|
244 | VARIABLES |
---|
245 | in Inlet as stream (Brief = "Inlet stream", PosX=0.5, PosY=0, Symbol="_{in}"); |
---|
246 | out Reflux as stream (Brief = "Reflux stream", PosX=0.25, PosY=1, Symbol="_{reflux}"); |
---|
247 | out Distillate as stream (Brief = "Distillate stream", PosX=0.75, PosY=1, Symbol="_{distillate}"); |
---|
248 | |
---|
249 | SplitFlow_RefluxStream as fraction (Brief = "split of the outlet Reflux stream", Default=0.33); |
---|
250 | SplitFlow_DistillateStream as fraction (Brief = "split of the outlet Distillate stream", Default=0.33); |
---|
251 | RefluxRatio as positive (Brief = "Reflux Ratio", Default=10, Lower = 0.5); |
---|
252 | |
---|
253 | EQUATIONS |
---|
254 | |
---|
255 | "Reflux Ratio" |
---|
256 | #Reflux.F*RefluxRatio = SplitFlow_RefluxStream*(Reflux.F*RefluxRatio + Reflux.F); |
---|
257 | SplitFlow_RefluxStream*(1 + RefluxRatio) = RefluxRatio; |
---|
258 | |
---|
259 | "Normalize Flow Ratios" |
---|
260 | SplitFlow_RefluxStream + SplitFlow_DistillateStream = 1; |
---|
261 | |
---|
262 | "Flow" |
---|
263 | Reflux.F = Inlet.F * SplitFlow_RefluxStream; |
---|
264 | Inlet.F = Reflux.F + Distillate.F; |
---|
265 | |
---|
266 | "Composition" |
---|
267 | Reflux.z = Inlet.z; |
---|
268 | Distillate.z = Inlet.z; |
---|
269 | |
---|
270 | "Pressure" |
---|
271 | Reflux.P = Inlet.P; |
---|
272 | Distillate.P = Inlet.P; |
---|
273 | |
---|
274 | "Enthalpy" |
---|
275 | Reflux.h = Inlet.h; |
---|
276 | Distillate.h = Inlet.h; |
---|
277 | |
---|
278 | "Temperature" |
---|
279 | Reflux.T = Inlet.T; |
---|
280 | Distillate.T = Inlet.T; |
---|
281 | |
---|
282 | "Vapourisation Fraction" |
---|
283 | Reflux.v = Inlet.v; |
---|
284 | Distillate.v = Inlet.v; |
---|
285 | |
---|
286 | end |
---|