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

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

updates

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