source: branches/gui/eml/stage_separators/reboiler.mso @ 805

Last change on this file since 805 was 805, checked in by gerson bicca, 13 years ago

updates - added thermosyphon reboiler / fixed sump tank

File size: 14.9 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*----------------------------------------------------------------------
16* Author: Paula B. Staudt
17* $Id: reboiler.mso 555 2008-07-18 19:01:13Z rafael $
18*--------------------------------------------------------------------*#
19
20using "streams";
21
22Model reboilerSteady
23
24ATTRIBUTES
25        Pallete         = true;
26        Icon            = "icon/ReboilerSteady";
27        Brief           = "Model of a  Steady State reboiler with no thermodynamics equilibrium - thermosyphon.";
28        Info            =
29"== ASSUMPTIONS ==
30* perfect mixing of both phases;
31* no thermodynamics equilibrium;
32
33== SET ==
34* the pressure drop in the reboiler;
35
36== SPECIFY ==
37* the InletLiquid stream;
38* the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model)
39OR the outlet temperature (OutletVapour.T);
40
41== OPTIONAL ==
42* the reboiler model has two control ports
43** TI OutletVapour Temperature Indicator;
44** PI OutletVapour Pressure Indicator;
45";     
46
47PARAMETERS
48        outer PP                as Plugin               (Brief = "External Physical Properties", Type="PP");
49        outer NComp     as Integer              (Brief="Number of Components");
50        Pdrop                   as press_delta  (Brief="Pressure Drop in the reboiler", Symbol = "\Delta P");
51        FlowConstant                    as Real (Brief = "Flow Constant");
52        k                       as Real (Brief = "Flow Constant", Hidden = true, Unit='mol^3/(kg*m^2)');
53
54SET
55
56        k = 1*'mol^3/(kg*m^2)';
57       
58VARIABLES
59        in      InletLiquid     as stream                               (Brief="Liquid inlet stream", PosX=0.345, PosY=1, Symbol="_{inL}");
60        out     OutletVapour    as streamPH                             (Brief="Vapour outlet stream", PosX=0.17, PosY=0, Symbol="_{outV}");
61        in      InletQ                  as power                                (Brief="Heat supplied", PosX=1, PosY=0.08, Symbol="Q_{in}", Protected = true);
62        vV                              as volume_mol                   (Brief="Vapour Molar volume", Protected = true);
63        rhoV                    as dens_mass                    (Brief="Vapour Density", Symbol = "\rho", Protected = true);
64       
65        out     TI as control_signal    (Brief="Temperature  Indicator of Reboiler", Protected = true, PosX=0.44, PosY=0);
66        out     PI as control_signal    (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=0.35, PosY=0);
67
68EQUATIONS
69
70"Molar Flow Balance"
71        InletLiquid.F = OutletVapour.F;
72
73"Molar Composition Balance"
74        InletLiquid.z = OutletVapour.z;
75       
76"Vapour Volume"
77        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
78       
79"Vapour Density"
80        rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z);
81
82"Energy Balance"
83        InletLiquid.F*InletLiquid.h + InletQ = OutletVapour.F*OutletVapour.h;
84       
85"Pressure Drop"
86        OutletVapour.P = InletLiquid.P - Pdrop;
87
88"Temperature indicator"
89        TI * 'K' = OutletVapour.T;
90
91"Pressure indicator"
92        PI * 'atm' = OutletVapour.P;
93       
94"Flow through the reboiler"
95        OutletVapour.F^3 = FlowConstant*k*InletQ;
96
97end
98
99Model thermosyphon
100
101ATTRIBUTES
102        Pallete         = true;
103        Icon            = "icon/Thermosyphon";
104        Brief           = "Model of a  Steady State reboiler thermosyphon.";
105        Info            =
106"== ASSUMPTIONS ==
107* perfect mixing of both phases;
108* no thermodynamics equilibrium;
109
110== SET ==
111* the pressure drop in the reboiler;
112
113== SPECIFY ==
114* the InletLiquid stream;
115* the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model)
116OR the outlet temperature (OutletVapour.T);
117
118== OPTIONAL ==
119* the reboiler model has two control ports
120** TI OutletVapour Temperature Indicator;
121** PI OutletVapour Pressure Indicator;
122";     
123
124PARAMETERS
125        outer PP                as Plugin               (Brief = "External Physical Properties", Type="PP");
126        outer NComp     as Integer              (Brief="Number of Components");
127        Pdrop                   as press_delta  (Brief="Pressure Drop in the reboiler", Symbol = "\Delta P");
128        FlowConstant                    as Real (Brief = "Flow Constant");
129        k                       as Real (Brief = "Flow Constant", Hidden = true, Unit='mol^3/(kg*m^2)');
130
131SET
132
133        k = 1*'mol^3/(kg*m^2)';
134       
135VARIABLES
136        in      InletLiquid     as stream                               (Brief="Liquid inlet stream", PosX=0.44, PosY=1, Symbol="_{inL}");
137        out     OutletVapour    as streamPH                             (Brief="Vapour outlet stream", PosX=0, PosY=0.09, Symbol="_{outV}");
138        in      InletQ                  as power                                (Brief="Heat supplied", PosX=1, PosY=0.77, Symbol="Q_{in}", Protected = true);
139       
140        out     TI as control_signal    (Brief="Temperature  Indicator of Reboiler", Protected = true, PosX=1, PosY=0.57);
141        out     PI as control_signal    (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=1, PosY=0.35);
142
143EQUATIONS
144
145"Molar Flow Balance"
146        InletLiquid.F = OutletVapour.F;
147
148"Molar Composition Balance"
149        InletLiquid.z = OutletVapour.z;
150       
151"Energy Balance"
152        InletLiquid.F*InletLiquid.h + InletQ = OutletVapour.F*OutletVapour.h;
153       
154"Pressure Drop"
155        OutletVapour.P = InletLiquid.P - Pdrop;
156
157"Temperature indicator"
158        TI * 'K' = OutletVapour.T;
159
160"Pressure indicator"
161        PI * 'atm' = OutletVapour.P;
162       
163"Flow through the thermosyphon reboiler"
164        OutletVapour.F^3 = FlowConstant*k*InletQ;
165
166end
167
168Model reboilerSteady_fakeH
169
170        ATTRIBUTES
171        Pallete         = true;
172        Icon            = "icon/ReboilerSteady";
173        Brief           = "Model of a  Steady State reboiler with fake calculation of outlet conditions.";
174        Info            =
175"Model of a  Steady State reboiler with fake calculation of
176vaporisation fraction and output temperature, but with a real
177calculation of the output stream enthalpy.
178";
179       
180PARAMETERS
181        outer PP        as Plugin(Brief = "External Physical Properties", Type="PP");
182        outer NComp as Integer;
183        Pdrop           as press_delta  (Brief="Pressure Drop in the reboiler", Symbol = "\Delta P");
184        FlowConstant                    as Real (Brief = "Flow Constant");
185        k                       as Real (Brief = "Flow Constant", Hidden = true, Unit='mol/J');
186
187SET
188
189        k = 1*'mol/J';
190       
191VARIABLES
192        in      InletLiquid     as stream                               (Brief="Liquid inlet stream", PosX=0.345, PosY=1, Symbol="_{inL}");
193        out     OutletVapour    as stream                               (Brief="Vapour outlet stream", PosX=0.17, PosY=0, Symbol="_{outV}");
194        in      InletQ                  as power                                (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}", Protected = true);
195
196EQUATIONS
197
198"Molar Balance"
199        InletLiquid.F = OutletVapour.F;
200       
201"Composition Balance"
202        InletLiquid.z = OutletVapour.z;
203       
204"Energy Balance"
205        InletLiquid.F*InletLiquid.h + InletQ = OutletVapour.F*OutletVapour.h;
206       
207"Pressure Drop"
208        OutletVapour.P = InletLiquid.P - Pdrop ;
209
210"Fake Vapourisation Fraction"
211        OutletVapour.v = 0.6;
212"Fake output temperature"
213        OutletVapour.T = 300*'K';
214       
215        #OutletVapour.v = PP.VapourFraction(OutletVapour.T, OutletVapour.P, OutletVapour.z);
216        #OutletVapour.h = OutletVapor.v * PP.VapourEnthalpy(OutletVapour.T, OutletVapour.P, OutletVapour.z)
217        #       +  (1-OutletVapor.v) * PP.LiquidEnthalpy(OutletVapour.T, OutletVapour.P, OutletVapour.z)
218
219"Flow through the reboiler"
220        OutletVapour.F = FlowConstant*k*InletQ;
221
222end
223
224Model reboilerReact
225        ATTRIBUTES
226        Pallete         = false;
227        Icon            = "icon/Reboiler";
228        Brief           = "Model of a dynamic reboiler with reaction.";
229        Info            =
230"== Assumptions ==
231* perfect mixing of both phases;
232* thermodynamics equilibrium;
233* no liquid entrainment in the vapour stream;
234* the reaction takes place only in the liquid phase.
235       
236== Specify ==
237* the kinetics variables;
238* the inlet stream;
239* the liquid inlet stream;
240* the outlet flows: OutletVapour.F and OutletLiquid.F;
241* the heat supply.
242
243== Initial Conditions ==
244* the reboiler temperature (OutletLiquid.T);
245* the reboiler liquid level (Level);
246* (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.
247";
248       
249PARAMETERS
250        outer PP as Plugin(Type="PP");
251        outer NComp as Integer;
252        Across as area (Brief="Cross Section Area of reboiler");
253        V as volume (Brief="Total volume of reboiler");
254
255        stoic(NComp) as Real(Brief="Stoichiometric matrix");
256        Hr as energy_mol;
257
258        Initial_Level                           as length               (Brief="Initial Level of liquid phase");
259        Initial_Temperature                     as temperature  (Brief="Initial Temperature of Reboiler");
260        Initial_Composition(NComp)      as fraction     (Brief="Initial Liquid Composition");
261       
262VARIABLES
263in      InletLiquid     as stream                       (Brief="Liquid inlet stream", PosX=0, PosY=0.5254, Symbol="_{inL}");
264out     OutletLiquid as liquid_stream   (Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}");
265out     OutletVapour as vapour_stream   (Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}");
266        InletQ  as power                        (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
267
268        M(NComp)        as mol                  (Brief="Molar Holdup in the tray");
269        ML                      as mol                  (Brief="Molar liquid holdup");
270        MV                      as mol                  (Brief="Molar vapour holdup");
271        E                       as energy               (Brief="Total Energy Holdup on tray");
272        vL                      as volume_mol   (Brief="Liquid Molar Volume");
273        vV                      as volume_mol   (Brief="Vapour Molar volume");
274        Level           as length               (Brief="Level of liquid phase");
275        Vol             as volume;
276        rhoV            as dens_mass;
277        r3                      as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
278        C(NComp)        as conc_mol     (Brief = "Molar concentration", Lower = -1);
279
280INITIAL
281
282        Level                                   = Initial_Level;
283        OutletLiquid.T                          = Initial_Temperature;
284        OutletLiquid.z(1:NComp-1)       = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
285
286EQUATIONS
287"Molar Concentration"
288        OutletLiquid.z = vL * C;
289       
290"Reaction"
291        r3 = exp(-7150*'K'/OutletLiquid.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s';
292
293"Component Molar Balance"
294        diff(M)= InletLiquid.F*InletLiquid.z- OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z + stoic*r3*ML*vL;
295       
296"Energy Balance"
297        diff(E) = InletLiquid.F*InletLiquid.h- OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h + InletQ + Hr * r3 * vL*ML;
298       
299"Molar Holdup"
300        M = ML*OutletLiquid.z + MV*OutletVapour.z;
301       
302"Energy Holdup"
303        E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*V;
304       
305"Mol fraction normalisation"
306        sum(OutletLiquid.z)=1.0;
307       
308"Liquid Volume"
309        vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
310
311"Vapour Volume"
312        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);   
313
314"Vapour Density"
315        rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z);
316       
317"Level of liquid phase"
318        Level = ML*vL/Across;
319
320        Vol = ML*vL;
321       
322"Mechanical Equilibrium"
323        OutletLiquid.P = OutletVapour.P;
324       
325"Thermal Equilibrium"
326        OutletLiquid.T = OutletVapour.T;       
327       
328"Geometry Constraint"
329        V = ML*vL + MV*vV;             
330
331"Chemical Equilibrium"
332        PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =
333        PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;
334
335        sum(OutletLiquid.z)=sum(OutletVapour.z);
336       
337end
338
339Model reboiler
340       
341ATTRIBUTES
342        Pallete = true;
343        Icon    = "icon/Reboiler";
344        Brief   = "Model of a dynamic reboiler - kettle with control.";
345        Info            =
346"== ASSUMPTIONS ==
347
348* perfect mixing of both phases;
349* thermodynamics equilibrium;
350* no liquid entrainment in the vapour stream.
351       
352== SPECIFY ==
353
354* the InletLiquid stream;
355* the outlet flows: OutletVapour.F and OutletLiquid.F;
356* the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model).
357
358== OPTIONAL ==
359* the reboiler model has three control ports
360** TI OutletLiquid Temperature Indicator;
361** PI OutletLiquid Pressure Indicator;
362** LI Level Indicator of Reboiler;
363
364== INITIAL CONDITIONS ==
365
366* Initial_Temperature :  the reboiler temperature (OutletLiquid.T);
367* Initial_Level : the reboiler liquid level (Level);
368* Initial_Composition : (NoComps) OutletLiquid compositions.
369";     
370       
371PARAMETERS
372        outer PP                as Plugin       (Brief = "External Physical Properties", Type="PP");
373        outer NComp     as Integer      (Brief="Number of Components");
374        Across                  as area         (Brief="Cross Section Area of reboiler");
375        V                               as volume       (Brief="Total volume of reboiler");
376       
377        Initial_Level                           as length               (Brief="Initial Level of liquid phase");
378        Initial_Temperature                     as temperature  (Brief="Initial Temperature of Reboiler");
379        Initial_Composition(NComp)      as positive     (Brief="Initial Liquid Composition",Lower=1E-6);
380
381VARIABLES
382
383in      InletLiquid     as stream                       (Brief="Liquid inlet stream", PosX=0.17, PosY=1, Symbol="_{in}^{Liquid}");
384out     OutletLiquid    as liquid_stream        (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}");
385out     OutletVapour    as vapour_stream        (Brief="Vapour outlet stream", PosX=0.17, PosY=0, Symbol="_{out}^{Vapour}");
386in      InletQ                  as power                        (Brief="Heat supplied", Protected = true, PosX=1, PosY=0.08, Symbol="Q_{in}");
387
388        out     TI as control_signal    (Brief="Temperature  Indicator of Reboiler", Protected = true, PosX=0.44, PosY=0);
389        out     LI as control_signal    (Brief="Level Indicator of Reboiler", Protected = true, PosX=0.53, PosY=0);
390        out     PI as control_signal    (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=0.35, PosY=0);
391       
392        M(NComp)        as mol                  (Brief="Molar Holdup in the tray", Protected = true);
393        ML                      as mol                  (Brief="Molar liquid holdup", Protected = true);
394        MV                      as mol                  (Brief="Molar vapour holdup", Protected = true);
395        E                       as energy               (Brief="Total Energy Holdup on tray", Protected = true);
396        vL                      as volume_mol   (Brief="Liquid Molar Volume", Protected = true);
397        vV                      as volume_mol   (Brief="Vapour Molar volume", Protected = true);
398        rhoV            as dens_mass    (Brief="Vapour Density", Protected = true, Symbol="\rho");
399        Level           as length               (Brief="Level of liquid phase", Protected = true);
400        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true);
401
402INITIAL
403
404"Initial Level"
405        Level   = Initial_Level;
406
407"Initial Temperature"
408        OutletLiquid.T  = Initial_Temperature;
409
410"Initial Composition"
411        OutletLiquid.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
412
413EQUATIONS
414
415"Component Molar Balance"
416        diff(M)= InletLiquid.F*InletLiquid.z    - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z;
417
418"Energy Balance"
419        diff(E) = InletLiquid.F*InletLiquid.h   - OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h + InletQ;
420
421"Molar Holdup"
422        M = ML*OutletLiquid.z + MV*OutletVapour.z;
423
424"Energy Holdup"
425        E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*V;
426
427"Mol Fraction Normalisation"
428        sum(OutletLiquid.z)=1.0;
429
430"Mol fraction Constraint"
431        sum(OutletLiquid.z)=sum(OutletVapour.z);
432
433"Vapour Density"
434        rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z);
435
436"Liquid Volume"
437        vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
438
439"Vapour Volume"
440        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
441
442"Chemical Equilibrium"
443        PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;
444
445"Mechanical Equilibrium"
446        OutletLiquid.P = OutletVapour.P;
447
448"Thermal Equilibrium"
449        OutletLiquid.T = OutletVapour.T;
450
451"Pressure Drop"
452        OutletLiquid.P  = InletLiquid.P - Pdrop;
453
454"Geometry Constraint"
455        V = ML*vL + MV*vV;
456
457"Level of liquid phase"
458        Level = ML*vL/Across;
459
460"Temperature Indicator"
461        TI * 'K' = OutletLiquid.T;
462
463"Pressure Indicator"
464        PI * 'atm' = OutletLiquid.P;
465
466"Level indicator"
467        LI*V = Level*Across;
468
469end
Note: See TracBrowser for help on using the repository browser.