1 | #*------------------------------------------------------------------- |
---|
2 | * Models of Column Section with Tray Efficiency Prediction |
---|
3 | * Author: Josias J. Junges |
---|
4 | *-------------------------------------------------------------------*# |
---|
5 | |
---|
6 | using "tray_Eff"; |
---|
7 | using "reboiler"; |
---|
8 | using "condenser"; |
---|
9 | using "mixers_splitters/splitter"; |
---|
10 | using "pressure_changers/pump"; |
---|
11 | |
---|
12 | Model Section_Column_EffEmp |
---|
13 | ATTRIBUTES |
---|
14 | Pallete = true; |
---|
15 | Icon = "icon/SectionColumn"; |
---|
16 | Brief = "Model of a column section - Tray Efficiency Prediction"; |
---|
17 | Info = |
---|
18 | "== Model of a column section containing == |
---|
19 | * NTrays trays. |
---|
20 | |
---|
21 | == Specify == |
---|
22 | * the feed stream of each tray (Inlet); |
---|
23 | |
---|
24 | * the InletLiquid stream of the top tray; |
---|
25 | * the InletVapour stream of the bottom tray. |
---|
26 | |
---|
27 | == Initial Conditions == |
---|
28 | * the trays temperature (OutletLiquid.T); |
---|
29 | * the trays liquid level (Level) OR the trays liquid flow (OutletLiquid.F); |
---|
30 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray. |
---|
31 | "; |
---|
32 | |
---|
33 | PARAMETERS |
---|
34 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
35 | outer NComp as Integer; |
---|
36 | NTrays as Integer(Brief="Number of trays", Default=2); |
---|
37 | topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); |
---|
38 | top as Integer(Brief="Number of top tray"); |
---|
39 | bot as Integer(Brief="Number of bottom tray"); |
---|
40 | xas as Integer(Brief="Adjacent above stage vapour composition"); |
---|
41 | |
---|
42 | SET |
---|
43 | top = (NTrays-1)*(1-topdown)/2+1; |
---|
44 | bot = NTrays/top; |
---|
45 | |
---|
46 | VARIABLES |
---|
47 | trays(NTrays) as trayEffEmp; |
---|
48 | |
---|
49 | CONNECTIONS |
---|
50 | trays([top+topdown:topdown:bot]).OutletVapour to trays([top:topdown:bot-topdown]).InletVapour; |
---|
51 | trays([top:topdown:bot-topdown]).OutletLiquid to trays([top+topdown:topdown:bot]).InletLiquid; |
---|
52 | |
---|
53 | EQUATIONS |
---|
54 | |
---|
55 | if NComp > 2 then |
---|
56 | |
---|
57 | (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-xas); |
---|
58 | |
---|
59 | for i in [(top+1):NTrays] do |
---|
60 | (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); |
---|
61 | end |
---|
62 | |
---|
63 | else |
---|
64 | |
---|
65 | (trays(top).OutletLiquid.z(1)-trays(top).InletLiquid.z(1))*trays(top).m=(trays(top).OutletVapour.z(1)-xas); |
---|
66 | |
---|
67 | for i in [(top+1):NTrays] do |
---|
68 | (trays(i).OutletLiquid.z(1)-trays(i).InletLiquid.z(1))*trays(i).m=(trays(i).OutletVapour.z(1)-trays(i-1).OutletVapour.z(1)); |
---|
69 | end |
---|
70 | end |
---|
71 | |
---|
72 | end |
---|
73 | |
---|
74 | Model Section_Column_EffFund |
---|
75 | ATTRIBUTES |
---|
76 | Pallete = true; |
---|
77 | Icon = "icon/SectionColumn"; |
---|
78 | Brief = "Model of a column section - Tray Efficiency Prediction"; |
---|
79 | Info = |
---|
80 | "== Model of a column section containing == |
---|
81 | * NTrays trays. |
---|
82 | |
---|
83 | == Specify == |
---|
84 | * the feed stream of each tray (Inlet); |
---|
85 | |
---|
86 | * the InletLiquid stream of the top tray; |
---|
87 | * the InletVapour stream of the bottom tray. |
---|
88 | |
---|
89 | == Initial Conditions == |
---|
90 | * the trays temperature (OutletLiquid.T); |
---|
91 | * the trays liquid level (Level) OR the trays liquid flow (OutletLiquid.F); |
---|
92 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray. |
---|
93 | "; |
---|
94 | |
---|
95 | PARAMETERS |
---|
96 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
97 | outer NComp as Integer; |
---|
98 | NTrays as Integer(Brief="Number of trays", Default=2); |
---|
99 | topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); |
---|
100 | top as Integer(Brief="Number of top tray"); |
---|
101 | bot as Integer(Brief="Number of bottom tray"); |
---|
102 | xas as Real(Brief="Adjacent above stage vapour composition"); |
---|
103 | |
---|
104 | SET |
---|
105 | top = (NTrays-1)*(1-topdown)/2+1; |
---|
106 | bot = NTrays/top; |
---|
107 | |
---|
108 | VARIABLES |
---|
109 | trays(NTrays) as trayEffFund; |
---|
110 | |
---|
111 | CONNECTIONS |
---|
112 | trays([top+topdown:topdown:bot]).OutletVapour to trays([top:topdown:bot-topdown]).InletVapour; |
---|
113 | trays([top:topdown:bot-topdown]).OutletLiquid to trays([top+topdown:topdown:bot]).InletLiquid; |
---|
114 | |
---|
115 | EQUATIONS |
---|
116 | |
---|
117 | if NComp > 2 then |
---|
118 | |
---|
119 | (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-xas); |
---|
120 | |
---|
121 | for i in [(top+1):NTrays] do |
---|
122 | (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); |
---|
123 | end |
---|
124 | |
---|
125 | else |
---|
126 | |
---|
127 | (trays(top).OutletLiquid.z(1)-trays(top).InletLiquid.z(1))*trays(top).m=(trays(top).OutletVapour.z(1)-xas); |
---|
128 | |
---|
129 | for i in [(top+1):NTrays] do |
---|
130 | (trays(i).OutletLiquid.z(1)-trays(i).InletLiquid.z(1))*trays(i).m=(trays(i).OutletVapour.z(1)-trays(i-1).OutletVapour.z(1)); |
---|
131 | end |
---|
132 | end |
---|
133 | end |
---|
134 | |
---|
135 | #*---------------------------------------------------------------------- |
---|
136 | * Models of Column with Tray Efficiency Prediction |
---|
137 | * Author: Josias J. Junges |
---|
138 | *---------------------------------------------------------------------*# |
---|
139 | Model Distillation_kettle_cond_EffEmp |
---|
140 | ATTRIBUTES |
---|
141 | Pallete = true; |
---|
142 | Icon = "icon/DistillationKettleCond"; |
---|
143 | Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler-Tray Efficiency Prediction"; |
---|
144 | Info = |
---|
145 | "== Specify == |
---|
146 | * the feed stream of each tray (Inlet); |
---|
147 | |
---|
148 | * the pump pressure difference; |
---|
149 | * the heat supllied in reboiler and condenser; |
---|
150 | * the condenser vapor outlet flow (OutletVapour.F); |
---|
151 | * the reboiler liquid outlet flow (OutletLiquid.F); |
---|
152 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
153 | |
---|
154 | == Initial Conditions == |
---|
155 | * the trays temperature (OutletLiquid.T); |
---|
156 | * the trays liquid level (Level) OR the trays liquid flow (OutletLiquid.F); |
---|
157 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
158 | |
---|
159 | * the condenser temperature (OutletLiquid.T); |
---|
160 | * the condenser liquid level (Level); |
---|
161 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
162 | |
---|
163 | * the reboiler temperature (OutletLiquid.T); |
---|
164 | * the reboiler liquid level (Level); |
---|
165 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
166 | "; |
---|
167 | |
---|
168 | PARAMETERS |
---|
169 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
170 | outer NComp as Integer; |
---|
171 | NTrays as Integer(Brief="Number of trays", Default=2); |
---|
172 | topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); |
---|
173 | top as Integer(Brief="Number of top tray"); |
---|
174 | bot as Integer(Brief="Number of bottom tray"); |
---|
175 | VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); |
---|
176 | outer iLK as Integer (Brief="Pseudo-binary ligth key index"); |
---|
177 | outer iHK as Integer (Brief="Pseudo-binary heavy key index"); |
---|
178 | |
---|
179 | SET |
---|
180 | top = (NTrays-1)*(1-topdown)/2+1; |
---|
181 | bot = NTrays/top; |
---|
182 | |
---|
183 | VARIABLES |
---|
184 | trays(NTrays) as trayEffEmp; |
---|
185 | cond as condenser; |
---|
186 | reb as reboiler; |
---|
187 | sptop as splitter_column; |
---|
188 | pump1 as pump; |
---|
189 | alfaTopo as Real; |
---|
190 | condVoutLk as positive (Brief="Pseudo-binary approach"); |
---|
191 | |
---|
192 | EQUATIONS |
---|
193 | switch VapourFlow |
---|
194 | case "on": |
---|
195 | cond.InletVapour.F*trays(top).vV = alfaTopo * trays(top).HolesArea_ * sqrt(2*(trays(top).OutletVapour.P - |
---|
196 | cond.OutletLiquid.P + 1e-8 * 'atm') / (trays(top).DryPdropCoeff_*trays(top).rhoV)); |
---|
197 | when cond.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
198 | |
---|
199 | case "off": |
---|
200 | cond.InletVapour.F = 0 * 'mol/s'; |
---|
201 | when trays(top).OutletVapour.P > cond.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
202 | end |
---|
203 | |
---|
204 | "Condenser pseudo-binary approach" |
---|
205 | condVoutLk=cond.OutletVapour.z(iLK)/(cond.OutletVapour.z(iLK)+cond.OutletVapour.z(iHK)); |
---|
206 | |
---|
207 | CONNECTIONS |
---|
208 | #vapor |
---|
209 | reb.OutletVapour to trays(bot).InletVapour; |
---|
210 | trays([top+topdown:topdown:bot]).OutletVapour to trays([top:topdown:bot-topdown]).InletVapour; |
---|
211 | trays(top).OutletVapour to cond.InletVapour; |
---|
212 | |
---|
213 | #liquid |
---|
214 | cond.OutletLiquid to sptop.Inlet; |
---|
215 | sptop.Outlet2 to pump1.Inlet; |
---|
216 | pump1.Outlet to trays(top).InletLiquid; |
---|
217 | trays([top:topdown:bot-topdown]).OutletLiquid to trays([top+topdown:topdown:bot]).InletLiquid; |
---|
218 | trays(bot).OutletLiquid to reb.InletLiquid; |
---|
219 | |
---|
220 | EQUATIONS |
---|
221 | |
---|
222 | if NComp > 2 then |
---|
223 | |
---|
224 | (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-condVoutLk); |
---|
225 | |
---|
226 | for i in [(top+1):NTrays] do |
---|
227 | (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); |
---|
228 | end |
---|
229 | |
---|
230 | else |
---|
231 | |
---|
232 | (trays(top).OutletLiquid.z(1)-trays(top).InletLiquid.z(1))*trays(top).m=(trays(top).OutletVapour.z(1)-cond.OutletVapour.z(1)); |
---|
233 | |
---|
234 | for i in [(top+1):NTrays] do |
---|
235 | (trays(i).OutletLiquid.z(1)-trays(i).InletLiquid.z(1))*trays(i).m=(trays(i).OutletVapour.z(1)-trays(i-1).OutletVapour.z(1)); |
---|
236 | end |
---|
237 | end |
---|
238 | end |
---|
239 | |
---|
240 | Model Distillation_kettle_cond_EffFund |
---|
241 | ATTRIBUTES |
---|
242 | Pallete = true; |
---|
243 | Icon = "icon/DistillationKettleCond"; |
---|
244 | Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler-Tray Efficiency Prediction"; |
---|
245 | Info = |
---|
246 | "== Specify == |
---|
247 | * the feed stream of each tray (Inlet); |
---|
248 | |
---|
249 | * the pump pressure difference; |
---|
250 | * the heat supllied in reboiler and condenser; |
---|
251 | * the condenser vapor outlet flow (OutletVapour.F); |
---|
252 | * the reboiler liquid outlet flow (OutletLiquid.F); |
---|
253 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
254 | |
---|
255 | == Initial Conditions == |
---|
256 | * the trays temperature (OutletLiquid.T); |
---|
257 | * the trays liquid level (Level) OR the trays liquid flow (OutletLiquid.F); |
---|
258 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
259 | |
---|
260 | * the condenser temperature (OutletLiquid.T); |
---|
261 | * the condenser liquid level (Level); |
---|
262 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
263 | |
---|
264 | * the reboiler temperature (OutletLiquid.T); |
---|
265 | * the reboiler liquid level (Level); |
---|
266 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
267 | "; |
---|
268 | |
---|
269 | PARAMETERS |
---|
270 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
271 | outer NComp as Integer; |
---|
272 | NTrays as Integer(Brief="Number of trays", Default=2); |
---|
273 | topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); |
---|
274 | top as Integer(Brief="Number of top tray"); |
---|
275 | bot as Integer(Brief="Number of bottom tray"); |
---|
276 | VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); |
---|
277 | outer iLK as Integer (Brief="Pseudo-binary ligth key index"); |
---|
278 | outer iHK as Integer (Brief="Pseudo-binary heavy key index"); |
---|
279 | |
---|
280 | SET |
---|
281 | top = (NTrays-1)*(1-topdown)/2+1; |
---|
282 | bot = NTrays/top; |
---|
283 | |
---|
284 | VARIABLES |
---|
285 | trays(NTrays) as trayEffFund; |
---|
286 | cond as condenser; |
---|
287 | reb as reboiler; |
---|
288 | sptop as splitter_column; |
---|
289 | pump1 as pump; |
---|
290 | alfaTopo as Real; |
---|
291 | condVoutLk as positive (Brief="Pseudo-binary approach"); |
---|
292 | |
---|
293 | EQUATIONS |
---|
294 | switch VapourFlow |
---|
295 | case "on": |
---|
296 | cond.InletVapour.F*trays(top).vV = alfaTopo * trays(top).HolesArea_ * sqrt(2*(trays(top).OutletVapour.P - |
---|
297 | cond.OutletLiquid.P + 1e-8 * 'atm') / (trays(top).DryPdropCoeff_*trays(top).rhoV)); |
---|
298 | when cond.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
299 | |
---|
300 | case "off": |
---|
301 | cond.InletVapour.F = 0 * 'mol/s'; |
---|
302 | when trays(top).OutletVapour.P > cond.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
303 | end |
---|
304 | |
---|
305 | "Condenser pseudo-binary approach" |
---|
306 | condVoutLk=cond.OutletVapour.z(iLK)/(cond.OutletVapour.z(iLK)+cond.OutletVapour.z(iHK)); |
---|
307 | |
---|
308 | CONNECTIONS |
---|
309 | #vapor |
---|
310 | reb.OutletVapour to trays(bot).InletVapour; |
---|
311 | trays([top+topdown:topdown:bot]).OutletVapour to trays([top:topdown:bot-topdown]).InletVapour; |
---|
312 | trays(top).OutletVapour to cond.InletVapour; |
---|
313 | |
---|
314 | #liquid |
---|
315 | cond.OutletLiquid to sptop.Inlet; |
---|
316 | sptop.Outlet2 to pump1.Inlet; |
---|
317 | pump1.Outlet to trays(top).InletLiquid; |
---|
318 | trays([top:topdown:bot-topdown]).OutletLiquid to trays([top+topdown:topdown:bot]).InletLiquid; |
---|
319 | trays(bot).OutletLiquid to reb.InletLiquid; |
---|
320 | |
---|
321 | EQUATIONS |
---|
322 | |
---|
323 | if NComp > 2 then |
---|
324 | |
---|
325 | (trays(top).LoutLk-trays(top).LinLK)*trays(top).m=(trays(top).VoutLk-condVoutLk); |
---|
326 | |
---|
327 | for i in [(top+1):NTrays] do |
---|
328 | (trays(i).LoutLk-trays(i).LinLK)*trays(i).m=(trays(i).VoutLk-trays(i-1).VoutLk); |
---|
329 | end |
---|
330 | |
---|
331 | else |
---|
332 | |
---|
333 | (trays(top).OutletLiquid.z(1)-trays(top).InletLiquid.z(1))*trays(top).m=(trays(top).OutletVapour.z(1)-cond.OutletVapour.z(1)); |
---|
334 | |
---|
335 | for i in [(top+1):NTrays] do |
---|
336 | (trays(i).OutletLiquid.z(1)-trays(i).InletLiquid.z(1))*trays(i).m=(trays(i).OutletVapour.z(1)-trays(i-1).OutletVapour.z(1)); |
---|
337 | end |
---|
338 | end |
---|
339 | end |
---|