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 models of columns: distillation, stripping, absorbers |
---|
17 | * rectifier, .... |
---|
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: Paula B. Staudt |
---|
30 | * $Id: column.mso 511 2008-05-12 17:25:33Z paula $ |
---|
31 | *---------------------------------------------------------------------*# |
---|
32 | |
---|
33 | using "tray"; |
---|
34 | using "reboiler"; |
---|
35 | using "condenser"; |
---|
36 | using "mixers_splitters/splitter"; |
---|
37 | using "tank"; |
---|
38 | using "pressure_changers/pump"; |
---|
39 | |
---|
40 | Model ControlSection |
---|
41 | |
---|
42 | ATTRIBUTES |
---|
43 | Pallete = false; |
---|
44 | Brief = "Control variables for column section."; |
---|
45 | |
---|
46 | PARAMETERS |
---|
47 | outer NComp as Integer (Brief="Number of components"); |
---|
48 | |
---|
49 | Tindicator_TrayNumber as Integer (Brief="Temperature Indicator in the tray"); |
---|
50 | Pindicator_TrayNumber as Integer (Brief="Pressure Indicator in the tray"); |
---|
51 | |
---|
52 | end |
---|
53 | |
---|
54 | Model InitializeSection |
---|
55 | |
---|
56 | ATTRIBUTES |
---|
57 | Pallete = false; |
---|
58 | Brief = "Initial conditions for column section."; |
---|
59 | |
---|
60 | PARAMETERS |
---|
61 | outer NComp as Integer (Brief="Number of components"); |
---|
62 | |
---|
63 | TopTemperature as temperature (Brief = "Tray Temperature at Column Top", Default = 300); |
---|
64 | BottomTemperature as temperature (Brief = "Tray Temperature at Column Bottom", Default = 330); |
---|
65 | LevelFraction as fraction (Brief = "Tray Level Fraction", Default = 0.5); |
---|
66 | |
---|
67 | TopComposition(NComp) as fraction (Brief = "Component Molar Fraction at Column Top", Default = 0.30); |
---|
68 | BottomComposition(NComp) as fraction (Brief = "Component Molar Fraction at Column Bottom", Default = 0.30); |
---|
69 | |
---|
70 | end |
---|
71 | |
---|
72 | Model InitializeStage |
---|
73 | |
---|
74 | ATTRIBUTES |
---|
75 | Pallete = false; |
---|
76 | Brief = "Initial conditions for Packed column section."; |
---|
77 | |
---|
78 | PARAMETERS |
---|
79 | outer NComp as Integer (Brief="Number of components"); |
---|
80 | |
---|
81 | TopStageTemperature as temperature (Brief = "Tray Temperature at Column Top", Default = 300); |
---|
82 | BottomStageTemperature as temperature (Brief = "Tray Temperature at Column Bottom", Default = 300); |
---|
83 | |
---|
84 | TopStageComposition(NComp) as fraction (Brief = "Component Molar Fraction at Top"); |
---|
85 | BottomStageComposition(NComp) as fraction (Brief = "Component Molar Fraction at Bottom"); |
---|
86 | LiquidMolarHoldup as mol (Brief="Molar liquid holdup", Default=0.01); |
---|
87 | |
---|
88 | end |
---|
89 | |
---|
90 | Model Section_ColumnBasic |
---|
91 | |
---|
92 | ATTRIBUTES |
---|
93 | Pallete = false; |
---|
94 | Icon = "icon/SectionColumn"; |
---|
95 | Brief = "Model of a column section."; |
---|
96 | Info = |
---|
97 | "Model of a basic column section containing a vetor of TRAYS numbered from the top-down."; |
---|
98 | |
---|
99 | PARAMETERS |
---|
100 | outer PP as Plugin (Brief="External Physical Properties", Type="PP"); |
---|
101 | outer NComp as Integer (Brief="Number of components"); |
---|
102 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
103 | # Section Column Feed Tray - Side Streams Location and Numbering |
---|
104 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
105 | NumberOfTrays as Integer (Brief="Number of trays", Default=8); |
---|
106 | FeedTrayIndex(NumberOfTrays) as Integer (Brief="Feed Tray Index", Default=0,Hidden=true); |
---|
107 | LiqSideTrayIndex(NumberOfTrays) as Integer (Brief="Liquid Side Tray Index", Default=0,Hidden=true); |
---|
108 | VapSideTrayIndex(NumberOfTrays) as Integer (Brief="Vapour Side Tray Index", Default=0,Hidden=true); |
---|
109 | FeedTrayLocation as Integer (Brief="Feed tray Location", Default=2); |
---|
110 | LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2); |
---|
111 | VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2); |
---|
112 | g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); |
---|
113 | Mw(NComp) as molweight (Brief="Component Mol Weight",Hidden=true); |
---|
114 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
115 | # Section Column Flow Model for Liquid and Vapour |
---|
116 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
117 | VapourFlowModel as Switcher (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer"); |
---|
118 | LiquidFlowModel as Switcher (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default"); |
---|
119 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
120 | # Section Column Tray Geometry and Auxiliar Parameters |
---|
121 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
122 | VolumeOfTray as volume (Brief="Total Volume of the tray"); |
---|
123 | HeatSupply as heat_rate (Brief="Rate of heat supply"); |
---|
124 | PlateArea as area (Brief="Plate area = Atray - Adowncomer"); |
---|
125 | HolesArea as area (Brief="Total holes area"); |
---|
126 | WeirLength as length (Brief="Weir length"); |
---|
127 | WeirHeight as length (Brief="Weir height"); |
---|
128 | FeeheryCoeff as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1); |
---|
129 | ElgueCoeff as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1); |
---|
130 | OlsenCoeff as Real (Brief="Olsens correlation coefficient", Default=1); |
---|
131 | TrayLiquidPasses as Real (Brief="Number of liquid passes in the tray", Default=1); |
---|
132 | |
---|
133 | V as volume (Brief="Total Volume of the tray",Hidden=true); |
---|
134 | Q as heat_rate (Brief="Rate of heat supply",Hidden=true); |
---|
135 | Ap as area (Brief="Plate area = Atray - Adowncomer",Hidden=true); |
---|
136 | Ah as area (Brief="Total holes area",Hidden=true); |
---|
137 | lw as length (Brief="Weir length",Hidden=true); |
---|
138 | hw as length (Brief="Weir height",Hidden=true); |
---|
139 | beta as fraction (Brief="Aeration fraction"); |
---|
140 | alfa as fraction (Brief="Dry pressure drop coefficient"); |
---|
141 | w as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true); |
---|
142 | btray as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true); |
---|
143 | fw as Real (Brief="Olsens correlation coefficient", Default=1,Hidden=true); |
---|
144 | Np as Real (Brief="Number of liquid passes in the tray", Default=1,Hidden=true); |
---|
145 | |
---|
146 | VapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
147 | LiquidFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
148 | |
---|
149 | SET |
---|
150 | FeedTrayIndex(FeedTrayLocation) =1; |
---|
151 | VapSideTrayIndex(FeedTrayLocation) =1; |
---|
152 | LiqSideTrayIndex(FeedTrayLocation) =1; |
---|
153 | Mw = PP.MolecularWeight(); |
---|
154 | |
---|
155 | V=VolumeOfTray; |
---|
156 | Q=HeatSupply; |
---|
157 | Ap=PlateArea; |
---|
158 | Ah=HolesArea; |
---|
159 | lw=WeirLength; |
---|
160 | hw=WeirHeight ; |
---|
161 | w=FeeheryCoeff; |
---|
162 | btray=ElgueCoeff; |
---|
163 | fw=OlsenCoeff; |
---|
164 | Np=TrayLiquidPasses; |
---|
165 | |
---|
166 | VARIABLES |
---|
167 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
168 | # Tray Initialization For the Whole Column Section |
---|
169 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
170 | INITIALIZATION as InitializeSection (Brief = "Column Model Initialization"); |
---|
171 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
172 | # Control Ports |
---|
173 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
174 | CONTROL as ControlSection (Brief = "Control"); |
---|
175 | out TCI as control_signal (Brief="Temperature Indicator", Protected = true, PosX=1, PosY=0.90); |
---|
176 | out PCI as control_signal (Brief="Pressure Indicator", Protected = true, PosX=1, PosY=0.80); |
---|
177 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
178 | # Column Feed - Side Stream Flow and Murphree Efficiency |
---|
179 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
180 | in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55); |
---|
181 | TRAYS(NumberOfTrays) as tray (Brief="Number of trays in the Column Section"); |
---|
182 | VapourDrawOffFlow as flow_mol (Brief="Stream Molar Flow Rate"); |
---|
183 | LiquidDrawOffFlow as flow_mol (Brief="Stream Molar Flow Rate"); |
---|
184 | MurphreeEff as Real (Brief="Murphree efficiency for All Trays"); |
---|
185 | |
---|
186 | CONNECTIONS |
---|
187 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
188 | # Connecting Intermediate Trays |
---|
189 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
190 | TRAYS([2:NumberOfTrays]).OutletVapour to TRAYS([1:NumberOfTrays-1]).InletVapour; |
---|
191 | TRAYS([1:NumberOfTrays-1]).OutletLiquid to TRAYS([2:NumberOfTrays]).InletLiquid; |
---|
192 | |
---|
193 | INITIAL |
---|
194 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
195 | # Tray Initialization |
---|
196 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
197 | for i in 1:NumberOfTrays do |
---|
198 | |
---|
199 | "The initial temperature of the TRAYS" |
---|
200 | TRAYS(i).OutletLiquid.T = INITIALIZATION.TopTemperature+(INITIALIZATION.BottomTemperature-INITIALIZATION.TopTemperature)*((i-1)/(NumberOfTrays-1)); |
---|
201 | |
---|
202 | "The initial Level of the TRAYS" |
---|
203 | TRAYS(i).Level = INITIALIZATION.LevelFraction*hw; |
---|
204 | end |
---|
205 | |
---|
206 | for i in 1:NComp-1 do |
---|
207 | |
---|
208 | for j in 1:NumberOfTrays do |
---|
209 | |
---|
210 | "The initial composition of the TRAYS - Normalized" |
---|
211 | TRAYS(j).OutletLiquid.z(i) = INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) +(INITIALIZATION.BottomComposition(i)/sum(INITIALIZATION.BottomComposition)-INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) )*((j-1)/(NumberOfTrays-1)); |
---|
212 | end |
---|
213 | |
---|
214 | end |
---|
215 | |
---|
216 | EQUATIONS |
---|
217 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
218 | # Control Ports |
---|
219 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
220 | |
---|
221 | "Tray Temperature Indicator" |
---|
222 | TCI*'K' = TRAYS(max([NumberOfTrays, CONTROL.Tindicator_TrayNumber])).OutletVapour.T; |
---|
223 | |
---|
224 | "Tray Pressure Indicator" |
---|
225 | PCI*'atm' = TRAYS(max([NumberOfTrays, CONTROL.Pindicator_TrayNumber])).OutletVapour.P; |
---|
226 | |
---|
227 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
228 | # Equating Feed Tray Variables to Trays Variables |
---|
229 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
230 | "Feed Tray Inlet Flow" |
---|
231 | FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F; |
---|
232 | |
---|
233 | "Feed Tray Inlet Temperature" |
---|
234 | FeedTray.T = TRAYS.Inlet.T; |
---|
235 | |
---|
236 | "Feed Tray Inlet Pressure" |
---|
237 | FeedTray.P = TRAYS.Inlet.P; |
---|
238 | |
---|
239 | "Feed Tray Inlet Composition" |
---|
240 | FeedTray.z = TRAYS.Inlet.z; |
---|
241 | |
---|
242 | "Feed Tray Inlet Vapour Fraction" |
---|
243 | FeedTray.v = TRAYS.Inlet.v; |
---|
244 | |
---|
245 | "Feed Tray Inlet Enthalpy" |
---|
246 | FeedTray.h = TRAYS.Inlet.h; |
---|
247 | |
---|
248 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
249 | # Trays Equations |
---|
250 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
251 | |
---|
252 | for i in [1:NumberOfTrays] do |
---|
253 | |
---|
254 | "Murphree Efficiency" |
---|
255 | TRAYS(i).OutletVapour.z = MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletVapour.z) + TRAYS(i).InletVapour.z; |
---|
256 | |
---|
257 | "Level of clear liquid over the weir" |
---|
258 | TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/Ap; |
---|
259 | |
---|
260 | "Geometry Constraint" |
---|
261 | V = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV; |
---|
262 | |
---|
263 | "Energy Holdup" |
---|
264 | TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletLiquid.h + TRAYS(i).MV*TRAYS(i).OutletVapour.h - TRAYS(i).OutletLiquid.P*V; |
---|
265 | |
---|
266 | "Energy Balance" |
---|
267 | diff(TRAYS(i).E) = ( TRAYS(i).Inlet.F*TRAYS(i).Inlet.h + TRAYS(i).InletLiquid.F*TRAYS(i).InletLiquid.h + TRAYS(i).InletVapour.F*TRAYS(i).InletVapour.h- TRAYS(i).OutletLiquid.F*TRAYS(i).OutletLiquid.h - TRAYS(i).OutletVapour.F*TRAYS(i).OutletVapour.h |
---|
268 | -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + Q ); |
---|
269 | |
---|
270 | switch LiquidFlow |
---|
271 | case "on": |
---|
272 | switch LiquidFlowModel |
---|
273 | case "default": |
---|
274 | "Francis Equation" |
---|
275 | TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'1/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^2; |
---|
276 | |
---|
277 | case "Wang_Fl": |
---|
278 | TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'m^0.5/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^1.5; |
---|
279 | |
---|
280 | case "Olsen": |
---|
281 | TRAYS(i).OutletLiquid.F / 'mol/s'= lw*Np*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletVapour.z)/(0.665*fw)^1.5 * ((TRAYS(i).ML*sum(Mw*TRAYS(i).OutletLiquid.z)/TRAYS(i).rhoL/Ap)-hw)^1.5 * 'm^0.5/mol'; |
---|
282 | |
---|
283 | case "Feehery_Fl": |
---|
284 | TRAYS(i).OutletLiquid.F = lw*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletLiquid.z) * ((TRAYS(i).Level-hw)/750/'mm')^1.5 * 'm^2/s'; |
---|
285 | |
---|
286 | case "Roffel_Fl": |
---|
287 | TRAYS(i).OutletLiquid.F = 2/3*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletLiquid.z)*lw*(TRAYS(i).ML*sum(Mw*TRAYS(i).OutletLiquid.z)/(Ap*1.3)/TRAYS(i).rhoL)^1.5*sqrt(2*g/ |
---|
288 | (2*(1 - 0.3593/'Pa^0.0888545'*abs(TRAYS(i).OutletVapour.F*sum(Mw*TRAYS(i).OutletVapour.z)/(Ap*1.3)/sqrt(TRAYS(i).rhoV))^0.177709)-1)); #/'(kg/m)^0.0888545/s^0.177709'; |
---|
289 | end |
---|
290 | when TRAYS(i).Level < (beta *hw) switchto "off"; |
---|
291 | |
---|
292 | case "off": |
---|
293 | "Low level" |
---|
294 | TRAYS(i).OutletLiquid.F = 0 * 'mol/h'; |
---|
295 | when TRAYS(i).Level > (beta * hw) + 1e-6*'m' switchto "on"; |
---|
296 | end |
---|
297 | |
---|
298 | switch VapourFlow |
---|
299 | case "on": |
---|
300 | switch VapourFlowModel |
---|
301 | case "Reepmeyer": |
---|
302 | TRAYS(i).InletVapour.F*TRAYS(i).vV = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/(TRAYS(i).rhoV*alfa))*Ah; |
---|
303 | |
---|
304 | case "Feehery_Fv": |
---|
305 | TRAYS(i).InletVapour.F = TRAYS(i).rhoV/Ap/w/sum(Mw*TRAYS(i).OutletVapour.z) * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-(TRAYS(i).rhoV*g*TRAYS(i).ML*TRAYS(i).vL/Ap))/TRAYS(i).rhoV); |
---|
306 | |
---|
307 | case "Roffel_Fv": |
---|
308 | TRAYS(i).InletVapour.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)*1e5 - (beta*sum(TRAYS(i).M*Mw)/(Ap*1.3)*g*1e5) * (TRAYS(i).rhoV*Ah/sum(Mw*TRAYS(i).OutletVapour.z))^1.08 * 'm^1.08/mol^1.08'; |
---|
309 | |
---|
310 | case "Klingberg": |
---|
311 | TRAYS(i).InletVapour.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV); |
---|
312 | |
---|
313 | case "Wang_Fv": |
---|
314 | TRAYS(i).InletVapour.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV*alfa); |
---|
315 | |
---|
316 | case "Elgue": |
---|
317 | TRAYS(i).InletVapour.F = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/btray); |
---|
318 | end |
---|
319 | when TRAYS(i).InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
320 | |
---|
321 | case "off": |
---|
322 | TRAYS(i).InletVapour.F = 0 * 'mol/s'; |
---|
323 | when TRAYS(i).InletVapour.P > TRAYS(i).OutletVapour.P + TRAYS(i).Level*g*TRAYS(i).rhoL + 1e-1 * 'atm' switchto "on"; |
---|
324 | end |
---|
325 | |
---|
326 | end |
---|
327 | |
---|
328 | end |
---|
329 | |
---|
330 | Model Section_Column as Section_ColumnBasic |
---|
331 | |
---|
332 | ATTRIBUTES |
---|
333 | Pallete = true; |
---|
334 | Icon = "icon/SectionColumn"; |
---|
335 | Brief = "Model of a column section."; |
---|
336 | Info = |
---|
337 | "== Model of a column section containing == |
---|
338 | * NumberOfTrays TRAYS. |
---|
339 | |
---|
340 | == Specify == |
---|
341 | * the feed stream of each tray (Inlet); |
---|
342 | * the Murphree eficiency for each tray Emv; |
---|
343 | * the InletLiquid stream of the top tray; |
---|
344 | * the InletVapour stream of the bottom tray. |
---|
345 | |
---|
346 | == Initial Conditions == |
---|
347 | * the TRAYS temperature (OutletLiquid.T); |
---|
348 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
349 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray. |
---|
350 | "; |
---|
351 | |
---|
352 | VARIABLES |
---|
353 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
354 | # Section Inlet and Outlet Material Ports |
---|
355 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
356 | out VapourDrawOff as vapour_stream (Brief="Vapour Draw Off Port in the section", PosX=1, PosY=0.35,Protected = true); |
---|
357 | out LiquidDrawOff as liquid_stream (Brief="Liquid Draw Off Port in the section", PosX=1, PosY=0.65,Protected = true); |
---|
358 | |
---|
359 | in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0); |
---|
360 | out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0); |
---|
361 | |
---|
362 | in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1); |
---|
363 | out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1); |
---|
364 | |
---|
365 | LiquidConnector as stream (Brief="Liquid connection in the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); |
---|
366 | VapourConnector as stream (Brief="Vapour connection in the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); |
---|
367 | |
---|
368 | CONNECTIONS |
---|
369 | |
---|
370 | LiquidConnector to TRAYS(1).InletLiquid; |
---|
371 | VapourConnector to TRAYS(NumberOfTrays).InletVapour; |
---|
372 | |
---|
373 | EQUATIONS |
---|
374 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
375 | # Equating Inlet Liquid Connector Variables |
---|
376 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
377 | "Liquid Inlet Flow" |
---|
378 | LiquidConnector.F = LiquidInlet.F; |
---|
379 | |
---|
380 | "Liquid Inlet Temperature" |
---|
381 | LiquidConnector.T = LiquidInlet.T; |
---|
382 | |
---|
383 | "Liquid Inlet Pressure" |
---|
384 | LiquidConnector.P = LiquidInlet.P; |
---|
385 | |
---|
386 | "Liquid Inlet Composition" |
---|
387 | LiquidConnector.z = LiquidInlet.z; |
---|
388 | |
---|
389 | "Liquid Inlet Vapour Fraction" |
---|
390 | LiquidConnector.v = LiquidInlet.v; |
---|
391 | |
---|
392 | "Liquid Inlet Enthalpy" |
---|
393 | LiquidConnector.h = LiquidInlet.h; |
---|
394 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
395 | # Equating Inlet Vapour Connector Variables |
---|
396 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
397 | "Vapour Inlet Flow" |
---|
398 | VapourConnector.F = VapourInlet.F; |
---|
399 | |
---|
400 | "Vapour Inlet Temperature" |
---|
401 | VapourConnector.T = VapourInlet.T; |
---|
402 | |
---|
403 | "Vapour Inlet Pressure" |
---|
404 | VapourConnector.P = VapourInlet.P; |
---|
405 | |
---|
406 | "Vapour Inlet Composition" |
---|
407 | VapourConnector.z = VapourInlet.z; |
---|
408 | |
---|
409 | "Vapour Inlet Vapour Fraction" |
---|
410 | VapourConnector.v = VapourInlet.v; |
---|
411 | |
---|
412 | "Vapour Inlet Enthalpy" |
---|
413 | VapourConnector.h = VapourInlet.h; |
---|
414 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
415 | # Equating Outlet Liquid Variables |
---|
416 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
417 | "Liquid Outlet Flow" |
---|
418 | LiquidOutlet.F = TRAYS(NumberOfTrays).OutletLiquid.F; |
---|
419 | |
---|
420 | "Liquid Outlet Temperature" |
---|
421 | LiquidOutlet.T = TRAYS(NumberOfTrays).OutletLiquid.T; |
---|
422 | |
---|
423 | "Liquid Outlet Pressure" |
---|
424 | LiquidOutlet.P = TRAYS(NumberOfTrays).OutletLiquid.P; |
---|
425 | |
---|
426 | "Liquid Outlet Composition" |
---|
427 | LiquidOutlet.z = TRAYS(NumberOfTrays).OutletLiquid.z; |
---|
428 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
429 | # Equating Outlet Vapour Variables |
---|
430 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
431 | "Vapour Outlet Flow" |
---|
432 | VapourOutlet.F = TRAYS(1).OutletVapour.F; |
---|
433 | |
---|
434 | "Vapour Outlet Temperature" |
---|
435 | VapourOutlet.T = TRAYS(1).OutletVapour.T; |
---|
436 | |
---|
437 | "Vapour Outlet Pressure" |
---|
438 | VapourOutlet.P = TRAYS(1).OutletVapour.P; |
---|
439 | |
---|
440 | "Vapour Outlet Composition" |
---|
441 | VapourOutlet.z = TRAYS(1).OutletVapour.z; |
---|
442 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
443 | # Equating Outlet Vapour Side Stream Variables |
---|
444 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
445 | "Vapour Draw Off Stream - Flow" |
---|
446 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
447 | |
---|
448 | "Vapour Draw Off Stream - Temperature" |
---|
449 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
450 | |
---|
451 | "Vapour Draw Off Stream - Pressure" |
---|
452 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
453 | |
---|
454 | "Vapour Draw Off Stream - Composition" |
---|
455 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
456 | |
---|
457 | "Vapour Draw Off Stream" |
---|
458 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
459 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
460 | # Equating Outlet Liquid Side Stream Variables |
---|
461 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
462 | "Liquid Draw Off Stream - Flow" |
---|
463 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
464 | |
---|
465 | "Liquid Draw Off Stream - Temperature" |
---|
466 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
467 | |
---|
468 | "Liquid Draw Off Stream - Pressure" |
---|
469 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
470 | |
---|
471 | "Liquid Draw Off Stream - Composition" |
---|
472 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
473 | |
---|
474 | "Liquid Draw Off Stream" |
---|
475 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
476 | |
---|
477 | end |
---|
478 | |
---|
479 | Model Distillation_kettle_cond as Section_ColumnBasic |
---|
480 | |
---|
481 | ATTRIBUTES |
---|
482 | Pallete = true; |
---|
483 | Icon = "icon/DistillationKettleCond"; |
---|
484 | Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler."; |
---|
485 | Info = |
---|
486 | "== Specify == |
---|
487 | * the feed stream of each tray (Inlet); |
---|
488 | * the Murphree eficiency for each tray Emv; |
---|
489 | * the pump pressure difference; |
---|
490 | * the heat supllied in reboiler and condenser; |
---|
491 | * the condenser vapor outlet flow (OutletVapour.F); |
---|
492 | * the reboiler liquid outlet flow (OutletLiquid.F); |
---|
493 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
494 | |
---|
495 | == Initial Conditions == |
---|
496 | * the TRAYS temperature (OutletLiquid.T); |
---|
497 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
498 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
499 | |
---|
500 | * the condenser temperature (OutletLiquid.T); |
---|
501 | * the condenser liquid level (Level); |
---|
502 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
503 | |
---|
504 | * the reboiler temperature (OutletLiquid.T); |
---|
505 | * the reboiler liquid level (Level); |
---|
506 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
507 | "; |
---|
508 | |
---|
509 | PARAMETERS |
---|
510 | CondenserVapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
511 | |
---|
512 | VARIABLES |
---|
513 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.375,Protected = true); |
---|
514 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.42,Protected = true); |
---|
515 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
516 | # Column Devices |
---|
517 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
518 | CONDENSER as condenser; |
---|
519 | REBOILER as reboiler; |
---|
520 | SPLITTER as splitter2; |
---|
521 | PUMP as pump; |
---|
522 | alfaTopo as Real; |
---|
523 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
524 | # Heat Ports |
---|
525 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
526 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler",Protected = true, PosX=1, PosY=0.90); |
---|
527 | in HeatToCondenser as power (Brief="Heat supplied to Condenser", Protected = true, PosX=1, PosY=0.034); |
---|
528 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
529 | # Column Connectors |
---|
530 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
531 | ConnectorHeatReboiler as power (Brief="Heat supplied to Reboiler", Hidden=true); |
---|
532 | ConnectorHeatCondenser as power (Brief="Heat supplied to Condenser", Hidden=true); |
---|
533 | in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Condenser", Hidden=true); |
---|
534 | in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
535 | in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
536 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
537 | # Column products |
---|
538 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
539 | out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Condenser", PosX=0.66, PosY=0); |
---|
540 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.20); |
---|
541 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1); |
---|
542 | |
---|
543 | EQUATIONS |
---|
544 | |
---|
545 | switch CondenserVapourFlow |
---|
546 | |
---|
547 | case "on": |
---|
548 | CONDENSER.InletVapour.F*TRAYS(1).vV = alfaTopo *Ah * sqrt(2*(TRAYS(1).OutletVapour.P - |
---|
549 | CONDENSER.OutletLiquid.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); |
---|
550 | when CONDENSER.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
551 | |
---|
552 | case "off": |
---|
553 | CONDENSER.InletVapour.F = 0 * 'mol/s'; |
---|
554 | when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
555 | |
---|
556 | end |
---|
557 | |
---|
558 | # Condenser Connector Equations |
---|
559 | ConnectorCondenserVout.T = VapourDistillate.T; |
---|
560 | ConnectorCondenserVout.P = VapourDistillate.P; |
---|
561 | ConnectorCondenserVout.F = VapourDistillate.F; |
---|
562 | ConnectorCondenserVout.z = VapourDistillate.z; |
---|
563 | |
---|
564 | # Splitter Connector Equations |
---|
565 | ConnectorSplitterOut.T = LiquidDistillate.T; |
---|
566 | ConnectorSplitterOut.P = LiquidDistillate.P; |
---|
567 | ConnectorSplitterOut.F = LiquidDistillate.F; |
---|
568 | ConnectorSplitterOut.z = LiquidDistillate.z; |
---|
569 | |
---|
570 | # Reboiler Connector Equations |
---|
571 | ConnectorReboilerLout.T = BottomProduct.T; |
---|
572 | ConnectorReboilerLout.P = BottomProduct.P; |
---|
573 | ConnectorReboilerLout.F = BottomProduct.F; |
---|
574 | ConnectorReboilerLout.z = BottomProduct.z; |
---|
575 | |
---|
576 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
577 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
578 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
579 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
580 | |
---|
581 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
582 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
583 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
584 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
585 | |
---|
586 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
587 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
588 | |
---|
589 | HeatToReboiler = ConnectorHeatReboiler; |
---|
590 | HeatToCondenser = ConnectorHeatCondenser; |
---|
591 | |
---|
592 | CONNECTIONS |
---|
593 | #vapor |
---|
594 | REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour; |
---|
595 | TRAYS(1).OutletVapour to CONDENSER.InletVapour; |
---|
596 | |
---|
597 | #liquid |
---|
598 | CONDENSER.OutletLiquid to SPLITTER.Inlet; |
---|
599 | SPLITTER.Outlet2 to PUMP.Inlet; |
---|
600 | PUMP.Outlet to TRAYS(1).InletLiquid; |
---|
601 | TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid; |
---|
602 | |
---|
603 | #Connectors |
---|
604 | CONDENSER.OutletVapour to ConnectorCondenserVout; |
---|
605 | SPLITTER.Outlet1 to ConnectorSplitterOut; |
---|
606 | REBOILER.OutletLiquid to ConnectorReboilerLout; |
---|
607 | |
---|
608 | ConnectorHeatReboiler to REBOILER.InletQ; |
---|
609 | ConnectorHeatCondenser to CONDENSER.InletQ; |
---|
610 | |
---|
611 | end |
---|
612 | |
---|
613 | Model Distillation_thermosyphon_subcooling as Section_ColumnBasic |
---|
614 | ATTRIBUTES |
---|
615 | Pallete = true; |
---|
616 | Icon = "icon/DistillationThermosyphonSubcooling"; |
---|
617 | Brief = "Model of a distillation column with steady condenser and steady reboiler."; |
---|
618 | Info = |
---|
619 | "== Specify == |
---|
620 | * the feed stream of each tray (Inlet); |
---|
621 | * the Murphree eficiency for each tray Emv; |
---|
622 | * the pump head; |
---|
623 | * the condenser pressure drop; |
---|
624 | * the heat supllied in top and bottom tanks; |
---|
625 | * the heat supllied in condenser and reboiler; |
---|
626 | * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product; |
---|
627 | * both top splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
628 | |
---|
629 | == Initial Conditions == |
---|
630 | * the TRAYS temperature (OutletLiquid.T); |
---|
631 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
632 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
633 | |
---|
634 | * the top tank temperature (OutletLiquid.T); |
---|
635 | * the top tank liquid level (Level); |
---|
636 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
637 | |
---|
638 | * the bottom tank temperature (OutletLiquid.T); |
---|
639 | * the bottom tank liquid level (Level); |
---|
640 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
641 | "; |
---|
642 | |
---|
643 | PARAMETERS |
---|
644 | |
---|
645 | CondenserVapourFlow as Switcher(Valid = ["on", "off"], Hidden=true, Default = "on"); |
---|
646 | |
---|
647 | VARIABLES |
---|
648 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
649 | # Column Vapour and Liquid Draw Sides |
---|
650 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
651 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true); |
---|
652 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.45,Protected = true); |
---|
653 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
654 | # Column Devices |
---|
655 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
656 | CONDENSER as condenserSteady (Brief="steady state condenser with subcooling"); |
---|
657 | ACCUMULATOR_TOP as tank_cylindrical (Brief="vessel drum (layed cilinder)"); |
---|
658 | SPLITTER_TOP as splitter2 (Brief="splitter which separate reflux and distillate"); |
---|
659 | PUMP as pump (Brief="pump in reflux stream"); |
---|
660 | REBOILER as reboilerSteady (Brief="steady state reboiler (thermosyphon)"); |
---|
661 | ACCUMULATOR_BOTTOM as tank (Brief="vessel in the bottom of column"); |
---|
662 | SPLITTER_BOTTOM as splitter2 (Brief="splitter who separate the bottom product and the stream to reboiler"); |
---|
663 | alfaTopo as Real; |
---|
664 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
665 | # Heat Ports |
---|
666 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
667 | in HeatToCondenser as power (Brief="Heat supplied to Condenser",PosX=1, PosY=0.065, Protected=true); |
---|
668 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.87,Protected=true); |
---|
669 | in HeatToBottomAccumulator as power (Brief="Heat supplied to Bottom Accumulator",PosX=0, PosY=0.925,Protected=true); |
---|
670 | in HeatToTopAccumulator as power (Brief="Heat supplied to Top Accumulator", PosX=1, PosY=0.19,Protected=true); |
---|
671 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
672 | # Column Top and Bottom product |
---|
673 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
674 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.24); |
---|
675 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Bottom Splitter", PosX=0.18, PosY=1); |
---|
676 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
677 | # Column Model Connectors |
---|
678 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
679 | in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
680 | in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
681 | |
---|
682 | ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true); |
---|
683 | ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true); |
---|
684 | ConnectorHeatTopAccumulator as power (Brief="Connector for Heat supplied to Top Accumulator", Hidden=true); |
---|
685 | ConnectorHeatBottomAccumulator as power (Brief="Connector for Heat supplied to Bottom Accumulator", Hidden=true); |
---|
686 | |
---|
687 | EQUATIONS |
---|
688 | # Heat Connector Equations |
---|
689 | HeatToCondenser = ConnectorHeatCondenser; |
---|
690 | HeatToReboiler = ConnectorHeatReboiler; |
---|
691 | HeatToBottomAccumulator = ConnectorHeatBottomAccumulator; |
---|
692 | HeatToTopAccumulator = ConnectorHeatTopAccumulator; |
---|
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 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
707 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
708 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
709 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
710 | |
---|
711 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
712 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
713 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
714 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
715 | |
---|
716 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
717 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
718 | |
---|
719 | switch CondenserVapourFlow |
---|
720 | |
---|
721 | case "on": |
---|
722 | CONDENSER.InletVapour.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletVapour.P - |
---|
723 | CONDENSER.OutletLiquid.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); |
---|
724 | when CONDENSER.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
725 | |
---|
726 | case "off": |
---|
727 | CONDENSER.InletVapour.F = 0 * 'mol/s'; |
---|
728 | when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
729 | |
---|
730 | end |
---|
731 | |
---|
732 | CONNECTIONS |
---|
733 | #vapor |
---|
734 | REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour; |
---|
735 | TRAYS(1).OutletVapour to CONDENSER.InletVapour; |
---|
736 | |
---|
737 | #liquid |
---|
738 | CONDENSER.OutletLiquid to ACCUMULATOR_TOP.Inlet; |
---|
739 | ACCUMULATOR_TOP.Outlet to SPLITTER_TOP.Inlet; |
---|
740 | SPLITTER_TOP.Outlet2 to PUMP.Inlet; |
---|
741 | PUMP.Outlet to TRAYS(1).InletLiquid; |
---|
742 | TRAYS(NumberOfTrays).OutletLiquid to ACCUMULATOR_BOTTOM.Inlet; |
---|
743 | ACCUMULATOR_BOTTOM.Outlet to SPLITTER_BOTTOM.Inlet; |
---|
744 | SPLITTER_BOTTOM.Outlet2 to REBOILER.InletLiquid; |
---|
745 | |
---|
746 | #Connectors |
---|
747 | ConnectorHeatCondenser to CONDENSER.InletQ; |
---|
748 | ConnectorHeatReboiler to REBOILER.InletQ; |
---|
749 | ConnectorHeatBottomAccumulator to ACCUMULATOR_BOTTOM.InletQ; |
---|
750 | ConnectorHeatTopAccumulator to ACCUMULATOR_TOP.InletQ; |
---|
751 | SPLITTER_TOP.Outlet1 to ConnectorSplitterTop; |
---|
752 | SPLITTER_BOTTOM.Outlet1 to ConnectorSplitterBottom; |
---|
753 | |
---|
754 | end |
---|
755 | |
---|
756 | Model Distillation_thermosyphon_cond as Section_ColumnBasic |
---|
757 | ATTRIBUTES |
---|
758 | Pallete = true; |
---|
759 | Icon = "icon/DistillationThermosyphonCond"; |
---|
760 | Brief = "Model of a distillation column with dynamic condenser and steady reboiler."; |
---|
761 | Info = |
---|
762 | "== Specify == |
---|
763 | * the feed stream of each tray (Inlet); |
---|
764 | * the Murphree eficiency for each tray Emv; |
---|
765 | * the pump head; |
---|
766 | * the condenser vapor outlet flow (OutletVapour.F); |
---|
767 | * the heat supllied in bottom tank; |
---|
768 | * the heat supllied in condenser and reboiler; |
---|
769 | * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product; |
---|
770 | |
---|
771 | == Initial Conditions == |
---|
772 | * the TRAYS temperature (OutletLiquid.T); |
---|
773 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
774 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
775 | |
---|
776 | * the condenser temperature (OutletLiquid.T); |
---|
777 | * the condenser liquid level (Level); |
---|
778 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
779 | |
---|
780 | * the bottom tank temperature (OutletLiquid.T); |
---|
781 | * the bottom tank liquid level (Level); |
---|
782 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
783 | "; |
---|
784 | |
---|
785 | PARAMETERS |
---|
786 | CondenserVapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
787 | |
---|
788 | VARIABLES |
---|
789 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
790 | # Column Vapour and Liquid Draw Sides |
---|
791 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
792 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.379,Protected = true); |
---|
793 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.425,Protected = true); |
---|
794 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
795 | # Column Devices |
---|
796 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
797 | CONDENSER as condenser (Brief="dynamic condenser without subcooling"); |
---|
798 | SPLITTER_TOP as splitter2 (Brief="splitter which separate reflux and distillate"); |
---|
799 | PUMP as pump (Brief="pump in reflux stream"); |
---|
800 | ACCUMULATOR_BOTTOM as tank (Brief="vessel in the bottom of column"); |
---|
801 | SPLITTER_BOTTOM as splitter2 (Brief="splitter who separate the bottom product and the stream to reboiler"); |
---|
802 | REBOILER as reboilerSteady (Brief="steady state reboiler (thermosyphon)"); |
---|
803 | alfaTopo as Real; |
---|
804 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
805 | # Heat Ports |
---|
806 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
807 | in HeatToCondenser as power (Brief="Heat supplied to Condenser",PosX=1, PosY=0.035, Protected=true); |
---|
808 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.865,Protected=true); |
---|
809 | in HeatToBottomAccumulator as power (Brief="Heat supplied to Bottom Accumulator",PosX=0, PosY=0.92,Protected=true); |
---|
810 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
811 | # Column Top and Bottom product |
---|
812 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
813 | out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.665, PosY=0); |
---|
814 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.20); |
---|
815 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Bottom Splitter", PosX=0.18, PosY=1); |
---|
816 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
817 | # Column Model Connectors |
---|
818 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
819 | in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
820 | in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
821 | in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true); |
---|
822 | |
---|
823 | ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true); |
---|
824 | ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true); |
---|
825 | ConnectorHeatBottomAccumulator as power (Brief="Connector for Heat supplied to Bottom Accumulator", Hidden=true); |
---|
826 | |
---|
827 | EQUATIONS |
---|
828 | # Heat Connector Equations |
---|
829 | HeatToCondenser = ConnectorHeatCondenser; |
---|
830 | HeatToReboiler = ConnectorHeatReboiler; |
---|
831 | HeatToBottomAccumulator = ConnectorHeatBottomAccumulator; |
---|
832 | |
---|
833 | # Condenser Connector Equations |
---|
834 | ConnectorCondenserVout.T = VapourDistillate.T; |
---|
835 | ConnectorCondenserVout.P = VapourDistillate.P; |
---|
836 | ConnectorCondenserVout.F = VapourDistillate.F; |
---|
837 | ConnectorCondenserVout.z = VapourDistillate.z; |
---|
838 | |
---|
839 | # Top Splitter Connector Equations |
---|
840 | ConnectorSplitterTop.T = LiquidDistillate.T; |
---|
841 | ConnectorSplitterTop.P = LiquidDistillate.P; |
---|
842 | ConnectorSplitterTop.F = LiquidDistillate.F; |
---|
843 | ConnectorSplitterTop.z = LiquidDistillate.z; |
---|
844 | |
---|
845 | # Bottom Splitter Connector Equations |
---|
846 | ConnectorSplitterBottom.T = BottomProduct.T; |
---|
847 | ConnectorSplitterBottom.P = BottomProduct.P; |
---|
848 | ConnectorSplitterBottom.F = BottomProduct.F; |
---|
849 | ConnectorSplitterBottom.z = BottomProduct.z; |
---|
850 | |
---|
851 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
852 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
853 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
854 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
855 | |
---|
856 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
857 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
858 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
859 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
860 | |
---|
861 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
862 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
863 | |
---|
864 | switch CondenserVapourFlow |
---|
865 | case "on": |
---|
866 | CONDENSER.InletVapour.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletVapour.P - |
---|
867 | CONDENSER.OutletLiquid.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); |
---|
868 | when CONDENSER.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
869 | |
---|
870 | case "off": |
---|
871 | CONDENSER.InletVapour.F = 0 * 'mol/s'; |
---|
872 | when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
873 | end |
---|
874 | |
---|
875 | CONNECTIONS |
---|
876 | #vapor |
---|
877 | REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour; |
---|
878 | TRAYS(1).OutletVapour to CONDENSER.InletVapour; |
---|
879 | |
---|
880 | #liquid |
---|
881 | CONDENSER.OutletLiquid to SPLITTER_TOP.Inlet; |
---|
882 | SPLITTER_TOP.Outlet2 to PUMP.Inlet; |
---|
883 | PUMP.Outlet to TRAYS(1).InletLiquid; |
---|
884 | TRAYS(NumberOfTrays).OutletLiquid to ACCUMULATOR_BOTTOM.Inlet; |
---|
885 | ACCUMULATOR_BOTTOM.Outlet to SPLITTER_BOTTOM.Inlet; |
---|
886 | SPLITTER_BOTTOM.Outlet2 to REBOILER.InletLiquid; |
---|
887 | |
---|
888 | #Connectors |
---|
889 | ConnectorHeatCondenser to CONDENSER.InletQ; |
---|
890 | ConnectorHeatReboiler to REBOILER.InletQ; |
---|
891 | ConnectorHeatBottomAccumulator to ACCUMULATOR_BOTTOM.InletQ; |
---|
892 | CONDENSER.OutletVapour to ConnectorCondenserVout; |
---|
893 | SPLITTER_TOP.Outlet1 to ConnectorSplitterTop; |
---|
894 | SPLITTER_BOTTOM.Outlet1 to ConnectorSplitterBottom; |
---|
895 | |
---|
896 | end |
---|
897 | |
---|
898 | Model Distillation_kettle_subcooling as Section_ColumnBasic |
---|
899 | |
---|
900 | ATTRIBUTES |
---|
901 | Pallete = true; |
---|
902 | Icon = "icon/DistillationKettleSubcooling"; |
---|
903 | Brief = "Model of a distillation column with steady condenser and dynamic reboiler."; |
---|
904 | Info = |
---|
905 | "== Specify == |
---|
906 | * the feed stream of each tray (Inlet); |
---|
907 | * the Murphree eficiency for each tray (Emv); |
---|
908 | * the pump pressure difference; |
---|
909 | * the heat supllied in reboiler and condenser; |
---|
910 | * the heat supllied in the top tank; |
---|
911 | * the condenser pressure drop; |
---|
912 | * the reboiler liquid outlet flow (OutletLiquid.F); |
---|
913 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
914 | |
---|
915 | == Initial Conditions == |
---|
916 | * the TRAYS temperature (OutletLiquid.T); |
---|
917 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
918 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
919 | |
---|
920 | * the top tank temperature (OutletLiquid.T); |
---|
921 | * the top tank liquid level (Level); |
---|
922 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
923 | |
---|
924 | * the reboiler temperature (OutletLiquid.T); |
---|
925 | * the reboiler liquid level (Level); |
---|
926 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
927 | "; |
---|
928 | |
---|
929 | PARAMETERS |
---|
930 | CondenserVapourFlow as Switcher(Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
931 | |
---|
932 | VARIABLES |
---|
933 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
934 | # Column Vapour and Liquid Draw Sides |
---|
935 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
936 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.41,Protected = true); |
---|
937 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.45,Protected = true); |
---|
938 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
939 | # Column Devices |
---|
940 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
941 | CONDENSER as condenserSteady (Brief="steady state condenser with subcooling"); |
---|
942 | ACCUMULATOR as tank_cylindrical (Brief="vessel drum (layed cilinder)"); |
---|
943 | SPLITTER as splitter2 (Brief="splitter which separate reflux and distillate"); |
---|
944 | PUMP as pump (Brief="pump in reflux stream"); |
---|
945 | REBOILER as reboiler (Brief="kettle reboiler"); |
---|
946 | alfaTopo as Real; |
---|
947 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
948 | # Heat Ports |
---|
949 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
950 | in HeatToCondenser as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.065, Protected=true); |
---|
951 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.905, Protected=true); |
---|
952 | in HeatToAccumulator as power (Brief="Heat supplied to Top Vessel", PosX=1, PosY=0.195, Protected=true); |
---|
953 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
954 | # Column Model Connectors |
---|
955 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
956 | in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
957 | in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
958 | ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true); |
---|
959 | ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true); |
---|
960 | ConnectorHeatAccumulator as power (Brief="Connector for Heat supplied to TopVessel", Hidden=true); |
---|
961 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
962 | # Column Top and Bottom product |
---|
963 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
964 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.24); |
---|
965 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1); |
---|
966 | |
---|
967 | EQUATIONS |
---|
968 | |
---|
969 | #Heat Connectors |
---|
970 | HeatToCondenser = ConnectorHeatCondenser; |
---|
971 | HeatToReboiler = ConnectorHeatReboiler; |
---|
972 | HeatToAccumulator = ConnectorHeatAccumulator; |
---|
973 | |
---|
974 | # Splitter Connector Equations |
---|
975 | ConnectorSplitterOut.T = LiquidDistillate.T; |
---|
976 | ConnectorSplitterOut.P = LiquidDistillate.P; |
---|
977 | ConnectorSplitterOut.F = LiquidDistillate.F; |
---|
978 | ConnectorSplitterOut.z = LiquidDistillate.z; |
---|
979 | |
---|
980 | # Reboiler Connector Equations |
---|
981 | ConnectorReboilerLout.T = BottomProduct.T; |
---|
982 | ConnectorReboilerLout.P = BottomProduct.P; |
---|
983 | ConnectorReboilerLout.F = BottomProduct.F; |
---|
984 | ConnectorReboilerLout.z = BottomProduct.z; |
---|
985 | |
---|
986 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
987 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
988 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
989 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
990 | |
---|
991 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
992 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
993 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
994 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
995 | |
---|
996 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
997 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
998 | |
---|
999 | switch CondenserVapourFlow |
---|
1000 | case "on": |
---|
1001 | CONDENSER.InletVapour.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletVapour.P - |
---|
1002 | CONDENSER.OutletLiquid.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); |
---|
1003 | when CONDENSER.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
1004 | |
---|
1005 | case "off": |
---|
1006 | CONDENSER.InletVapour.F = 0 * 'mol/s'; |
---|
1007 | when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
1008 | end |
---|
1009 | |
---|
1010 | CONNECTIONS |
---|
1011 | #vapor |
---|
1012 | REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour; |
---|
1013 | TRAYS(1).OutletVapour to CONDENSER.InletVapour; |
---|
1014 | |
---|
1015 | #liquid |
---|
1016 | CONDENSER.OutletLiquid to ACCUMULATOR.Inlet; |
---|
1017 | ACCUMULATOR.Outlet to SPLITTER.Inlet; |
---|
1018 | SPLITTER.Outlet2 to PUMP.Inlet; |
---|
1019 | PUMP.Outlet to TRAYS(1).InletLiquid; |
---|
1020 | TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid; |
---|
1021 | |
---|
1022 | #Connectors |
---|
1023 | ConnectorHeatCondenser to CONDENSER.InletQ; |
---|
1024 | ConnectorHeatReboiler to REBOILER.InletQ; |
---|
1025 | ConnectorHeatAccumulator to ACCUMULATOR.InletQ; |
---|
1026 | |
---|
1027 | SPLITTER.Outlet1 to ConnectorSplitterOut; |
---|
1028 | REBOILER.OutletLiquid to ConnectorReboilerLout; |
---|
1029 | |
---|
1030 | end |
---|
1031 | |
---|
1032 | Model Rectifier as Section_ColumnBasic |
---|
1033 | |
---|
1034 | ATTRIBUTES |
---|
1035 | Pallete = true; |
---|
1036 | Icon = "icon/RefluxedCond"; |
---|
1037 | Brief = "Model of a rectifier column with dynamic condenser."; |
---|
1038 | Info = |
---|
1039 | "== Specify == |
---|
1040 | * the feed stream of each tray (Inlet); |
---|
1041 | * the Murphree eficiency for each tray Emv; |
---|
1042 | * the InletVapour stream of the bottom tray unless its flow; |
---|
1043 | * the pump pressure difference; |
---|
1044 | * the heat supllied in the condenser; |
---|
1045 | * the condenser vapor outlet flow (OutletVapour.F); |
---|
1046 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
1047 | |
---|
1048 | == Initial Conditions == |
---|
1049 | * the TRAYS temperature (OutletLiquid.T); |
---|
1050 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
1051 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
1052 | |
---|
1053 | * the condenser temperature (OutletLiquid.T); |
---|
1054 | * the condenser liquid level (Level); |
---|
1055 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
1056 | "; |
---|
1057 | |
---|
1058 | PARAMETERS |
---|
1059 | CondenserVapourFlow as Switcher(Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
1060 | |
---|
1061 | VARIABLES |
---|
1062 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1063 | # Column Vapour and Liquid Draw Sides |
---|
1064 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1065 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.45,Protected = true); |
---|
1066 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.50,Protected = true); |
---|
1067 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1068 | # Column Devices |
---|
1069 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1070 | CONDENSER as condenser (Brief="dymamic condenser without subcooling"); |
---|
1071 | SPLITTER as splitter2 (Brief="splitter which separate reflux and distillate"); |
---|
1072 | PUMP as pump (Brief="pump in reflux stream"); |
---|
1073 | alfaTopo as Real; |
---|
1074 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1075 | # Column Top product |
---|
1076 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1077 | out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.66, PosY=0); |
---|
1078 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.24); |
---|
1079 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1080 | # Heat Port |
---|
1081 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1082 | in HeatToCondenser as power (Brief="Heat supplied to Condenser",PosX=1, PosY=0.04, Protected = true); |
---|
1083 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1084 | # Column Bottom Outlets |
---|
1085 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1086 | in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.07, PosY=1); |
---|
1087 | out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.32, PosY=1); |
---|
1088 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1089 | # Column Model Connectors |
---|
1090 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1091 | in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
1092 | in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true); |
---|
1093 | VapourConnector as stream (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); |
---|
1094 | ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true); |
---|
1095 | |
---|
1096 | EQUATIONS |
---|
1097 | |
---|
1098 | switch CondenserVapourFlow |
---|
1099 | |
---|
1100 | case "on": |
---|
1101 | CONDENSER.InletVapour.F*TRAYS(1).vV = alfaTopo * Ah * sqrt(2*(TRAYS(1).OutletVapour.P - |
---|
1102 | CONDENSER.OutletLiquid.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); |
---|
1103 | when CONDENSER.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
1104 | |
---|
1105 | case "off": |
---|
1106 | CONDENSER.InletVapour.F = 0 * 'mol/s'; |
---|
1107 | when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
1108 | |
---|
1109 | end |
---|
1110 | |
---|
1111 | HeatToCondenser = ConnectorHeatCondenser; |
---|
1112 | |
---|
1113 | # Condenser Connector Equations |
---|
1114 | ConnectorCondenserVout.T = VapourDistillate.T; |
---|
1115 | ConnectorCondenserVout.P = VapourDistillate.P; |
---|
1116 | ConnectorCondenserVout.F = VapourDistillate.F; |
---|
1117 | ConnectorCondenserVout.z = VapourDistillate.z; |
---|
1118 | |
---|
1119 | # Splitter Connector Equations |
---|
1120 | ConnectorSplitterOut.T = LiquidDistillate.T; |
---|
1121 | ConnectorSplitterOut.P = LiquidDistillate.P; |
---|
1122 | ConnectorSplitterOut.F = LiquidDistillate.F; |
---|
1123 | ConnectorSplitterOut.z = LiquidDistillate.z; |
---|
1124 | |
---|
1125 | LiquidOutlet.F= TRAYS(NumberOfTrays).OutletLiquid.F; |
---|
1126 | LiquidOutlet.T = TRAYS(NumberOfTrays).OutletLiquid.T; |
---|
1127 | LiquidOutlet.P = TRAYS(NumberOfTrays).OutletLiquid.P; |
---|
1128 | LiquidOutlet.z = TRAYS(NumberOfTrays).OutletLiquid.z; |
---|
1129 | |
---|
1130 | VapourConnector.F= VapourInlet.F; |
---|
1131 | VapourConnector.T = VapourInlet.T; |
---|
1132 | VapourConnector.P = VapourInlet.P; |
---|
1133 | VapourConnector.z = VapourInlet.z; |
---|
1134 | VapourConnector.v = VapourInlet.v; |
---|
1135 | VapourConnector.h = VapourInlet.h; |
---|
1136 | |
---|
1137 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
1138 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
1139 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
1140 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
1141 | |
---|
1142 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
1143 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
1144 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
1145 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
1146 | |
---|
1147 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
1148 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
1149 | |
---|
1150 | CONNECTIONS |
---|
1151 | #vapor |
---|
1152 | TRAYS(1).OutletVapour to CONDENSER.InletVapour; |
---|
1153 | |
---|
1154 | #liquid |
---|
1155 | CONDENSER.OutletLiquid to SPLITTER.Inlet; |
---|
1156 | SPLITTER.Outlet2 to PUMP.Inlet; |
---|
1157 | PUMP.Outlet to TRAYS(1).InletLiquid; |
---|
1158 | |
---|
1159 | #Connectors |
---|
1160 | ConnectorHeatCondenser to CONDENSER.InletQ; |
---|
1161 | VapourConnector to TRAYS(NumberOfTrays).InletVapour; |
---|
1162 | SPLITTER.Outlet1 to ConnectorSplitterOut; |
---|
1163 | CONDENSER.OutletVapour to ConnectorCondenserVout; |
---|
1164 | |
---|
1165 | end |
---|
1166 | |
---|
1167 | Model Rectifier_subcooling as Section_ColumnBasic |
---|
1168 | |
---|
1169 | ATTRIBUTES |
---|
1170 | Pallete = true; |
---|
1171 | Icon = "icon/RefluxedSubcooling"; |
---|
1172 | Brief = "Model of a rectifier column with steady condenser."; |
---|
1173 | Info = |
---|
1174 | "== Specify == |
---|
1175 | * the feed stream of each tray (Inlet); |
---|
1176 | * the Murphree eficiency for each tray Emv; |
---|
1177 | * the InletVapour stream of the bottom tray unless its flow; |
---|
1178 | * the pump head; |
---|
1179 | * the condenser pressure drop; |
---|
1180 | * the heat supllied in the top tank; |
---|
1181 | * the heat supllied in condenser; |
---|
1182 | * both top splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
1183 | |
---|
1184 | == Initial Conditions == |
---|
1185 | * the TRAYS temperature (OutletLiquid.T); |
---|
1186 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
1187 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
1188 | |
---|
1189 | * the top tank temperature (OutletLiquid.T); |
---|
1190 | * the top tank liquid level (Level); |
---|
1191 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
1192 | "; |
---|
1193 | |
---|
1194 | PARAMETERS |
---|
1195 | CondenserVapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
1196 | |
---|
1197 | VARIABLES |
---|
1198 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1199 | # Column Vapour and Liquid Draw Sides |
---|
1200 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1201 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.485,Protected = true); |
---|
1202 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.535,Protected = true); |
---|
1203 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1204 | # Column Devices |
---|
1205 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1206 | CONDENSER as condenserSteady (Brief="steady state condenser with subcooling"); |
---|
1207 | ACCUMULATOR as tank_cylindrical (Brief="vessel drum (layed cilinder)"); |
---|
1208 | SPLITTER as splitter2 (Brief="plitter which separate reflux and distillate"); |
---|
1209 | PUMP as pump (Brief="pump in reflux stream"); |
---|
1210 | alfaTopo as Real; |
---|
1211 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1212 | # Column Bottom outlets |
---|
1213 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1214 | in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.07, PosY=1); |
---|
1215 | out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.32, PosY=1); |
---|
1216 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1217 | # Heat Ports |
---|
1218 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1219 | in HeatToCondenser as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.070, Protected=true); |
---|
1220 | in HeatToAccumulator as power (Brief="Heat supplied to Top Accumulator", PosX=1, PosY=0.23, Protected=true); |
---|
1221 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1222 | # Column Top Product |
---|
1223 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1224 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.285); |
---|
1225 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1226 | # Column Connectors |
---|
1227 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1228 | in ConnectorSplitterTop as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
1229 | VapourConnector as stream (Brief="Vapour connection at the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); |
---|
1230 | ConnectorHeatCondenser as power (Brief="Connector for Heat supplied to Condenser", Hidden=true); |
---|
1231 | ConnectorHeatAccumulator as power (Brief="Connector for Heat supplied to Top Accumulator", Hidden=true); |
---|
1232 | |
---|
1233 | EQUATIONS |
---|
1234 | #Heat Connectors |
---|
1235 | HeatToCondenser = ConnectorHeatCondenser; |
---|
1236 | HeatToAccumulator = ConnectorHeatAccumulator; |
---|
1237 | |
---|
1238 | LiquidOutlet.F= TRAYS(NumberOfTrays).OutletLiquid.F; |
---|
1239 | LiquidOutlet.T = TRAYS(NumberOfTrays).OutletLiquid.T; |
---|
1240 | LiquidOutlet.P = TRAYS(NumberOfTrays).OutletLiquid.P; |
---|
1241 | LiquidOutlet.z = TRAYS(NumberOfTrays).OutletLiquid.z; |
---|
1242 | |
---|
1243 | VapourConnector.F= VapourInlet.F; |
---|
1244 | VapourConnector.T = VapourInlet.T; |
---|
1245 | VapourConnector.P = VapourInlet.P; |
---|
1246 | VapourConnector.z = VapourInlet.z; |
---|
1247 | VapourConnector.v = VapourInlet.v; |
---|
1248 | VapourConnector.h = VapourInlet.h; |
---|
1249 | |
---|
1250 | # Splitter Connector Equations |
---|
1251 | ConnectorSplitterTop.T = LiquidDistillate.T; |
---|
1252 | ConnectorSplitterTop.P = LiquidDistillate.P; |
---|
1253 | ConnectorSplitterTop.F = LiquidDistillate.F; |
---|
1254 | ConnectorSplitterTop.z = LiquidDistillate.z; |
---|
1255 | |
---|
1256 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
1257 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
1258 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
1259 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
1260 | |
---|
1261 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
1262 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
1263 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
1264 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
1265 | |
---|
1266 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
1267 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
1268 | |
---|
1269 | switch CondenserVapourFlow |
---|
1270 | |
---|
1271 | case "on": |
---|
1272 | CONDENSER.InletVapour.F*TRAYS(1).vV = alfaTopo *Ah * sqrt(2*(TRAYS(1).OutletVapour.P - |
---|
1273 | CONDENSER.OutletLiquid.P + 1e-8 * 'atm') / (alfa*TRAYS(1).rhoV)); |
---|
1274 | when CONDENSER.InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
1275 | |
---|
1276 | case "off": |
---|
1277 | CONDENSER.InletVapour.F = 0 * 'mol/s'; |
---|
1278 | when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-1 * 'atm' switchto "on"; |
---|
1279 | |
---|
1280 | end |
---|
1281 | |
---|
1282 | CONNECTIONS |
---|
1283 | #vapor |
---|
1284 | TRAYS(1).OutletVapour to CONDENSER.InletVapour; |
---|
1285 | |
---|
1286 | #liquid |
---|
1287 | CONDENSER.OutletLiquid to ACCUMULATOR.Inlet; |
---|
1288 | ACCUMULATOR.Outlet to SPLITTER.Inlet; |
---|
1289 | SPLITTER.Outlet2 to PUMP.Inlet; |
---|
1290 | PUMP.Outlet to TRAYS(1).InletLiquid; |
---|
1291 | |
---|
1292 | #Connectors |
---|
1293 | VapourConnector to TRAYS(NumberOfTrays).InletVapour; |
---|
1294 | ConnectorHeatCondenser to CONDENSER.InletQ; |
---|
1295 | SPLITTER.Outlet1 to ConnectorSplitterTop; |
---|
1296 | ConnectorHeatAccumulator to ACCUMULATOR.InletQ; |
---|
1297 | |
---|
1298 | end |
---|
1299 | |
---|
1300 | Model Reboiled_Stripping_kettle as Section_ColumnBasic |
---|
1301 | |
---|
1302 | ATTRIBUTES |
---|
1303 | Pallete = true; |
---|
1304 | Icon = "icon/ReboiledKettle"; |
---|
1305 | Brief = "Model of a reboiled stripping column with dynamic reboiler."; |
---|
1306 | Info = |
---|
1307 | "== Specify == |
---|
1308 | * the feed stream of each tray (Inlet); |
---|
1309 | * the Murphree eficiency for each tray Emv; |
---|
1310 | * the vapour flow leaving the top of the column; |
---|
1311 | * the InletLiquidiquid stream of the top tray; |
---|
1312 | * the heat supllied in the reboiler; |
---|
1313 | * the reboiler liquid outlet flow (OutletLiquid.F); |
---|
1314 | |
---|
1315 | == Initial Conditions == |
---|
1316 | * the TRAYS temperature (OutletLiquid.T); |
---|
1317 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
1318 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
1319 | |
---|
1320 | * the reboiler temperature (OutletLiquid.T); |
---|
1321 | * the reboiler liquid level (Level); |
---|
1322 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
1323 | "; |
---|
1324 | |
---|
1325 | VARIABLES |
---|
1326 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1327 | # Column Vapour and Liquid Draw Sides |
---|
1328 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1329 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.28,Protected = true); |
---|
1330 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.33,Protected = true); |
---|
1331 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1332 | # Column Devices |
---|
1333 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1334 | REBOILER as reboiler (Brief="Kettle Reboiler"); |
---|
1335 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1336 | # Heat Port |
---|
1337 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1338 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler",PosX=1, PosY=0.865,Protected=true); |
---|
1339 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1340 | # Column Top Outlets |
---|
1341 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1342 | in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.30, PosY=0); |
---|
1343 | out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.07, PosY=0); |
---|
1344 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1345 | # Column Bottom Product |
---|
1346 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1347 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.68, PosY=1); |
---|
1348 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1349 | # Column Connectors |
---|
1350 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1351 | in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
1352 | LiquidConnector as stream (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); |
---|
1353 | ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true); |
---|
1354 | |
---|
1355 | CONNECTIONS |
---|
1356 | #vapor |
---|
1357 | REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour; |
---|
1358 | |
---|
1359 | #liquid |
---|
1360 | TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid; |
---|
1361 | |
---|
1362 | #Connectors |
---|
1363 | REBOILER.OutletLiquid to ConnectorReboilerLout; |
---|
1364 | LiquidConnector to TRAYS(1).InletLiquid; |
---|
1365 | ConnectorHeatReboiler to REBOILER.InletQ; |
---|
1366 | |
---|
1367 | EQUATIONS |
---|
1368 | #Heat Connectors |
---|
1369 | HeatToReboiler = ConnectorHeatReboiler; |
---|
1370 | |
---|
1371 | LiquidConnector.F= LiquidInlet.F; |
---|
1372 | LiquidConnector.T = LiquidInlet.T; |
---|
1373 | LiquidConnector.P = LiquidInlet.P; |
---|
1374 | LiquidConnector.z = LiquidInlet.z; |
---|
1375 | LiquidConnector.v = LiquidInlet.v; |
---|
1376 | LiquidConnector.h = LiquidInlet.h; |
---|
1377 | |
---|
1378 | VapourOutlet.F= TRAYS(1).OutletVapour.F; |
---|
1379 | VapourOutlet.T = TRAYS(1).OutletVapour.T; |
---|
1380 | VapourOutlet.P = TRAYS(1).OutletVapour.P; |
---|
1381 | VapourOutlet.z = TRAYS(1).OutletVapour.z; |
---|
1382 | |
---|
1383 | # Reboiler Connector Equations |
---|
1384 | ConnectorReboilerLout.T = BottomProduct.T; |
---|
1385 | ConnectorReboilerLout.P = BottomProduct.P; |
---|
1386 | ConnectorReboilerLout.F = BottomProduct.F; |
---|
1387 | ConnectorReboilerLout.z = BottomProduct.z; |
---|
1388 | |
---|
1389 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
1390 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
1391 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
1392 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
1393 | |
---|
1394 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
1395 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
1396 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
1397 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
1398 | |
---|
1399 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
1400 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
1401 | |
---|
1402 | end |
---|
1403 | |
---|
1404 | Model Reboiled_Stripping_thermosyphon as Section_ColumnBasic |
---|
1405 | |
---|
1406 | ATTRIBUTES |
---|
1407 | Pallete = true; |
---|
1408 | Icon = "icon/ReboiledThermosyphon"; |
---|
1409 | Brief = "Model of a reboiled stripping column with steady reboiler."; |
---|
1410 | Info = |
---|
1411 | "== Specify == |
---|
1412 | * the feed stream of each tray (Inlet); |
---|
1413 | * the Murphree eficiency for each tray (Emv); |
---|
1414 | * the vapour flow leaving the top of the column; |
---|
1415 | * the InletLiquidiquid stream of the top tray; |
---|
1416 | * the heat supllied in bottom tank; |
---|
1417 | * the heat supllied in the reboiler; |
---|
1418 | * the Outlet1 flow in the bottom splitter (spbottom.Outlet1.F) that corresponds to the bottom product; |
---|
1419 | |
---|
1420 | == Initial Conditions == |
---|
1421 | * the TRAYS temperature (OutletLiquid.T); |
---|
1422 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
1423 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
1424 | |
---|
1425 | * the bottom tank temperature (OutletLiquid.T); |
---|
1426 | * the bottom tank liquid level (Level); |
---|
1427 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
1428 | "; |
---|
1429 | |
---|
1430 | VARIABLES |
---|
1431 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1432 | # Column Vapour and Liquid Draw Sides |
---|
1433 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1434 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.28,Protected = true); |
---|
1435 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.33,Protected = true); |
---|
1436 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1437 | # Column Devices |
---|
1438 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1439 | REBOILER as reboilerSteady (Brief="steady state reboiler (thermosyphon)"); |
---|
1440 | SPLITTER as splitter2 (Brief="splitter which separate the bottom product and the stream to reboiler"); |
---|
1441 | ACCUMULATOR as tank (Brief="vessel in the bottom of column"); |
---|
1442 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1443 | # Heat Ports |
---|
1444 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1445 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler",PosX=1, PosY=0.84,Protected=true); |
---|
1446 | in HeatToAccumulator as power (Brief="Heat supplied to Bottom Vessel",PosX=0, PosY=0.91,Protected=true); |
---|
1447 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1448 | # Column Top Outlets |
---|
1449 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1450 | in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.32, PosY=0); |
---|
1451 | out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.07, PosY=0); |
---|
1452 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1453 | # Column Bottom Product |
---|
1454 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1455 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.19, PosY=1); |
---|
1456 | LiquidConnector as stream (Brief="Liquid connection at the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); |
---|
1457 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1458 | # Column Connectors |
---|
1459 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1460 | in ConnectorSplitterBottom as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
1461 | ConnectorHeatReboiler as power (Brief="Connector for Heat supplied to Reboiler", Hidden=true); |
---|
1462 | ConnectorHeatAccumulator as power (Brief="Connector for Heat supplied to Bottom Accumulator", Hidden=true); |
---|
1463 | |
---|
1464 | CONNECTIONS |
---|
1465 | #vapor |
---|
1466 | REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour; |
---|
1467 | |
---|
1468 | #liquid |
---|
1469 | TRAYS(NumberOfTrays).OutletLiquid to ACCUMULATOR.Inlet; |
---|
1470 | ACCUMULATOR.Outlet to SPLITTER.Inlet; |
---|
1471 | SPLITTER.Outlet2 to REBOILER.InletLiquid; |
---|
1472 | |
---|
1473 | #Connectors |
---|
1474 | LiquidConnector to TRAYS(1).InletLiquid; |
---|
1475 | ConnectorHeatReboiler to REBOILER.InletQ; |
---|
1476 | ConnectorHeatAccumulator to ACCUMULATOR.InletQ; |
---|
1477 | SPLITTER.Outlet1 to ConnectorSplitterBottom; |
---|
1478 | |
---|
1479 | EQUATIONS |
---|
1480 | #Heat Connectors |
---|
1481 | HeatToReboiler = ConnectorHeatReboiler; |
---|
1482 | HeatToAccumulator = ConnectorHeatAccumulator; |
---|
1483 | |
---|
1484 | ConnectorSplitterBottom.T = BottomProduct.T; |
---|
1485 | ConnectorSplitterBottom.P = BottomProduct.P; |
---|
1486 | ConnectorSplitterBottom.F = BottomProduct.F; |
---|
1487 | ConnectorSplitterBottom.z = BottomProduct.z; |
---|
1488 | |
---|
1489 | LiquidConnector.F= LiquidInlet.F; |
---|
1490 | LiquidConnector.T = LiquidInlet.T; |
---|
1491 | LiquidConnector.P = LiquidInlet.P; |
---|
1492 | LiquidConnector.z = LiquidInlet.z; |
---|
1493 | LiquidConnector.v = LiquidInlet.v; |
---|
1494 | LiquidConnector.h = LiquidInlet.h; |
---|
1495 | |
---|
1496 | VapourOutlet.F= TRAYS(1).OutletVapour.F; |
---|
1497 | VapourOutlet.T = TRAYS(1).OutletVapour.T; |
---|
1498 | VapourOutlet.P = TRAYS(1).OutletVapour.P; |
---|
1499 | VapourOutlet.z = TRAYS(1).OutletVapour.z; |
---|
1500 | |
---|
1501 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
1502 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
1503 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
1504 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
1505 | |
---|
1506 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
1507 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
1508 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
1509 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
1510 | |
---|
1511 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
1512 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
1513 | |
---|
1514 | end |
---|
1515 | |
---|
1516 | Model ReactiveDistillation |
---|
1517 | |
---|
1518 | ATTRIBUTES |
---|
1519 | Pallete = true; |
---|
1520 | Icon = "icon/DistillationReac"; |
---|
1521 | Brief = "Model of a reactive distillation column with dynamic condenser and reboiler."; |
---|
1522 | Info = |
---|
1523 | "== Specify == |
---|
1524 | * the reaction related variables for each tray, condenser and reboiler; |
---|
1525 | * the feed stream of each tray (Inlet); |
---|
1526 | * the Murphree eficiency for each tray Emv; |
---|
1527 | * the pump pressure difference; |
---|
1528 | * the heat supllied in reboiler and condenser; |
---|
1529 | * the condenser vapor outlet flow (OutletVapour.F); |
---|
1530 | * the reboiler liquid outlet flow (OutletLiquid.F); |
---|
1531 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
1532 | |
---|
1533 | == Initial Conditions == |
---|
1534 | * the TRAYS temperature (OutletLiquid.T); |
---|
1535 | * the TRAYS liquid level (Level) OR the TRAYS liquid flow (OutletLiquid.F); |
---|
1536 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray; |
---|
1537 | |
---|
1538 | * the condenser temperature (OutletLiquid.T); |
---|
1539 | * the condenser liquid level (Level); |
---|
1540 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
1541 | |
---|
1542 | * the reboiler temperature (OutletLiquid.T); |
---|
1543 | * the reboiler liquid level (Level); |
---|
1544 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
1545 | "; |
---|
1546 | |
---|
1547 | PARAMETERS |
---|
1548 | outer PP as Plugin (Type="PP"); |
---|
1549 | outer NComp as Integer (Brief="Number of Components"); |
---|
1550 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1551 | # Section Column Feed Tray - Side Streams Location and Numbering |
---|
1552 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1553 | NumberOfTrays as Integer (Brief="Number of TRAYS", Default=2); |
---|
1554 | FeedTrayIndex(NumberOfTrays) as Integer (Brief="Feed Tray Index", Default=0,Hidden=true); |
---|
1555 | LiqSideTrayIndex(NumberOfTrays) as Integer (Brief="Liquid Side Tray Index", Default=0,Hidden=true); |
---|
1556 | VapSideTrayIndex(NumberOfTrays) as Integer (Brief="Vapour Side Tray Index", Default=0,Hidden=true); |
---|
1557 | FeedTrayLocation as Integer (Brief="Feed tray Location", Default=2); |
---|
1558 | LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2); |
---|
1559 | VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2); |
---|
1560 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1561 | # Section Column Flow Model for Liquid and Vapour |
---|
1562 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1563 | VapourFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true); |
---|
1564 | TrayVapourFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true); |
---|
1565 | TrayLiquidFlow as Switcher (Valid = ["on", "off"], Default = "off",Hidden=true); |
---|
1566 | alfacond as Real; |
---|
1567 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1568 | # Section Column Tray Geometry and Auxiliar Parameters |
---|
1569 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1570 | V as volume (Brief="Total Volume of the tray",Hidden=true); |
---|
1571 | Q as power (Brief="Rate of heat supply",Hidden=true); |
---|
1572 | Ap as area (Brief="Plate area = Atray - Adowncomer",Hidden=true); |
---|
1573 | Ah as area (Brief="Total holes area",Hidden=true); |
---|
1574 | lw as length (Brief="Weir length",Hidden=true); |
---|
1575 | g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); |
---|
1576 | hw as length (Brief="Weir height",Hidden=true); |
---|
1577 | beta as fraction (Brief="Aeration fraction"); |
---|
1578 | alfa as fraction (Brief="Dry pressure drop coefficient"); |
---|
1579 | |
---|
1580 | VolumeOfTray as volume (Brief="Total Volume of the tray"); |
---|
1581 | HeatSupply as heat_rate (Brief="Rate of heat supply"); |
---|
1582 | PlateArea as area (Brief="Plate area = Atray - Adowncomer"); |
---|
1583 | HolesArea as area (Brief="Total holes area"); |
---|
1584 | WeirLength as length (Brief="Weir length"); |
---|
1585 | WeirHeight as length (Brief="Weir height"); |
---|
1586 | |
---|
1587 | stoic(NComp) as Real(Brief="Stoichiometric matrix"); |
---|
1588 | Hr as energy_mol; |
---|
1589 | |
---|
1590 | SET |
---|
1591 | |
---|
1592 | FeedTrayIndex(FeedTrayLocation) =1; |
---|
1593 | VapSideTrayIndex(FeedTrayLocation) =1; |
---|
1594 | LiqSideTrayIndex(FeedTrayLocation) =1; |
---|
1595 | |
---|
1596 | V=VolumeOfTray; |
---|
1597 | Q=HeatSupply; |
---|
1598 | Ap=PlateArea; |
---|
1599 | Ah=HolesArea; |
---|
1600 | lw=WeirLength; |
---|
1601 | hw=WeirHeight ; |
---|
1602 | |
---|
1603 | VARIABLES |
---|
1604 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1605 | # Tray Initialization For the Whole Column Section |
---|
1606 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1607 | INITIALIZATION as InitializeSection (Brief = "Column Model Initialization"); |
---|
1608 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1609 | # Column Feed - Side Stream Flow and Murphree Efficiency |
---|
1610 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1611 | in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55); |
---|
1612 | VapourDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate"); |
---|
1613 | LiquidDrawOffFlow as flow_mol (Brief = "Stream Molar Flow Rate"); |
---|
1614 | MurphreeEff as Real (Brief = "Murphree efficiency"); |
---|
1615 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1616 | # Column Vapour and Liquid Draw Sides |
---|
1617 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1618 | out VapourDrawOff as vapour_stream (Brief="Vapour Outlet in the section", PosX=1, PosY=0.395,Protected = true); |
---|
1619 | out LiquidDrawOff as liquid_stream (Brief="Liquid Outlet in the section", PosX=1, PosY=0.44,Protected = true); |
---|
1620 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1621 | # Heat Ports |
---|
1622 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1623 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler", PosX=1, PosY=0.89); |
---|
1624 | in HeatToCondenser as power (Brief="Heat supplied to Condenser", PosX=1, PosY=0.07); |
---|
1625 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1626 | # Column Devices |
---|
1627 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1628 | TRAYS(NumberOfTrays) as trayReac; |
---|
1629 | CONDENSER as condenserReact; |
---|
1630 | REBOILER as reboilerReact; |
---|
1631 | SPLITTER as splitter2; |
---|
1632 | PUMP as pump; |
---|
1633 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1634 | # Column Outlets |
---|
1635 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1636 | out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Condenser", PosX=0.59, PosY=0); |
---|
1637 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Splitter", PosX=1, PosY=0.23); |
---|
1638 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.67, PosY=1); |
---|
1639 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1640 | # Column Connectors |
---|
1641 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1642 | in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true); |
---|
1643 | in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
1644 | in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
1645 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1646 | # Column Control Ports |
---|
1647 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1648 | out TRI as control_signal (Brief="Temperature of Reboiler Indicator", PosX=1, PosY=0.83); |
---|
1649 | out LRI as control_signal (Brief="Level of Reboiler Indicator", PosX=1, PosY=0.855); |
---|
1650 | out TCI as control_signal (Brief="Temperature of Condenser Indicator", PosX=1, PosY=0.01); |
---|
1651 | out LCI as control_signal (Brief="Level of Condenser Indicator", PosX=1, PosY=0.04); |
---|
1652 | |
---|
1653 | CONNECTIONS |
---|
1654 | #vapor |
---|
1655 | REBOILER.OutletVapour to TRAYS(NumberOfTrays).InletVapour; |
---|
1656 | TRAYS(1).OutletVapour to CONDENSER.InletVapour; |
---|
1657 | TRAYS([2:NumberOfTrays]).OutletVapour to TRAYS([1:NumberOfTrays-1]).InletVapour; |
---|
1658 | |
---|
1659 | #liquid |
---|
1660 | CONDENSER.OutletLiquid to SPLITTER.Inlet; |
---|
1661 | SPLITTER.Outlet2 to PUMP.Inlet; |
---|
1662 | PUMP.Outlet to TRAYS(1).InletLiquid; |
---|
1663 | TRAYS([1:NumberOfTrays-1]).OutletLiquid to TRAYS([2:NumberOfTrays]).InletLiquid; |
---|
1664 | TRAYS(NumberOfTrays).OutletLiquid to REBOILER.InletLiquid; |
---|
1665 | |
---|
1666 | #Connectors |
---|
1667 | CONDENSER.OutletVapour to ConnectorCondenserVout; |
---|
1668 | SPLITTER.Outlet1 to ConnectorSplitterOut; |
---|
1669 | REBOILER.OutletLiquid to ConnectorReboilerLout; |
---|
1670 | |
---|
1671 | INITIAL |
---|
1672 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1673 | # Tray Initialization |
---|
1674 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1675 | for i in 1:NumberOfTrays do |
---|
1676 | |
---|
1677 | "The initial temperature of the TRAYS" |
---|
1678 | TRAYS(i).OutletLiquid.T = INITIALIZATION.TopTemperature+(INITIALIZATION.BottomTemperature-INITIALIZATION.TopTemperature)*((i-1)/(NumberOfTrays-1)); |
---|
1679 | |
---|
1680 | "The initial Level of the TRAYS" |
---|
1681 | TRAYS(i).Level = INITIALIZATION.LevelFraction*hw; |
---|
1682 | end |
---|
1683 | |
---|
1684 | for i in 1:NComp-1 do |
---|
1685 | |
---|
1686 | for j in 1:NumberOfTrays do |
---|
1687 | |
---|
1688 | "The initial composition of the TRAYS - Normalized" |
---|
1689 | TRAYS(j).OutletLiquid.z(i) = INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) +(INITIALIZATION.BottomComposition(i)/sum(INITIALIZATION.BottomComposition)-INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) )*((j-1)/(NumberOfTrays-1)); |
---|
1690 | end |
---|
1691 | |
---|
1692 | end |
---|
1693 | |
---|
1694 | EQUATIONS |
---|
1695 | |
---|
1696 | for i in [1:NumberOfTrays] do |
---|
1697 | |
---|
1698 | "Murphree Efficiency" |
---|
1699 | TRAYS(i).OutletVapour.z = MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletVapour.z) + TRAYS(i).InletVapour.z; |
---|
1700 | |
---|
1701 | "Energy Holdup" |
---|
1702 | TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletLiquid.h + TRAYS(i).MV*TRAYS(i).OutletVapour.h - TRAYS(i).OutletLiquid.P*V; |
---|
1703 | |
---|
1704 | "Component Molar Balance" |
---|
1705 | diff(TRAYS(i).M)=TRAYS(i).Inlet.F*TRAYS(i).Inlet.z + TRAYS(i).InletLiquid.F*TRAYS(i).InletLiquid.z + TRAYS(i).InletVapour.F*TRAYS(i).InletVapour.z- TRAYS(i).OutletLiquid.F*TRAYS(i).OutletLiquid.z - TRAYS(i).OutletVapour.F*TRAYS(i).OutletVapour.z- |
---|
1706 | TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.z-TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.z + stoic*TRAYS(i).r3*TRAYS(i).ML*TRAYS(i).vL; |
---|
1707 | |
---|
1708 | "Energy Balance" |
---|
1709 | diff(TRAYS(i).E) = ( TRAYS(i).Inlet.F*TRAYS(i).Inlet.h + TRAYS(i).InletLiquid.F*TRAYS(i).InletLiquid.h + TRAYS(i).InletVapour.F*TRAYS(i).InletVapour.h- TRAYS(i).OutletLiquid.F*TRAYS(i).OutletLiquid.h - TRAYS(i).OutletVapour.F*TRAYS(i).OutletVapour.h |
---|
1710 | -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + Q ) + Hr * TRAYS(i).r3 *TRAYS(i). vL*TRAYS(i).ML; |
---|
1711 | |
---|
1712 | "Level of clear liquid over the weir" |
---|
1713 | TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/Ap; |
---|
1714 | |
---|
1715 | "Geometry Constraint" |
---|
1716 | V = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV; |
---|
1717 | |
---|
1718 | end |
---|
1719 | |
---|
1720 | switch VapourFlow |
---|
1721 | case "on": |
---|
1722 | "Pressure Drop through the condenser" |
---|
1723 | CONDENSER.InletVapour.F*TRAYS(1).vV / 'm^2' = |
---|
1724 | sqrt((TRAYS(1).OutletVapour.P - CONDENSER.OutletLiquid.P + 1e-8 * 'atm')/(TRAYS(1).rhoV*alfacond)); |
---|
1725 | when TRAYS(1).OutletVapour.P < CONDENSER.OutletLiquid.P switchto "off"; |
---|
1726 | |
---|
1727 | case "off": |
---|
1728 | "Prato selado" |
---|
1729 | CONDENSER.InletVapour.F = 0.0 * 'mol/s'; |
---|
1730 | when TRAYS(1).OutletVapour.P > CONDENSER.OutletLiquid.P + 1e-3 * 'atm' switchto "on"; |
---|
1731 | end |
---|
1732 | |
---|
1733 | for i in [1:NumberOfTrays] do |
---|
1734 | |
---|
1735 | switch TrayLiquidFlow |
---|
1736 | case "on": |
---|
1737 | "Francis Equation" |
---|
1738 | TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'1/s'*lw*((TRAYS(i).Level-(beta*hw)+1e-6*'m')/(beta))^2; |
---|
1739 | when TRAYS(i).Level < (beta * hw) switchto "off"; |
---|
1740 | |
---|
1741 | case "off": |
---|
1742 | "Low level" |
---|
1743 | TRAYS(i).OutletLiquid.F = 0 * 'mol/h'; |
---|
1744 | when TRAYS(i).Level > (beta * hw) + 1e-6*'m' switchto "on"; |
---|
1745 | end |
---|
1746 | |
---|
1747 | switch TrayVapourFlow |
---|
1748 | case "on": |
---|
1749 | TRAYS(i).InletVapour.F*TRAYS(i).vV = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P - TRAYS(i).Level*g*TRAYS(i).rhoL + 1e-8 * 'atm')/(TRAYS(i).rhoV*alfa))*Ah; |
---|
1750 | when TRAYS(i).InletVapour.P < TRAYS(i).OutletVapour.P + TRAYS(i).Level*g*TRAYS(i).rhoL switchto "off"; |
---|
1751 | |
---|
1752 | case "off": |
---|
1753 | TRAYS(i).InletVapour.F = 0 * 'mol/s'; |
---|
1754 | when TRAYS(i).InletVapour.P > TRAYS(i).OutletVapour.P + TRAYS(i).Level*g*TRAYS(i).rhoL + 3e-2 * 'atm' switchto "on"; |
---|
1755 | end |
---|
1756 | |
---|
1757 | end |
---|
1758 | |
---|
1759 | # Connecting Trays |
---|
1760 | FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F; |
---|
1761 | FeedTray.T = TRAYS.Inlet.T; |
---|
1762 | FeedTray.P = TRAYS.Inlet.P; |
---|
1763 | FeedTray.z = TRAYS.Inlet.z; |
---|
1764 | FeedTray.v = TRAYS.Inlet.v; |
---|
1765 | FeedTray.h = TRAYS.Inlet.h; |
---|
1766 | |
---|
1767 | HeatToReboiler = REBOILER.InletQ; |
---|
1768 | HeatToCondenser = CONDENSER.InletQ; |
---|
1769 | |
---|
1770 | "Reboiler Temperature indicator" |
---|
1771 | TRI * 'K' = REBOILER.OutletLiquid.T; |
---|
1772 | |
---|
1773 | "Reboiler Level indicator" |
---|
1774 | LRI*REBOILER.V = REBOILER.Level*REBOILER.Across; |
---|
1775 | |
---|
1776 | "Condenser Temperature indicator" |
---|
1777 | TCI * 'K' = CONDENSER.OutletLiquid.T; |
---|
1778 | |
---|
1779 | "Condenser Level indicator" |
---|
1780 | LCI*CONDENSER.V = CONDENSER.Level*CONDENSER.Across; |
---|
1781 | |
---|
1782 | # Condenser Connector Equations |
---|
1783 | ConnectorCondenserVout.T = VapourDistillate.T; |
---|
1784 | ConnectorCondenserVout.P = VapourDistillate.P; |
---|
1785 | ConnectorCondenserVout.F = VapourDistillate.F; |
---|
1786 | ConnectorCondenserVout.z = VapourDistillate.z; |
---|
1787 | |
---|
1788 | # Splitter Connector Equations |
---|
1789 | ConnectorSplitterOut.T = LiquidDistillate.T; |
---|
1790 | ConnectorSplitterOut.P = LiquidDistillate.P; |
---|
1791 | ConnectorSplitterOut.F = LiquidDistillate.F; |
---|
1792 | ConnectorSplitterOut.z = LiquidDistillate.z; |
---|
1793 | |
---|
1794 | # Reboiler Connector Equations |
---|
1795 | ConnectorReboilerLout.T = BottomProduct.T; |
---|
1796 | ConnectorReboilerLout.P = BottomProduct.P; |
---|
1797 | ConnectorReboilerLout.F = BottomProduct.F; |
---|
1798 | ConnectorReboilerLout.z = BottomProduct.z; |
---|
1799 | |
---|
1800 | VapourDrawOff.F*VapSideTrayIndex= TRAYS.VapourSideStream.F; |
---|
1801 | VapourDrawOff.T = TRAYS(VapourSideStreamLocation).VapourSideStream.T; |
---|
1802 | VapourDrawOff.P = TRAYS(VapourSideStreamLocation).VapourSideStream.P; |
---|
1803 | VapourDrawOff.z = TRAYS(VapourSideStreamLocation).VapourSideStream.z; |
---|
1804 | |
---|
1805 | LiquidDrawOff.F*LiqSideTrayIndex= TRAYS.LiquidSideStream.F; |
---|
1806 | LiquidDrawOff.T = TRAYS(LiquidSideStreamLocation).LiquidSideStream.T; |
---|
1807 | LiquidDrawOff.P = TRAYS(LiquidSideStreamLocation).LiquidSideStream.P; |
---|
1808 | LiquidDrawOff.z = TRAYS(LiquidSideStreamLocation).LiquidSideStream.z; |
---|
1809 | |
---|
1810 | VapourDrawOffFlow = VapourDrawOff.F; |
---|
1811 | LiquidDrawOffFlow = LiquidDrawOff.F; |
---|
1812 | |
---|
1813 | end |
---|
1814 | |
---|
1815 | Model Packed_Section_ColumnBasic |
---|
1816 | ATTRIBUTES |
---|
1817 | Pallete = false; |
---|
1818 | Icon = "icon/PackedSectionColumn"; |
---|
1819 | Brief = "Model of a packed column section."; |
---|
1820 | Info = |
---|
1821 | "== Model of a packed column section containing == |
---|
1822 | * NStages theoretical stages. |
---|
1823 | |
---|
1824 | == Specify == |
---|
1825 | * the feed stream of each tray (Inlet); |
---|
1826 | * the InletLiquid stream of the top tray; |
---|
1827 | * the InletVapour stream of the bottom tray; |
---|
1828 | * the total pressure drop (dP) of the section. |
---|
1829 | |
---|
1830 | == Initial Conditions == |
---|
1831 | * the stages temperature (OutletLiquid.T); |
---|
1832 | * the stages liquid holdup; |
---|
1833 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray. |
---|
1834 | "; |
---|
1835 | |
---|
1836 | PARAMETERS |
---|
1837 | |
---|
1838 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
1839 | outer NComp as Integer; |
---|
1840 | |
---|
1841 | NumberOfStages as Integer (Brief="Number of Stages", Default=3); |
---|
1842 | FeedStageIndex(NumberOfStages) as Integer (Brief="Number of Stages", Default=0,Hidden=true); |
---|
1843 | FeedStageLocation as Integer (Brief="Feed Stage Location", Default=2); |
---|
1844 | |
---|
1845 | PackingHeight as length (Brief="Height of packing"); |
---|
1846 | HeatSupply as heat_rate (Brief="Rate of heat supply"); |
---|
1847 | ColumnDiameter as length (Brief="Column diameter"); |
---|
1848 | VoidFraction as Real (Brief="Void fraction of packing, m^3/m^3"); |
---|
1849 | ResistanceCoeff as positive (Brief="Resistance coefficient on the liquid load", Default=1); |
---|
1850 | AreaPerPackingVol as Real (Brief="surface area per packing volume", Unit='m^2/m^3'); |
---|
1851 | |
---|
1852 | V as volume (Brief="Total Volume of the tray",Hidden=true); |
---|
1853 | g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); |
---|
1854 | hs as length (Brief="Height of the packing stage",Hidden=true); |
---|
1855 | ColumnArea as area (Brief="Column Sectional Cross Area",Hidden=true); |
---|
1856 | |
---|
1857 | VARIABLES |
---|
1858 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1859 | # Stages Initialization For the Whole Column Section |
---|
1860 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
1861 | INITIALIZATION as InitializeStage (Brief = "Column Model Initialization"); |
---|
1862 | in FeedStage as stream (Brief="Feed stream", PosX=0, PosY=0.55); |
---|
1863 | |
---|
1864 | STAGES(NumberOfStages) as packedStage; |
---|
1865 | PressureDrop as pressure; |
---|
1866 | |
---|
1867 | SET |
---|
1868 | FeedStageIndex(FeedStageLocation) =1; |
---|
1869 | |
---|
1870 | ColumnArea = ColumnDiameter^2*3.14159*0.25; |
---|
1871 | hs =PackingHeight/NumberOfStages; |
---|
1872 | V = hs * ColumnArea; |
---|
1873 | |
---|
1874 | CONNECTIONS |
---|
1875 | |
---|
1876 | STAGES([2:NumberOfStages]).OutletVapour to STAGES([1:NumberOfStages-1]).InletVapour; |
---|
1877 | STAGES([1:NumberOfStages-1]).OutletLiquid to STAGES([2:NumberOfStages]).InletLiquid; |
---|
1878 | |
---|
1879 | EQUATIONS |
---|
1880 | # Connecting STAGES |
---|
1881 | FeedStage.F*FeedStageIndex= STAGES.Inlet.F; |
---|
1882 | FeedStage.T = STAGES.Inlet.T; |
---|
1883 | FeedStage.P = STAGES.Inlet.P; |
---|
1884 | FeedStage.z = STAGES.Inlet.z; |
---|
1885 | FeedStage.v = STAGES.Inlet.v; |
---|
1886 | FeedStage.h = STAGES.Inlet.h; |
---|
1887 | |
---|
1888 | STAGES.deltaP = PressureDrop/NumberOfStages; |
---|
1889 | |
---|
1890 | for i in [1:NumberOfStages] do |
---|
1891 | |
---|
1892 | "Energy Balance" |
---|
1893 | diff(STAGES(i).E) = ( STAGES(i).Inlet.F*STAGES(i).Inlet.h + STAGES(i).InletLiquid.F*STAGES(i).InletLiquid.h + STAGES(i).InletVapour.F*STAGES(i).InletVapour.h- STAGES(i).OutletLiquid.F*STAGES(i).OutletLiquid.h |
---|
1894 | - STAGES(i).OutletVapour.F*STAGES(i).OutletVapour.h + HeatSupply ); |
---|
1895 | |
---|
1896 | "Energy Holdup" |
---|
1897 | STAGES(i).E = STAGES(i).ML*STAGES(i).OutletLiquid.h + STAGES(i).MV*STAGES(i).OutletVapour.h - STAGES(i).OutletLiquid.P*V; |
---|
1898 | |
---|
1899 | "Geometry Constraint" |
---|
1900 | V*VoidFraction= STAGES(i).ML*STAGES(i).vL + STAGES(i).MV*STAGES(i).vV; |
---|
1901 | |
---|
1902 | "Volume flow rate of vapor, m^3/m^2/s" |
---|
1903 | STAGES(i).uV * ((ColumnArea)*VoidFraction - STAGES(i).Al) = STAGES(i).OutletVapour.F * STAGES(i).vV; |
---|
1904 | |
---|
1905 | "Liquid holdup" |
---|
1906 | STAGES(i).hl = STAGES(i).ML*STAGES(i).vL/V/VoidFraction; |
---|
1907 | |
---|
1908 | "Particle diameter" |
---|
1909 | STAGES(i).dp = 6 * (1-VoidFraction)/AreaPerPackingVol; |
---|
1910 | |
---|
1911 | "Wall Factor" |
---|
1912 | STAGES(i).invK = (1 + (2*STAGES(i).dp/(3*ColumnDiameter*(1-VoidFraction)))); |
---|
1913 | |
---|
1914 | "Reynolds number of the vapor stream" |
---|
1915 | STAGES(i).Rev*STAGES(i).invK = STAGES(i).dp*STAGES(i).uV*STAGES(i).rhoV / (STAGES(i).miV*(1-VoidFraction)); |
---|
1916 | |
---|
1917 | "Pressure drop and Vapor flow" |
---|
1918 | STAGES(i).deltaP/hs = ResistanceCoeff*AreaPerPackingVol*STAGES(i).uV^2*STAGES(i).rhoV*STAGES(i).invK / (2*(VoidFraction-STAGES(i).hl)^3); |
---|
1919 | |
---|
1920 | "Liquid holdup" |
---|
1921 | STAGES(i).hl = (12*STAGES(i).miL*AreaPerPackingVol^2*STAGES(i).uL/STAGES(i).rhoL/g)^1/3; |
---|
1922 | |
---|
1923 | "Area occupied by the liquid" |
---|
1924 | STAGES(i).Al = STAGES(i).ML*STAGES(i).vL/hs; |
---|
1925 | |
---|
1926 | end |
---|
1927 | |
---|
1928 | INITIAL |
---|
1929 | |
---|
1930 | for i in 1:NumberOfStages do |
---|
1931 | |
---|
1932 | "The initial temperature of the STAGES" |
---|
1933 | STAGES(i).OutletLiquid.T = INITIALIZATION.TopStageTemperature+(INITIALIZATION.BottomStageTemperature-INITIALIZATION.TopStageTemperature)*((i-1)/(NumberOfStages-1)); |
---|
1934 | |
---|
1935 | "The Liquid Holdup of the STAGES" |
---|
1936 | STAGES(i).ML = INITIALIZATION.LiquidMolarHoldup; |
---|
1937 | |
---|
1938 | end |
---|
1939 | |
---|
1940 | for i in 1:NComp-1 do |
---|
1941 | |
---|
1942 | for j in 1:NumberOfStages do |
---|
1943 | |
---|
1944 | "The initial composition of the TRAYS" |
---|
1945 | STAGES(j).OutletLiquid.z(i) = INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) +(INITIALIZATION.BottomStageComposition(i)/sum(INITIALIZATION.BottomStageComposition)-INITIALIZATION.TopStageComposition(i)/sum(INITIALIZATION.TopStageComposition) )*((j-1)/(NumberOfStages-1)); |
---|
1946 | |
---|
1947 | end |
---|
1948 | |
---|
1949 | end |
---|
1950 | |
---|
1951 | end |
---|
1952 | |
---|
1953 | Model Packed_Section_Column as Packed_Section_ColumnBasic |
---|
1954 | |
---|
1955 | ATTRIBUTES |
---|
1956 | Pallete = true; |
---|
1957 | Icon = "icon/PackedSectionColumn"; |
---|
1958 | Brief = "Model of a packed column section."; |
---|
1959 | Info = |
---|
1960 | "== Model of a packed column section containing == |
---|
1961 | * NStages theoretical stages. |
---|
1962 | |
---|
1963 | == Specify == |
---|
1964 | * the feed stream of each tray (Inlet); |
---|
1965 | * the InletLiquid stream of the top tray; |
---|
1966 | * the InletVapour stream of the bottom tray; |
---|
1967 | * the total pressure drop (dP) of the section. |
---|
1968 | |
---|
1969 | == Initial Conditions == |
---|
1970 | * the stages temperature (OutletLiquid.T); |
---|
1971 | * the stages liquid holdup; |
---|
1972 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each tray. |
---|
1973 | "; |
---|
1974 | |
---|
1975 | VARIABLES |
---|
1976 | |
---|
1977 | in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0); |
---|
1978 | out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0); |
---|
1979 | |
---|
1980 | in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1); |
---|
1981 | out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1); |
---|
1982 | |
---|
1983 | LiquidConnector as stream (Brief="Liquid connection at the middle STAGES", PosX=0.75, PosY=1,Hidden=true); |
---|
1984 | VapourConnector as stream (Brief="Vapour connection at the middle STAGES", PosX=0.55, PosY=0,Hidden=true); |
---|
1985 | |
---|
1986 | CONNECTIONS |
---|
1987 | |
---|
1988 | LiquidConnector to STAGES(1).InletLiquid; |
---|
1989 | VapourConnector to STAGES(NumberOfStages).InletVapour; |
---|
1990 | |
---|
1991 | EQUATIONS |
---|
1992 | |
---|
1993 | LiquidConnector.F= LiquidInlet.F; |
---|
1994 | LiquidConnector.T = LiquidInlet.T; |
---|
1995 | LiquidConnector.P = LiquidInlet.P; |
---|
1996 | LiquidConnector.z = LiquidInlet.z; |
---|
1997 | LiquidConnector.v = LiquidInlet.v; |
---|
1998 | LiquidConnector.h = LiquidInlet.h; |
---|
1999 | |
---|
2000 | VapourConnector.F= VapourInlet.F; |
---|
2001 | VapourConnector.T = VapourInlet.T; |
---|
2002 | VapourConnector.P = VapourInlet.P; |
---|
2003 | VapourConnector.z = VapourInlet.z; |
---|
2004 | VapourConnector.v = VapourInlet.v; |
---|
2005 | VapourConnector.h = VapourInlet.h; |
---|
2006 | |
---|
2007 | LiquidOutlet.F= STAGES(NumberOfStages).OutletLiquid.F; |
---|
2008 | LiquidOutlet.T = STAGES(NumberOfStages).OutletLiquid.T; |
---|
2009 | LiquidOutlet.P = STAGES(NumberOfStages).OutletLiquid.P; |
---|
2010 | LiquidOutlet.z = STAGES(NumberOfStages).OutletLiquid.z; |
---|
2011 | |
---|
2012 | VapourOutlet.F= STAGES(1).OutletVapour.F; |
---|
2013 | VapourOutlet.T = STAGES(1).OutletVapour.T; |
---|
2014 | VapourOutlet.P = STAGES(1).OutletVapour.P; |
---|
2015 | VapourOutlet.z = STAGES(1).OutletVapour.z; |
---|
2016 | |
---|
2017 | end |
---|
2018 | |
---|
2019 | Model PackedDistillation_kettle_cond as Packed_Section_ColumnBasic |
---|
2020 | ATTRIBUTES |
---|
2021 | Pallete = true; |
---|
2022 | Icon = "icon/PackedDistillationKettleCond"; |
---|
2023 | Brief = "Model of a distillation column with dynamic condenser and dynamic reboiler."; |
---|
2024 | Info = |
---|
2025 | "== Specify == |
---|
2026 | * the feed stream of each tray (Inlet); |
---|
2027 | * the pump pressure difference; |
---|
2028 | * the total pressure drop (dP) of the packing; |
---|
2029 | * the heat supllied in reboiler and condenser; |
---|
2030 | * the condenser vapor outlet flow (OutletVapour.F); |
---|
2031 | * the reboiler liquid outlet flow (OutletLiquid.F); |
---|
2032 | * both splitter outlet flows OR one of the splitter outlet flows and the splitter frac. |
---|
2033 | |
---|
2034 | == Initial Conditions == |
---|
2035 | * the stages temperature (OutletLiquid.T); |
---|
2036 | * the stages initial molar holdup; |
---|
2037 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions for each stage; |
---|
2038 | |
---|
2039 | * the condenser temperature (OutletLiquid.T); |
---|
2040 | * the condenser liquid level (Level); |
---|
2041 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions; |
---|
2042 | |
---|
2043 | * the reboiler temperature (OutletLiquid.T); |
---|
2044 | * the reboiler liquid level (Level); |
---|
2045 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
2046 | "; |
---|
2047 | |
---|
2048 | PARAMETERS |
---|
2049 | |
---|
2050 | VapourFlow as Switcher (Valid = ["on", "off"], Hidden = true ,Default = "on"); |
---|
2051 | |
---|
2052 | VARIABLES |
---|
2053 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2054 | # Column Devices |
---|
2055 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2056 | CONDENSER as condenser (Brief="dymamic condenser"); |
---|
2057 | REBOILER as reboiler (Brief="kettle reboiler"); |
---|
2058 | SPLITTER as splitter2 (Brief="splitter which separate reflux and distillate"); |
---|
2059 | PUMP as pump (Brief="pump in reflux stream"); |
---|
2060 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2061 | # Heat Ports |
---|
2062 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2063 | in HeatToReboiler as power (Brief="Heat supplied to Reboiler",Protected = true, PosX=1, PosY=0.885); |
---|
2064 | in HeatToCondenser as power (Brief="Heat supplied to Condenser", Protected = true, PosX=1, PosY=0.034); |
---|
2065 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2066 | # Column Products |
---|
2067 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2068 | out VapourDistillate as vapour_stream (Brief="Vapour outlet stream From Top Condenser", PosX=0.66, PosY=0); |
---|
2069 | out LiquidDistillate as liquid_stream (Brief="Liquid outlet stream From Top Splitter", PosX=1, PosY=0.20); |
---|
2070 | out BottomProduct as liquid_stream (Brief="Liquid outlet stream From Reboiler", PosX=0.68, PosY=1); |
---|
2071 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2072 | # Column Connectors |
---|
2073 | #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
---|
2074 | in ConnectorCondenserVout as stream (Brief="Connector for Vapour outlet stream From Top Condenser", Hidden=true); |
---|
2075 | in ConnectorSplitterOut as stream (Brief="Connector for Liquid outlet stream From Top Splitter", Hidden=true); |
---|
2076 | in ConnectorReboilerLout as stream (Brief="Connector for Liquid outlet stream From Reboiler", Hidden=true); |
---|
2077 | ConnectorHeatReboiler as power (Brief="Heat supplied to Reboiler", Hidden=true); |
---|
2078 | ConnectorHeatCondenser as power (Brief="Heat supplied to Condenser", Hidden=true); |
---|
2079 | |
---|
2080 | CONNECTIONS |
---|
2081 | |
---|
2082 | #vapor |
---|
2083 | REBOILER.OutletVapour to STAGES(NumberOfStages).InletVapour; |
---|
2084 | STAGES(1).OutletVapour to CONDENSER.InletVapour; |
---|
2085 | |
---|
2086 | #liquid |
---|
2087 | CONDENSER.OutletLiquid to SPLITTER.Inlet; |
---|
2088 | SPLITTER.Outlet2 to PUMP.Inlet; |
---|
2089 | PUMP.Outlet to STAGES(1).InletLiquid; |
---|
2090 | STAGES(NumberOfStages).OutletLiquid to REBOILER.InletLiquid; |
---|
2091 | |
---|
2092 | #Connectors |
---|
2093 | ConnectorHeatReboiler to REBOILER.InletQ; |
---|
2094 | ConnectorHeatCondenser to CONDENSER.InletQ; |
---|
2095 | |
---|
2096 | CONDENSER.OutletVapour to ConnectorCondenserVout; |
---|
2097 | SPLITTER.Outlet1 to ConnectorSplitterOut; |
---|
2098 | REBOILER.OutletLiquid to ConnectorReboilerLout; |
---|
2099 | |
---|
2100 | EQUATIONS |
---|
2101 | HeatToReboiler = ConnectorHeatReboiler; |
---|
2102 | HeatToCondenser = ConnectorHeatCondenser; |
---|
2103 | |
---|
2104 | # Condenser Connector Equations |
---|
2105 | ConnectorCondenserVout.T = VapourDistillate.T; |
---|
2106 | ConnectorCondenserVout.P = VapourDistillate.P; |
---|
2107 | ConnectorCondenserVout.F = VapourDistillate.F; |
---|
2108 | ConnectorCondenserVout.z = VapourDistillate.z; |
---|
2109 | |
---|
2110 | # Splitter Connector Equations |
---|
2111 | ConnectorSplitterOut.T = LiquidDistillate.T; |
---|
2112 | ConnectorSplitterOut.P = LiquidDistillate.P; |
---|
2113 | ConnectorSplitterOut.F = LiquidDistillate.F; |
---|
2114 | ConnectorSplitterOut.z = LiquidDistillate.z; |
---|
2115 | |
---|
2116 | # Reboiler Connector Equations |
---|
2117 | ConnectorReboilerLout.T = BottomProduct.T; |
---|
2118 | ConnectorReboilerLout.P = BottomProduct.P; |
---|
2119 | ConnectorReboilerLout.F = BottomProduct.F; |
---|
2120 | ConnectorReboilerLout.z = BottomProduct.z; |
---|
2121 | |
---|
2122 | switch VapourFlow |
---|
2123 | case "on": |
---|
2124 | STAGES(NumberOfStages).InletVapour.F*STAGES(NumberOfStages).vV = sqrt((REBOILER.OutletVapour.P - STAGES(NumberOfStages).OutletVapour.P)/ |
---|
2125 | (STAGES(NumberOfStages).rhoV*ResistanceCoeff*20))*(ColumnArea*VoidFraction - STAGES(NumberOfStages).Al); |
---|
2126 | when STAGES(NumberOfStages).InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
2127 | |
---|
2128 | case "off": |
---|
2129 | STAGES(NumberOfStages).InletVapour.F = 0 * 'mol/s'; |
---|
2130 | when REBOILER.OutletVapour.P > STAGES(NumberOfStages).OutletVapour.P + 1e-1 * 'atm' switchto "on"; |
---|
2131 | end |
---|
2132 | |
---|
2133 | end |
---|
2134 | |
---|