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

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

updates

File size: 15.2 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 reboiler
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_column
343       
344ATTRIBUTES
345        Pallete         = true;
346        Icon            = "icon/reboiler_column";
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 liquid inlet stream;
358* the outlet flows: OutletVapour.F and OutletLiquid.F;
359* the model requires an energy stream.
360       
361== Initial Conditions ==
362
363* Initial_Temperature :  the reboiler temperature (OutletLiquid.T);
364* Initial_Level : the reboiler liquid level (Level);
365* Initial_Composition : (NoComps) OutletLiquid compositions.
366";     
367       
368PARAMETERS
369        outer PP                        as Plugin               (Brief = "External Physical Properties", Type="PP");
370        outer NComp     as Integer      (Brief="Number of Components");
371        Across                          as area                 (Brief="Cross Section Area of reboiler");
372        V                                               as volume       (Brief="Total volume of reboiler");
373       
374        Initial_Level                                                           as length                               (Brief="Initial Level of liquid phase");
375        Initial_Temperature                                     as temperature  (Brief="Initial Temperature of Reboiler");
376        Initial_Composition(NComp)      as positive                     (Brief="Initial Liquid Composition",Lower=1E-6);
377
378VARIABLES
379
380in      InletLiquid                     as stream                               (Brief="Liquid inlet stream", PosX=0, PosY=0.80, Symbol="_{inL}");
381out     OutletLiquid    as liquid_stream                (Brief="Liquid outlet stream", PosX=0.50, PosY=1, Symbol="_{outL}");
382out     OutletVapour    as vapour_stream        (Brief="Vapour outlet stream", PosX=0.50, PosY=0, Symbol="_{outV}");
383in      InletQ                  as power                                (Brief="Heat supplied", Protected = true, PosX=1, PosY=0.55, Symbol="_{in}");
384
385        out     TCI as control_signal   (Brief="Temperature  Indicator of Reboiler", Protected = true, PosX=1, PosY=0.40);
386        out     LCI as control_signal   (Brief="Level Indicator of Reboiler", Protected = true, PosX=1, PosY=0.25);
387        out     PCI as control_signal   (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=1, PosY=0.10);
388       
389        M(NComp)        as mol                                  (Brief="Molar Holdup in the tray", Protected = true);
390        ML                              as mol                                  (Brief="Molar liquid holdup", Protected = true);
391        MV                              as mol                                  (Brief="Molar vapour holdup", Protected = true);
392        E                                       as energy                       (Brief="Total Energy Holdup on tray", Protected = true);
393        vL                              as volume_mol   (Brief="Liquid Molar Volume", Protected = true);
394        vV                              as volume_mol   (Brief="Vapour Molar volume", Protected = true);
395        rhoV                    as dens_mass            (Brief="Vapour Density", Protected = true);
396        Level                   as length                               (Brief="Level of liquid phase", Protected = true);
397        Pdrop                   as press_delta          (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true);
398
399INITIAL
400
401        Level                                                                           = Initial_Level;
402        OutletLiquid.T                                                  = Initial_Temperature;
403        OutletLiquid.z(1:NComp-1)       = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
404
405EQUATIONS
406"Component Molar Balance"
407        diff(M)= InletLiquid.F*InletLiquid.z    - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z;
408
409"Energy Balance"
410        diff(E) = InletLiquid.F*InletLiquid.h   - OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h + InletQ;
411
412"Molar Holdup"
413        M = ML*OutletLiquid.z + MV*OutletVapour.z;
414
415"Energy Holdup"
416        E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*V;
417
418"Mol Fraction Normalisation"
419        sum(OutletLiquid.z)=1.0;
420
421"Mol fraction Constraint"
422        sum(OutletLiquid.z)=sum(OutletVapour.z);
423
424"Vapour Density"
425        rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z);
426
427"Liquid Volume"
428        vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
429
430"Vapour Volume"
431        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
432
433"Chemical Equilibrium"
434        PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;
435
436"Mechanical Equilibrium"
437        OutletLiquid.P = OutletVapour.P;
438
439"Thermal Equilibrium"
440        OutletLiquid.T = OutletVapour.T;
441
442"Pressure Drop"
443        OutletLiquid.P  = InletLiquid.P - Pdrop;
444
445"Geometry Constraint"
446        V = ML*vL + MV*vV;
447
448"Level of liquid phase"
449        Level = ML*vL/Across;
450
451"Temperature Indicator"
452        TCI * 'K' = OutletLiquid.T;
453
454"Pressure Indicator"
455        PCI * 'atm' = OutletLiquid.P;
456
457"Level indicator"
458        LCI*V = Level*Across;
459
460end
Note: See TracBrowser for help on using the repository browser.