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

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

updates

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