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

Last change on this file since 627 was 555, checked in by Rafael de Pelegrini Soares, 14 years ago

Updating the models to be usable by the gui

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.6 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: OutletV.F and OutletL.F;
39* the heat supply.
40       
41== Initial Conditions ==
42
43* the reboiler temperature (OutletL.T);
44* the reboiler liquid level (Level);
45* (NoComps - 1) OutletL (OR OutletV) compositions.
46";     
47       
48        PARAMETERS
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        VARIABLES
55in      Inlet as stream(Brief="Feed Stream", PosX=0.8127, PosY=0, Symbol="_{in}");
56in      InletL as stream(Brief="Liquid inlet stream", PosX=0, PosY=0.5254, Symbol="_{inL}");
57out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}");
58out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}");
59in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
60
61        M(NComp) as mol (Brief="Molar Holdup in the tray");
62        ML as mol (Brief="Molar liquid holdup");
63        MV as mol (Brief="Molar vapour holdup");
64        E as energy (Brief="Total Energy Holdup on tray");
65        vL as volume_mol (Brief="Liquid Molar Volume");
66        vV as volume_mol (Brief="Vapour Molar volume");
67        Level as length (Brief="Level of liquid phase");
68        rhoV as dens_mass (Brief="Vapour Density");
69
70        EQUATIONS
71        "Component Molar Balance"
72        diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z
73                - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
74       
75        "Energy Balance"
76        diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h
77                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ;
78       
79        "Molar Holdup"
80        M = ML*OutletL.z + MV*OutletV.z;
81       
82        "Energy Holdup"
83        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
84       
85        "Mol fraction normalisation"
86        sum(OutletL.z)=1.0;
87        sum(OutletL.z)=sum(OutletV.z);
88
89        "Vapour Density"
90        rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z);
91
92        "Liquid Volume"
93        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
94       
95        "Vapour Volume"
96        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
97       
98        "Chemical Equilibrium"
99        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
100                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
101
102        "Mechanical Equilibrium"
103        OutletL.P = OutletV.P;
104       
105        "Thermal Equilibrium"
106        OutletL.T = OutletV.T;
107       
108        "Geometry Constraint"
109        V = ML*vL + MV*vV;
110       
111        "Level of liquid phase"
112        Level = ML*vL/Across;
113end
114
115#*----------------------------------------------------------------------
116* Model of a  Steady State reboiler with no thermodynamics equilibrium
117*---------------------------------------------------------------------*#
118Model reboilerSteady
119        ATTRIBUTES
120        Pallete         = true;
121        Icon            = "icon/ReboilerSteady";
122        Brief           = "Model of a  Steady State reboiler with no thermodynamics equilibrium - thermosyphon.";
123        Info            =
124"== Assumptions ==
125* perfect mixing of both phases;
126* no thermodynamics equilibrium;
127* no liquid entrainment in the vapour stream.
128       
129== Specify ==
130* the InletL stream;
131* the heat supply OR the outlet temperature (OutletV.T);
132";     
133
134        PARAMETERS
135        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
136        outer NComp as Integer;
137        DP as press_delta (Brief="Pressure Drop in the reboiler");
138
139        VARIABLES
140in      InletL as stream(Brief="Liquid inlet stream", PosX=0.3345, PosY=1, Symbol="_{inL}");
141out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.3369, PosY=0, Symbol="_{outV}");
142in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
143        vV as volume_mol (Brief="Vapour Molar volume");
144        rhoV as dens_mass (Brief="Vapour Density");
145
146        EQUATIONS
147        "Molar Balance"
148        InletL.F = OutletV.F;
149        InletL.z = OutletV.z;
150       
151        "Vapour Volume"
152        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
153       
154        "Vapour Density"
155        rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z);
156
157        "Energy Balance"
158        InletL.F*InletL.h + InletQ = OutletV.F*OutletV.h;
159       
160        "Pressure"
161        DP = InletL.P - OutletV.P;
162end
163
164#*----------------------------------------------------------------------
165* Model of a  Steady State reboiler with fake calculation of
166* vaporisation fraction and output temperature, but with a real
167* calculation of the output stream enthalpy
168*---------------------------------------------------------------------*#
169Model reboilerSteady_fakeH
170        ATTRIBUTES
171        Pallete         = true;
172        Icon            = "icon/ReboilerSteady";
173        Brief           = "Model of a  Steady State reboiler with fake calculation of outlet conditions.";
174        Info            =
175"Model of a  Steady State reboiler with fake calculation of
176vaporisation fraction and output temperature, but with a real
177calculation of the output stream enthalpy.
178";
179       
180        PARAMETERS
181        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
182        outer NComp as Integer;
183        DP as press_delta (Brief="Pressure Drop in the reboiler");
184        k as Real (Brief = "Flow Constant", Unit='mol/J');
185       
186        VARIABLES
187in      InletL as stream(Brief="Liquid inlet stream", PosX=0.3345, PosY=1, Symbol="_{inL}");
188out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.3369, PosY=0, Symbol="_{outV}");
189in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6111, Symbol="_{in}");
190
191        EQUATIONS
192        "Molar Balance"
193        InletL.F = OutletV.F;
194        InletL.z = OutletV.z;
195       
196        "Energy Balance"
197        InletL.F*InletL.h + InletQ = OutletV.F*OutletV.h;
198       
199        "Pressure"
200        DP = InletL.P - OutletV.P;
201
202        "Fake Vapourisation Fraction"
203        OutletV.v = 1.0;
204       
205        "Fake output temperature"
206        OutletV.T = 300*'K';
207       
208        "Pressure Drop through the reboiler"
209        OutletV.F = k*InletQ;
210end
211
212#*-------------------------------------------------------------------
213* Model of a dynamic reboiler with reaction
214*-------------------------------------------------------------------*#
215Model reboilerReact
216        ATTRIBUTES
217        Pallete         = true;
218        Icon            = "icon/Reboiler";
219        Brief           = "Model of a dynamic reboiler with reaction.";
220        Info            =
221"== Assumptions ==
222* perfect mixing of both phases;
223* thermodynamics equilibrium;
224* no liquid entrainment in the vapour stream;
225* the reaction takes place only in the liquid phase.
226       
227== Specify ==
228* the kinetics variables;
229* the inlet stream;
230* the liquid inlet stream;
231* the outlet flows: OutletV.F and OutletL.F;
232* the heat supply.
233
234== Initial Conditions ==
235* the reboiler temperature (OutletL.T);
236* the reboiler liquid level (Level);
237* (NoComps - 1) OutletL (OR OutletV) compositions.
238";
239       
240        PARAMETERS
241        outer PP as Plugin(Type="PP");
242        outer NComp as Integer;
243        Across as area (Brief="Cross Section Area of reboiler");
244        V as volume (Brief="Total volume of reboiler");
245
246        stoic(NComp) as Real(Brief="Stoichiometric matrix");
247        Hr as energy_mol;
248        Pstartup as pressure;
249
250        VARIABLES
251in      Inlet as stream(Brief="Feed Stream", PosX=0.8127, PosY=0, Symbol="_{in}");
252in      InletL as stream(Brief="Liquid inlet stream", PosX=0, PosY=0.5254, Symbol="_{inL}");
253out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}");
254out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}");
255in      InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}");
256
257        M(NComp) as mol (Brief="Molar Holdup in the tray");
258        ML as mol (Brief="Molar liquid holdup");
259        MV as mol (Brief="Molar vapour holdup");
260        E as energy (Brief="Total Energy Holdup on tray");
261        vL as volume_mol (Brief="Liquid Molar Volume");
262        vV as volume_mol (Brief="Vapour Molar volume");
263        Level as length (Brief="Level of liquid phase");
264        Vol as volume;
265        startup as Real;
266        rhoV as dens_mass;
267        r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
268        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1);
269
270        EQUATIONS
271        "Molar Concentration"
272        OutletL.z = vL * C;
273       
274        "Reaction"
275        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s';
276
277        "Component Molar Balance"
278        diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z
279                - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL;
280       
281        "Energy Balance"
282        diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h
283                - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ + Hr * r3 * vL*ML;
284       
285        "Molar Holdup"
286        M = ML*OutletL.z + MV*OutletV.z;
287       
288        "Energy Holdup"
289        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
290       
291        "Mol fraction normalisation"
292        sum(OutletL.z)=1.0;
293       
294        "Liquid Volume"
295        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
296        "Vapour Volume"
297        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); 
298        "Vapour Density"
299        rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z);
300       
301        "Level of liquid phase"
302        Level = ML*vL/Across;
303
304        Vol = ML*vL;
305       
306        "Mechanical Equilibrium"
307        OutletL.P = OutletV.P;
308       
309        "Thermal Equilibrium"
310        OutletL.T = OutletV.T; 
311       
312        "Geometry Constraint"
313        V = ML*vL + MV*vV;             
314
315        "Chemical Equilibrium"
316        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
317        PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
318
319        sum(OutletL.z)=sum(OutletV.z);
320       
321end
Note: See TracBrowser for help on using the repository browser.