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 | * File containg user models of columns |
---|
17 | * |
---|
18 | * |
---|
19 | * The default nomenclature is: |
---|
20 | * Type_Column_reboilertype_condensertyper |
---|
21 | * |
---|
22 | * where: |
---|
23 | * Type = refluxed or reboiled or section |
---|
24 | * Column = Stripping, Absorption, Rectifier, Distillation |
---|
25 | * Reboiler type (if exists) = kettle or thermosyphon |
---|
26 | * Condenser type (if exists) = with subccoling or without subcooling |
---|
27 | * |
---|
28 | *----------------------------------------------------------------------- |
---|
29 | * Author: Based on Models written by Paula B. Staudt |
---|
30 | * $Id$ |
---|
31 | *---------------------------------------------------------------------*# |
---|
32 | |
---|
33 | using "UserTray"; |
---|
34 | using "stage_separators/reboiler"; |
---|
35 | using "stage_separators/condenser"; |
---|
36 | using "mixers_splitters/splitter"; |
---|
37 | using "stage_separators/tank"; |
---|
38 | using "pressure_changers/pump"; |
---|
39 | |
---|
40 | # The complete documentation for these models needs to be updated !!! |
---|
41 | |
---|
42 | #*---------------------------------------------------------------------- |
---|
43 | * Model of a basic column section with: |
---|
44 | * - NumberOfTrays=number of trays. |
---|
45 | * |
---|
46 | *---------------------------------------------------------------------*# |
---|
47 | Model User_Section_ColumnBasic |
---|
48 | |
---|
49 | ATTRIBUTES |
---|
50 | Pallete = false; |
---|
51 | Icon = "icon/SectionColumn"; |
---|
52 | Brief = "Model of a column section."; |
---|
53 | Info = |
---|
54 | "== Model of a column section containing == |
---|
55 | * NumberOfTrays trays. |
---|
56 | |
---|
57 | == Specify == |
---|
58 | * the feed stream of each tray (Inlet); |
---|
59 | * the Murphree eficiency for each tray Emv; |
---|
60 | * the InletL stream of the top tray; |
---|
61 | * the InletV stream of the bottom tray. |
---|
62 | |
---|
63 | == Initial Conditions == |
---|
64 | * the trays temperature (OutletL.T); |
---|
65 | * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); |
---|
66 | * (NoComps - 1) OutletL (OR OutletV) compositions for each tray. |
---|
67 | "; |
---|
68 | |
---|
69 | PARAMETERS |
---|
70 | outer PP as Plugin (Brief="External Physical Properties", Type="PP"); |
---|
71 | outer NComp as Integer (Brief="Number of components"); |
---|
72 | NumberOfTrays as Integer (Brief="Number of trays", Default=8); |
---|
73 | FeedTrayIndex(NumberOfTrays) as Integer (Brief="Number of trays", Default=0,Hidden=true); |
---|
74 | LiqSideTrayIndex(NumberOfTrays) as Integer (Brief="Number of trays", Default=0,Hidden=true); |
---|
75 | VapSideTrayIndex(NumberOfTrays) as Integer (Brief="Number of trays", Default=0,Hidden=true); |
---|
76 | FeedTrayLocation as Integer (Brief="Feed tray Location", Default=2); |
---|
77 | LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2); |
---|
78 | VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2); |
---|
79 | g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); |
---|
80 | Mw(NComp) as molweight (Brief="Component Mol Weight",Hidden=true); |
---|
81 | |
---|
82 | VapourFlowModel as Switcher (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer"); |
---|
83 | LiquidFlowModel as Switcher (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default"); |
---|
84 | |
---|
85 | VolumeOfTray as volume (Brief="Total Volume of the tray"); |
---|
86 | HeatSupply as heat_rate (Brief="Rate of heat supply"); |
---|
87 | PlateArea as area (Brief="Plate area = Atray - Adowncomer"); |
---|
88 | |
---|
89 | HolesArea as area (Brief="Total holes area"); |
---|
90 | WeirLength as length (Brief="Weir length"); |
---|
91 | WeirHeight as length (Brief="Weir height"); |
---|
92 | FeeheryCoeff as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1); |
---|
93 | ElgueCoeff as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1); |
---|
94 | OlsenCoeff as Real (Brief="Olsens correlation coefficient", Default=1); |
---|
95 | TrayLiquidPasses as Real (Brief="Number of liquid passes in the tray", Default=1); |
---|
96 | |
---|
97 | TopTemperature as temperature; |
---|
98 | TbottomTemperature as temperature; |
---|
99 | LevelFraction as fraction (Brief = "Level Fraction"); |
---|
100 | |
---|
101 | TopComposition(NComp) as fraction (Brief = "Component Molar Fraction at Top"); |
---|
102 | BottomComposition(NComp) as fraction (Brief = "Component Molar Fraction at Bottom"); |
---|
103 | |
---|
104 | V as volume (Brief="Total Volume of the tray",Hidden=true); |
---|
105 | Q as heat_rate (Brief="Rate of heat supply",Hidden=true); |
---|
106 | Ap as area (Brief="Plate area = Atray - Adowncomer",Hidden=true); |
---|
107 | |
---|
108 | Ah as area (Brief="Total holes area",Hidden=true); |
---|
109 | lw as length (Brief="Weir length",Hidden=true); |
---|
110 | hw as length (Brief="Weir height",Hidden=true); |
---|
111 | beta as fraction (Brief="Aeration fraction"); |
---|
112 | alfa as fraction (Brief="Dry pressure drop coefficient"); |
---|
113 | w as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true); |
---|
114 | btray as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true); |
---|
115 | fw as Real (Brief="Olsens correlation coefficient", Default=1,Hidden=true); |
---|
116 | Np as Real (Brief="Number of liquid passes in the tray", Default=1,Hidden=true); |
---|
117 | |
---|
118 | VapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
119 | LiquidFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
120 | |
---|
121 | SET |
---|
122 | FeedTrayIndex(FeedTrayLocation) =1; |
---|
123 | VapSideTrayIndex(FeedTrayLocation) =1; |
---|
124 | LiqSideTrayIndex(FeedTrayLocation) =1; |
---|
125 | Mw = PP.MolecularWeight(); |
---|
126 | |
---|
127 | V=VolumeOfTray; |
---|
128 | Q=HeatSupply; |
---|
129 | Ap=PlateArea; |
---|
130 | Ah=HolesArea; |
---|
131 | lw=WeirLength; |
---|
132 | hw=WeirHeight ; |
---|
133 | w=FeeheryCoeff; |
---|
134 | btray=ElgueCoeff; |
---|
135 | fw=OlsenCoeff; |
---|
136 | Np=TrayLiquidPasses; |
---|
137 | |
---|
138 | VARIABLES |
---|
139 | |
---|
140 | in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55); |
---|
141 | VapourDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate"); |
---|
142 | LiquidDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate"); |
---|
143 | |
---|
144 | trays(NumberOfTrays) as User_tray (Brief="Number of trays"); |
---|
145 | |
---|
146 | MurphreeEff as Real (Brief = "Murphree efficiency"); |
---|
147 | |
---|
148 | CONNECTIONS |
---|
149 | |
---|
150 | trays([2:NumberOfTrays]).OutletV to trays([1:NumberOfTrays-1]).InletV; |
---|
151 | trays([1:NumberOfTrays-1]).OutletL to trays([2:NumberOfTrays]).InletL; |
---|
152 | |
---|
153 | |
---|
154 | EQUATIONS |
---|
155 | # Connecting Trays |
---|
156 | FeedTray.F*FeedTrayIndex= trays.Inlet.F; |
---|
157 | FeedTray.T = trays.Inlet.T; |
---|
158 | FeedTray.P = trays.Inlet.P; |
---|
159 | FeedTray.z = trays.Inlet.z; |
---|
160 | FeedTray.v = trays.Inlet.v; |
---|
161 | FeedTray.h = trays.Inlet.h; |
---|
162 | |
---|
163 | for i in [1:NumberOfTrays] |
---|
164 | |
---|
165 | "Murphree Efficiency" |
---|
166 | trays(i).OutletV.z = MurphreeEff * (trays(i).yideal - trays(i).InletV.z) + trays(i).InletV.z; |
---|
167 | |
---|
168 | "Level of clear liquid over the weir" |
---|
169 | trays(i).Level = trays(i).ML*trays(i).vL/Ap; |
---|
170 | |
---|
171 | "Geometry Constraint" |
---|
172 | V = trays(i).ML* trays(i).vL + trays(i).MV*trays(i).vV; |
---|
173 | |
---|
174 | "Energy Holdup" |
---|
175 | trays(i).E = trays(i).ML*trays(i).OutletL.h + trays(i).MV*trays(i).OutletV.h - trays(i).OutletL.P*V; |
---|
176 | |
---|
177 | "Energy Balance" |
---|
178 | diff(trays(i).E) = ( trays(i).Inlet.F*trays(i).Inlet.h + trays(i).InletL.F*trays(i).InletL.h + trays(i).InletV.F*trays(i).InletV.h- trays(i).OutletL.F*trays(i).OutletL.h - trays(i).OutletV.F*trays(i).OutletV.h |
---|
179 | -trays(i).VapourSideStream.F*trays(i).VapourSideStream.h - trays(i).LiquidSideStream.F*trays(i).LiquidSideStream.h + Q ); |
---|
180 | |
---|
181 | switch LiquidFlow |
---|
182 | case "on": |
---|
183 | switch LiquidFlowModel |
---|
184 | case "default": |
---|
185 | "Francis Equation" |
---|
186 | trays(i).OutletL.F*trays(i).vL = 1.84*'1/s'*lw*((trays(i).Level-(beta*hw))/(beta))^2; |
---|
187 | |
---|
188 | case "Wang_Fl": |
---|
189 | trays(i).OutletL.F*trays(i).vL = 1.84*'m^0.5/s'*lw*((trays(i).Level-(beta*hw))/(beta))^1.5; |
---|
190 | |
---|
191 | case "Olsen": |
---|
192 | trays(i).OutletL.F / 'mol/s'= lw*Np*trays(i).rhoL/sum(Mw*trays(i).OutletV.z)/(0.665*fw)^1.5 * ((trays(i).ML*sum(Mw*trays(i).OutletL.z)/trays(i).rhoL/Ap)-hw)^1.5 * 'm^0.5/mol'; |
---|
193 | |
---|
194 | case "Feehery_Fl": |
---|
195 | trays(i).OutletL.F = lw*trays(i).rhoL/sum(Mw*trays(i).OutletL.z) * ((trays(i).Level-hw)/750/'mm')^1.5 * 'm^2/s'; |
---|
196 | |
---|
197 | case "Roffel_Fl": |
---|
198 | trays(i).OutletL.F = 2/3*sqrt(2*g)*trays(i).rhoL/sum(Mw*trays(i).OutletL.z)*lw*(2*trays(i).btemp-1)*(trays(i).ML*sum(Mw*trays(i).OutletL.z)/(Ap*1.3)/trays(i).rhoL/(2*trays(i).btemp-1))^1.5; |
---|
199 | end |
---|
200 | when trays(i).Level < (beta *hw) switchto "off"; |
---|
201 | |
---|
202 | case "off": |
---|
203 | "Low level" |
---|
204 | trays(i).OutletL.F = 0 * 'mol/h'; |
---|
205 | when trays(i).Level > (beta * hw) + 1e-6*'m' switchto "on"; |
---|
206 | end |
---|
207 | |
---|
208 | trays(i).btemp = 1 - 0.3593/'Pa^0.0888545'*abs(trays(i).OutletV.F*sum(Mw*trays(i).OutletV.z)/(Ap*1.3)/sqrt(trays(i).rhoV))^0.177709; #/'(kg/m)^0.0888545/s^0.177709'; |
---|
209 | |
---|
210 | switch VapourFlow |
---|
211 | case "on": |
---|
212 | switch VapourFlowModel |
---|
213 | case "Reepmeyer": |
---|
214 | trays(i).InletV.F*trays(i).vV = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/(trays(i).rhoV*alfa))*Ah; |
---|
215 | |
---|
216 | case "Feehery_Fv": |
---|
217 | trays(i).InletV.F = trays(i).rhoV/Ap/w/sum(Mw*trays(i).OutletV.z) * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-(trays(i).rhoV*g*trays(i).ML*trays(i).vL/Ap))/trays(i).rhoV); |
---|
218 | |
---|
219 | case "Roffel_Fv": |
---|
220 | trays(i).InletV.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (trays(i).InletV.P - trays(i).OutletV.P)*1e5 - (beta*sum(trays(i).M*Mw)/(Ap*1.3)*g*1e5) * (trays(i).rhoV*Ah/sum(Mw*trays(i).OutletV.z))^1.08 * 'm^1.08/mol^1.08'; |
---|
221 | |
---|
222 | case "Klingberg": |
---|
223 | trays(i).InletV.F * trays(i).vV = Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV); |
---|
224 | |
---|
225 | case "Wang_Fv": |
---|
226 | trays(i).InletV.F * trays(i).vV = Ap * sqrt(((trays(i).InletV.P - trays(i).OutletV.P)-trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV*alfa); |
---|
227 | |
---|
228 | case "Elgue": |
---|
229 | trays(i).InletV.F = sqrt((trays(i).InletV.P - trays(i).OutletV.P)/btray); |
---|
230 | end |
---|
231 | when trays(i).InletV.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
232 | |
---|
233 | case "off": |
---|
234 | trays(i).InletV.F = 0 * 'mol/s'; |
---|
235 | when trays(i).InletV.P > trays(i).OutletV.P + trays(i).Level*g*trays(i).rhoL + 1e-1 * 'atm' switchto "on"; |
---|
236 | end |
---|
237 | |
---|
238 | end |
---|
239 | |
---|
240 | INITIAL |
---|
241 | |
---|
242 | for i in 1:NumberOfTrays |
---|
243 | |
---|
244 | "The initial temperature of the trays" |
---|
245 | trays(i).OutletL.T = TopTemperature+(TbottomTemperature-TopTemperature)*((i-1)/(NumberOfTrays-1)); |
---|
246 | |
---|
247 | "The initial Level of the trays" |
---|
248 | trays(i).Level = LevelFraction*hw; |
---|
249 | |
---|
250 | end |
---|
251 | |
---|
252 | for i in 1:NComp-1 |
---|
253 | |
---|
254 | for j in 1:NumberOfTrays |
---|
255 | |
---|
256 | "The initial composition of the trays" |
---|
257 | trays(j).OutletL.z(i) = TopComposition(i) +(BottomComposition(i)-TopComposition(i) )*((j-1)/(NumberOfTrays-1)); |
---|
258 | |
---|
259 | end |
---|
260 | |
---|
261 | end |
---|
262 | |
---|
263 | end |
---|
264 | |
---|
265 | Model User_Section_Column as User_Section_ColumnBasic |
---|
266 | |
---|
267 | ATTRIBUTES |
---|
268 | Pallete = true; |
---|
269 | Icon = "icon/SectionColumn"; |
---|
270 | Brief = "Model of a column section."; |
---|
271 | Info = |
---|
272 | "== Model of a column section containing == |
---|
273 | * NumberOfTrays trays. |
---|
274 | |
---|
275 | == Specify == |
---|
276 | * the feed stream of each tray (Inlet); |
---|
277 | * the Murphree eficiency for each tray Emv; |
---|
278 | * the InletL stream of the top tray; |
---|
279 | * the InletV stream of the bottom tray. |
---|
280 | |
---|
281 | == Initial Conditions == |
---|
282 | * the trays temperature (OutletL.T); |
---|
283 | * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); |
---|
284 | * (NoComps - 1) OutletL (OR OutletV) compositions for each tray. |
---|
285 | "; |
---|
286 | |
---|
287 | VARIABLES |
---|
288 | |
---|
289 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.35,Protected = true); |
---|
290 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.65,Protected = true); |
---|
291 | |
---|
292 | in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.80, PosY=0); |
---|
293 | out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0); |
---|
294 | |
---|
295 | in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1); |
---|
296 | out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.80, PosY=1); |
---|
297 | |
---|
298 | LiquidConnector as stream (Brief="Liquid connection at the middle trays", PosX=0.75, PosY=1,Hidden=true); |
---|
299 | VapourConnector as stream (Brief="Vapour connection at the middle trays", PosX=0.55, PosY=0,Hidden=true); |
---|
300 | |
---|
301 | CONNECTIONS |
---|
302 | |
---|
303 | LiquidConnector to trays(1).InletL; |
---|
304 | VapourConnector to trays(NumberOfTrays).InletV; |
---|
305 | |
---|
306 | EQUATIONS |
---|
307 | |
---|
308 | LiquidConnector.F= LiquidInlet.F; |
---|
309 | LiquidConnector.T = LiquidInlet.T; |
---|
310 | LiquidConnector.P = LiquidInlet.P; |
---|
311 | LiquidConnector.z = LiquidInlet.z; |
---|
312 | LiquidConnector.v = LiquidInlet.v; |
---|
313 | LiquidConnector.h = LiquidInlet.h; |
---|
314 | |
---|
315 | VapourConnector.F= VapourInlet.F; |
---|
316 | VapourConnector.T = VapourInlet.T; |
---|
317 | VapourConnector.P = VapourInlet.P; |
---|
318 | VapourConnector.z = VapourInlet.z; |
---|
319 | VapourConnector.v = VapourInlet.v; |
---|
320 | VapourConnector.h = VapourInlet.h; |
---|
321 | |
---|
322 | LiquidOutlet.F= trays(NumberOfTrays).OutletL.F; |
---|
323 | LiquidOutlet.T = trays(NumberOfTrays).OutletL.T; |
---|
324 | LiquidOutlet.P = trays(NumberOfTrays).OutletL.P; |
---|
325 | LiquidOutlet.z = trays(NumberOfTrays).OutletL.z; |
---|
326 | |
---|
327 | VapourOutlet.F= trays(1).OutletV.F; |
---|
328 | VapourOutlet.T = trays(1).OutletV.T; |
---|
329 | VapourOutlet.P = trays(1).OutletV.P; |
---|
330 | VapourOutlet.z = trays(1).OutletV.z; |
---|
331 | |
---|
332 | VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F; |
---|
333 | VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T; |
---|
334 | VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P; |
---|
335 | VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z; |
---|
336 | |
---|
337 | LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F; |
---|
338 | LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
339 | LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
340 | LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
341 | |
---|
342 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
343 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
344 | |
---|
345 | end |
---|
346 | |
---|
347 | #*---------------------------------------------------------------------- |
---|
348 | * Model of a distillation column containing: |
---|
349 | * - NumberOfTrays like tray; |
---|
350 | * - a kettle reboiler; |
---|
351 | * - dynamic condenser; |
---|
352 | * - a splitter which separate reflux and distillate; |
---|
353 | * - a pump in reflux stream; |
---|
354 | *---------------------------------------------------------------------*# |
---|
355 | Model User_Distillation_kettle_cond as User_Section_ColumnBasic |
---|
356 | |
---|
357 | ATTRIBUTES |
---|
358 | Pallete = true; |
---|
359 | Icon = "icon/DistillationKettleCond"; |
---|
360 | Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler."; |
---|
361 | Info = |
---|
362 | "== Specify == |
---|
363 | * the feed stream of each tray (Inlet); |
---|
364 | * the Murphree eficiency for each tray Emv; |
---|
365 | * the pump pressure difference; |
---|
366 | * the heat supllied in reboiler and condenser; |
---|
367 | * the condenser vapor outlet flow (OutletV.F); |
---|
368 | * the reboiler liquid outlet flow (OutletL.F); |
---|
369 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
370 | |
---|
371 | == Initial Conditions == |
---|
372 | * the trays temperature (OutletL.T); |
---|
373 | * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); |
---|
374 | * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; |
---|
375 | |
---|
376 | * the condenser temperature (OutletL.T); |
---|
377 | * the condenser liquid level (Level); |
---|
378 | * (NoComps - 1) OutletL (OR OutletV) compositions; |
---|
379 | |
---|
380 | * the reboiler temperature (OutletL.T); |
---|
381 | * the reboiler liquid level (Level); |
---|
382 | * (NoComps - 1) OutletL (OR OutletV) compositions. |
---|
383 | "; |
---|
384 | |
---|
385 | PARAMETERS |
---|
386 | CondenserVapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
387 | |
---|
388 | VARIABLES |
---|
389 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.46,Protected = true); |
---|
390 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.58,Protected = true); |
---|
391 | CondenserUnity as condenser; |
---|
392 | ReboilerUnity as reboiler; |
---|
393 | SplitterTop as splitter; |
---|
394 | PumpUnity as pump; |
---|
395 | alfaTopo as Real; |
---|
396 | |
---|
397 | out HeatToReboiler as energy_stream (Brief="Heat supplied to Reboiler",Hidden=true); |
---|
398 | out HeatToCondenser as energy_stream (Brief="Heat supplied to Condenser",Hidden=true); |
---|
399 | |
---|
400 | RebNoFlow as sourceNoFlow (Brief="No Inlet Flow to Reboiler",Hidden=true); |
---|
401 | |
---|
402 | out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.67, PosY=0); |
---|
403 | in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true); |
---|
404 | |
---|
405 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.33); |
---|
406 | in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
407 | |
---|
408 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=1, PosY=1); |
---|
409 | in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
410 | |
---|
411 | EQUATIONS |
---|
412 | |
---|
413 | switch CondenserVapourFlow |
---|
414 | |
---|
415 | case "on": |
---|
416 | CondenserUnity.InletV.F*trays(1).vV = alfaTopo *Ah * sqrt(2*(trays(1).OutletV.P - |
---|
417 | CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV)); |
---|
418 | when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
419 | |
---|
420 | case "off": |
---|
421 | CondenserUnity.InletV.F = 0 * 'mol/s'; |
---|
422 | when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on"; |
---|
423 | |
---|
424 | end |
---|
425 | |
---|
426 | # Condenser Connector Equations |
---|
427 | ConnectorCondenserVout.T = VapourDistillate.T; |
---|
428 | ConnectorCondenserVout.P = VapourDistillate.P; |
---|
429 | ConnectorCondenserVout.F = VapourDistillate.F; |
---|
430 | ConnectorCondenserVout.z = VapourDistillate.z; |
---|
431 | |
---|
432 | # Splitter Connector Equations |
---|
433 | ConnectorSplitterOut.T = LiquidDistillate.T; |
---|
434 | ConnectorSplitterOut.P = LiquidDistillate.P; |
---|
435 | ConnectorSplitterOut.F = LiquidDistillate.F; |
---|
436 | ConnectorSplitterOut.z = LiquidDistillate.z; |
---|
437 | |
---|
438 | # Reboiler Connector Equations |
---|
439 | ConnectorReboilerLout.T = BottomProduct.T; |
---|
440 | ConnectorReboilerLout.P = BottomProduct.P; |
---|
441 | ConnectorReboilerLout.F = BottomProduct.F; |
---|
442 | ConnectorReboilerLout.z = BottomProduct.z; |
---|
443 | |
---|
444 | VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F; |
---|
445 | VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T; |
---|
446 | VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P; |
---|
447 | VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z; |
---|
448 | |
---|
449 | LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F; |
---|
450 | LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
451 | LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
452 | LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
453 | |
---|
454 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
455 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
456 | |
---|
457 | CONNECTIONS |
---|
458 | #vapor |
---|
459 | ReboilerUnity.OutletV to trays(NumberOfTrays).InletV; |
---|
460 | trays(1).OutletV to CondenserUnity.InletV; |
---|
461 | |
---|
462 | #liquid |
---|
463 | CondenserUnity.OutletL to SplitterTop.Inlet; |
---|
464 | SplitterTop.Outlet2 to PumpUnity.Inlet; |
---|
465 | PumpUnity.Outlet to trays(1).InletL; |
---|
466 | trays(NumberOfTrays).OutletL to ReboilerUnity.InletL; |
---|
467 | |
---|
468 | #Connectors |
---|
469 | HeatToReboiler to ReboilerUnity.InletQ; |
---|
470 | HeatToCondenser to CondenserUnity.InletQ; |
---|
471 | RebNoFlow.Outlet to ReboilerUnity.Inlet; |
---|
472 | |
---|
473 | CondenserUnity.OutletV to ConnectorCondenserVout; |
---|
474 | SplitterTop.Outlet1 to ConnectorSplitterOut; |
---|
475 | ReboilerUnity.OutletL to ConnectorReboilerLout; |
---|
476 | |
---|
477 | end |
---|
478 | |
---|
479 | |
---|
480 | #* ------------------------------------------------------------------- |
---|
481 | * Distillation Column model with: |
---|
482 | * |
---|
483 | * - NumberOfTrays like tray; |
---|
484 | * - a vessel in the bottom of column; |
---|
485 | * - a splitter who separate the bottom product and the stream to reboiler; |
---|
486 | * - steady state reboiler (thermosyphon); |
---|
487 | * - a steady state condenser with subcooling; |
---|
488 | * - a vessel drum (layed cilinder); |
---|
489 | * - a splitter which separate reflux and distillate; |
---|
490 | * - a pump in reflux stream. |
---|
491 | * |
---|
492 | * ------------------------------------------------------------------*# |
---|
493 | Model User_Distillation_thermosyphon_subcooling as User_Section_ColumnBasic |
---|
494 | |
---|
495 | ATTRIBUTES |
---|
496 | Pallete = true; |
---|
497 | Icon = "icon/DistillationThermosyphonSubcooling"; |
---|
498 | Brief = "Model of a distillation column with steady condenser and steady reboiler."; |
---|
499 | Info = |
---|
500 | "== Specify == |
---|
501 | * the feed stream of each tray (Inlet); |
---|
502 | * the Murphree eficiency for each tray Emv; |
---|
503 | * the pump head; |
---|
504 | * the condenser pressure drop; |
---|
505 | * the heat supllied in top and bottom tanks; |
---|
506 | * the heat supllied in condenser and reboiler; |
---|
507 | * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product; |
---|
508 | * both top splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
509 | |
---|
510 | == Initial Conditions == |
---|
511 | * the trays temperature (OutletL.T); |
---|
512 | * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); |
---|
513 | * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; |
---|
514 | |
---|
515 | * the top tank temperature (OutletL.T); |
---|
516 | * the top tank liquid level (Level); |
---|
517 | * (NoComps - 1) OutletL (OR OutletV) compositions; |
---|
518 | |
---|
519 | * the bottom tank temperature (OutletL.T); |
---|
520 | * the bottom tank liquid level (Level); |
---|
521 | * (NoComps - 1) OutletL (OR OutletV) compositions. |
---|
522 | "; |
---|
523 | |
---|
524 | PARAMETERS |
---|
525 | |
---|
526 | CondenserVapourFlow as Switcher(Valid = ["on", "off"], Hidden=true, Default = "on"); |
---|
527 | |
---|
528 | VARIABLES |
---|
529 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true); |
---|
530 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.515,Protected = true); |
---|
531 | CondenserUnity as condenserSteady; |
---|
532 | TopVessel as tank_cylindrical; |
---|
533 | TopSplitter as splitter; |
---|
534 | PumpUnity as pump; |
---|
535 | ReboilerUnity as reboilerSteady; |
---|
536 | BottomVessel as tank; |
---|
537 | BottomSplitter as splitter; |
---|
538 | |
---|
539 | |
---|
540 | alfaTopo as Real; |
---|
541 | |
---|
542 | out HeatToCondenser as energy_stream (Brief="Heat supplied to Condenser",Hidden=true); |
---|
543 | out HeatToReboiler as energy_stream (Brief="Heat supplied to Reboiler",Hidden=true); |
---|
544 | out HeatToBottomVessel as energy_stream (Brief="Heat supplied to Bottom Vessel",Hidden=true); |
---|
545 | out HeatToTopVessel as energy_stream (Brief="Heat supplied to Top Vessel",Hidden=true); |
---|
546 | |
---|
547 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.30); |
---|
548 | in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
549 | |
---|
550 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Bottom Splitter", PosX=1, PosY=1); |
---|
551 | in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
552 | |
---|
553 | EQUATIONS |
---|
554 | |
---|
555 | # Top Splitter Connector Equations |
---|
556 | ConnectorSplitterTop.T = LiquidDistillate.T; |
---|
557 | ConnectorSplitterTop.P = LiquidDistillate.P; |
---|
558 | ConnectorSplitterTop.F = LiquidDistillate.F; |
---|
559 | ConnectorSplitterTop.z = LiquidDistillate.z; |
---|
560 | |
---|
561 | # Bottom Splitter Connector Equations |
---|
562 | ConnectorSplitterBottom.T = BottomProduct.T; |
---|
563 | ConnectorSplitterBottom.P = BottomProduct.P; |
---|
564 | ConnectorSplitterBottom.F = BottomProduct.F; |
---|
565 | ConnectorSplitterBottom.z = BottomProduct.z; |
---|
566 | |
---|
567 | VapourDrawOff.F*VapSideTrayIndex= trays.VapourSideStream.F; |
---|
568 | VapourDrawOff.T = trays(VapourSideStreamLocation).VapourSideStream.T; |
---|
569 | VapourDrawOff.P = trays(VapourSideStreamLocation).VapourSideStream.P; |
---|
570 | VapourDrawOff.z = trays(VapourSideStreamLocation).VapourSideStream.z; |
---|
571 | |
---|
572 | LiquidDrawOff.F*LiqSideTrayIndex= trays.LiquidSideStream.F; |
---|
573 | LiquidDrawOff.T = trays(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
574 | LiquidDrawOff.P = trays(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
575 | LiquidDrawOff.z = trays(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
576 | |
---|
577 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
578 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
579 | |
---|
580 | switch CondenserVapourFlow |
---|
581 | |
---|
582 | case "on": |
---|
583 | CondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P - |
---|
584 | CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV)); |
---|
585 | when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
586 | |
---|
587 | case "off": |
---|
588 | CondenserUnity.InletV.F = 0 * 'mol/s'; |
---|
589 | when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on"; |
---|
590 | |
---|
591 | end |
---|
592 | |
---|
593 | CONNECTIONS |
---|
594 | #vapor |
---|
595 | ReboilerUnity.OutletV to trays(NumberOfTrays).InletV; |
---|
596 | trays(1).OutletV to CondenserUnity.InletV; |
---|
597 | |
---|
598 | #liquid |
---|
599 | CondenserUnity.OutletL to TopVessel.Inlet; |
---|
600 | TopVessel.Outlet to TopSplitter.Inlet; |
---|
601 | TopSplitter.Outlet2 to PumpUnity.Inlet; |
---|
602 | PumpUnity.Outlet to trays(1).InletL; |
---|
603 | trays(NumberOfTrays).OutletL to BottomVessel.Inlet; |
---|
604 | BottomVessel.Outlet to BottomSplitter.Inlet; |
---|
605 | BottomSplitter.Outlet2 to ReboilerUnity.InletL; |
---|
606 | |
---|
607 | #Connectors |
---|
608 | HeatToCondenser to CondenserUnity.InletQ; |
---|
609 | HeatToReboiler to ReboilerUnity.InletQ; |
---|
610 | HeatToBottomVessel to BottomVessel.InletQ; |
---|
611 | HeatToTopVessel to TopVessel.InletQ; |
---|
612 | TopSplitter.Outlet1 to ConnectorSplitterTop; |
---|
613 | BottomSplitter.Outlet1 to ConnectorSplitterBottom; |
---|
614 | |
---|
615 | end |
---|
616 | |
---|
617 | |
---|
618 | #* ------------------------------------------------------------------- |
---|
619 | * Distillation Column model with: |
---|
620 | * |
---|
621 | * - NumberOfTrays like tray; |
---|
622 | * - a vessel in the bottom of column; |
---|
623 | * - a splitter who separate the bottom product and the stream to reboiler; |
---|
624 | * - steady state reboiler (thermosyphon); |
---|
625 | * - a dynamic condenser without subcooling; |
---|
626 | * - a splitter which separate reflux and distillate; |
---|
627 | * - a pump in reflux stream. |
---|
628 | * |
---|
629 | * ------------------------------------------------------------------*# |
---|
630 | Model User_Distillation_thermosyphon_cond as User_Section_ColumnBasic |
---|
631 | |
---|
632 | ATTRIBUTES |
---|
633 | Pallete = true; |
---|
634 | Icon = "icon/DistillationThermosyphonCond"; |
---|
635 | Brief = "Model of a distillation column with dynamic condenser and steady reboiler."; |
---|
636 | Info = |
---|
637 | "== Specify == |
---|
638 | * the feed stream of each tray (Inlet); |
---|
639 | * the Murphree eficiency for each tray Emv; |
---|
640 | * the pump head; |
---|
641 | * the condenser vapor outlet flow (OutletV.F); |
---|
642 | * the heat supllied in bottom tank; |
---|
643 | * the heat supllied in condenser and reboiler; |
---|
644 | * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product; |
---|
645 | |
---|
646 | == Initial Conditions == |
---|
647 | * the trays temperature (OutletL.T); |
---|
648 | * the trays liquid level (Level) OR the trays liquid flow (OutletL.F); |
---|
649 | * (NoComps - 1) OutletL (OR OutletV) compositions for each tray; |
---|
650 | |
---|
651 | * the condenser temperature (OutletL.T); |
---|
652 | * the condenser liquid level (Level); |
---|
653 | * (NoComps - 1) OutletL (OR OutletV) compositions; |
---|
654 | |
---|
655 | * the bottom tank temperature (OutletL.T); |
---|
656 | * the bottom tank liquid level (Level); |
---|
657 | * (NoComps - 1) OutletL (OR OutletV) compositions. |
---|
658 | "; |
---|
659 | |
---|
660 | PARAMETERS |
---|
661 | CondenserVapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
662 | |
---|
663 | VARIABLES |
---|
664 | |
---|
665 | CondenserUnity as condenser; |
---|
666 | SplitterTop as splitter; |
---|
667 | PumpUnity as pump; |
---|
668 | BottomVessel as tank; |
---|
669 | SplitterBottom as splitter; |
---|
670 | ReboilerUnity as reboilerSteady; |
---|
671 | alfaTopo as Real; |
---|
672 | |
---|
673 | out HeatToCondenser as energy_stream (Brief="Heat supplied to Condenser",Hidden=true); |
---|
674 | out HeatToReboiler as energy_stream (Brief="Heat supplied to Reboiler",Hidden=true); |
---|
675 | out HeatToBottomVessel as energy_stream (Brief="Heat supplied to Bottom Vessel",Hidden=true); |
---|
676 | |
---|
677 | out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.73, PosY=0); |
---|
678 | in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true); |
---|
679 | |
---|
680 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.45); |
---|
681 | in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
682 | |
---|
683 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Bottom Splitter", PosX=1, PosY=1); |
---|
684 | in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
685 | |
---|
686 | EQUATIONS |
---|
687 | |
---|
688 | # Condenser Connector Equations |
---|
689 | ConnectorCondenserVout.T = VapourDistillate.T; |
---|
690 | ConnectorCondenserVout.P = VapourDistillate.P; |
---|
691 | ConnectorCondenserVout.F = VapourDistillate.F; |
---|
692 | ConnectorCondenserVout.z = VapourDistillate.z; |
---|
693 | |
---|
694 | # Top Splitter Connector Equations |
---|
695 | ConnectorSplitterTop.T = LiquidDistillate.T; |
---|
696 | ConnectorSplitterTop.P = LiquidDistillate.P; |
---|
697 | ConnectorSplitterTop.F = LiquidDistillate.F; |
---|
698 | ConnectorSplitterTop.z = LiquidDistillate.z; |
---|
699 | |
---|
700 | # Bottom Splitter Connector Equations |
---|
701 | ConnectorSplitterBottom.T = BottomProduct.T; |
---|
702 | ConnectorSplitterBottom.P = BottomProduct.P; |
---|
703 | ConnectorSplitterBottom.F = BottomProduct.F; |
---|
704 | ConnectorSplitterBottom.z = BottomProduct.z; |
---|
705 | |
---|
706 | switch CondenserVapourFlow |
---|
707 | case "on": |
---|
708 | CondenserUnity.InletV.F*trays(1).vV = alfaTopo * Ah * sqrt(2*(trays(1).OutletV.P - |
---|
709 | CondenserUnity.OutletL.P + 1e-8 * 'atm') / (alfa*trays(1).rhoV)); |
---|
710 | when CondenserUnity.InletV.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
711 | |
---|
712 | case "off": |
---|
713 | CondenserUnity.InletV.F = 0 * 'mol/s'; |
---|
714 | when trays(1).OutletV.P > CondenserUnity.OutletL.P + 1e-1 * 'atm' switchto "on"; |
---|
715 | end |
---|
716 | |
---|
717 | CONNECTIONS |
---|
718 | #vapor |
---|
719 | ReboilerUnity.OutletV to trays(NumberOfTrays).InletV; |
---|
720 | trays(1).OutletV to CondenserUnity.InletV; |
---|
721 | |
---|
722 | #liquid |
---|
723 | CondenserUnity.OutletL to SplitterTop.Inlet; |
---|
724 | SplitterTop.Outlet2 to PumpUnity.Inlet; |
---|
725 | PumpUnity.Outlet to trays(1).InletL; |
---|
726 | trays(NumberOfTrays).OutletL to BottomVessel.Inlet; |
---|
727 | BottomVessel.Outlet to SplitterBottom.Inlet; |
---|
728 | SplitterBottom.Outlet2 to ReboilerUnity.InletL; |
---|
729 | |
---|
730 | #Connectors |
---|
731 | HeatToCondenser to CondenserUnity.InletQ; |
---|
732 | HeatToReboiler to ReboilerUnity.InletQ; |
---|
733 | HeatToBottomVessel to BottomVessel.InletQ; |
---|
734 | CondenserUnity.OutletV to ConnectorCondenserVout; |
---|
735 | SplitterTop.Outlet1 to ConnectorSplitterTop; |
---|
736 | SplitterBottom.Outlet1 to ConnectorSplitterBottom; |
---|
737 | |
---|
738 | end |
---|