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

Last change on this file since 737 was 735, checked in by gerson bicca, 14 years ago

updates (some samples are obsoletes)

File size: 11.0 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        DP                                      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 Balance"
157        InletLiquid.F = OutletVapour.F;
158        InletLiquid.z = OutletVapour.z;
159       
160"Vapour Volume"
161        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);
162       
163"Vapour Density"
164        rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z);
165
166"Energy Balance"
167        InletLiquid.F*InletLiquid.h + InletQ = OutletVapour.F*OutletVapour.h;
168       
169"Pressure"
170        DP = InletLiquid.P - OutletVapour.P;
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
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}");
199in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
200
201        EQUATIONS
202        "Molar Balance"
203        InletLiquid.F = OutletVapour.F;
204        InletLiquid.z = OutletVapour.z;
205       
206        "Energy Balance"
207        InletLiquid.F*InletLiquid.h + InletQ = OutletVapour.F*OutletVapour.h;
208       
209        "Pressure"
210        DP = InletLiquid.P - OutletVapour.P;
211
212        "Fake Vapourisation Fraction"
213        OutletVapour.v = 1.0;
214       
215        "Fake output temperature"
216        OutletVapour.T = 300*'K';
217       
218        "Pressure Drop through the reboiler"
219        OutletVapour.F = k*InletQ;
220end
221
222#*-------------------------------------------------------------------
223* Model of a dynamic reboiler with reaction
224*-------------------------------------------------------------------*#
225Model reboilerReact
226        ATTRIBUTES
227        Pallete         = false;
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;
241* the outlet flows: OutletVapour.F and OutletLiquid.F;
242* the heat supply.
243
244== Initial Conditions ==
245* the reboiler temperature (OutletLiquid.T);
246* the reboiler liquid level (Level);
247* (NoComps - 1) OutletLiquid (OR OutletVapour) compositions.
248";
249       
250PARAMETERS
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
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
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}");
267        InletQ  as power                        (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
268
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);
280
281INITIAL
282
283        Level                                   = Initial_Level;
284        OutletLiquid.T                          = Initial_Temperature;
285        OutletLiquid.z(1:NComp-1)       = Initial_Composition(1:NComp-1)/sum(Initial_Composition);
286
287EQUATIONS
288"Molar Concentration"
289        OutletLiquid.z = vL * C;
290       
291"Reaction"
292        r3 = exp(-7150*'K'/OutletLiquid.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s';
293
294"Component Molar Balance"
295        diff(M)= InletLiquid.F*InletLiquid.z- OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z + stoic*r3*ML*vL;
296       
297"Energy Balance"
298        diff(E) = InletLiquid.F*InletLiquid.h- OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h + InletQ + Hr * r3 * vL*ML;
299       
300"Molar Holdup"
301        M = ML*OutletLiquid.z + MV*OutletVapour.z;
302       
303"Energy Holdup"
304        E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*V;
305       
306"Mol fraction normalisation"
307        sum(OutletLiquid.z)=1.0;
308       
309"Liquid Volume"
310        vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);
311
312"Vapour Volume"
313        vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);   
314
315"Vapour Density"
316        rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z);
317       
318"Level of liquid phase"
319        Level = ML*vL/Across;
320
321        Vol = ML*vL;
322       
323"Mechanical Equilibrium"
324        OutletLiquid.P = OutletVapour.P;
325       
326"Thermal Equilibrium"
327        OutletLiquid.T = OutletVapour.T;       
328       
329"Geometry Constraint"
330        V = ML*vL + MV*vV;             
331
332"Chemical Equilibrium"
333        PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =
334        PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;
335
336        sum(OutletLiquid.z)=sum(OutletVapour.z);
337       
338end
Note: See TracBrowser for help on using the repository browser.