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

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

added control ports for pressure control

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