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

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

fixed initial condition for Level indicator

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