source: branches/gui/eml/stage_separators/condenserTeste.mso @ 643

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

updates

File size: 7.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: condenser.mso 555 2008-07-18 19:01:13Z rafael $
18*--------------------------------------------------------------------*#
19
20using "streams";
21
22Model condenserTeste
23        ATTRIBUTES
24        Pallete         = true;
25        Icon            = "icon/Condenser";
26        Brief           = "Model of a dynamic condenser.";
27        Info            =
28"== Assumptions ==
29* perfect mixing of both phases;
30* thermodynamics equilibrium.
31       
32== Specify ==
33* the inlet stream;
34* the outlet flows: OutletV.F and OutletL.F;
35* the heat supply.
36       
37== Initial Conditions ==
38* the condenser temperature (OutletL.T);
39* the condenser liquid level (Level);
40* (NoComps - 1) OutletL (OR OutletV) compositions.
41";     
42       
43PARAMETERS
44        outer PP                        as Plugin       (Brief = "External Physical Properties", Type="PP");
45        outer NComp     as Integer;
46
47        V                       as volume       (Brief="Condenser total volume");
48        Across  as area                         (Brief="Cross Section Area of reboiler");
49
50VARIABLES
51in              InletV          as stream                               (Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}");
52out     OutletL         as liquid_stream                (Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");
53out     OutletV         as vapour_stream        (Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");
54in              InletQ          as power                                (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
55
56        M(NComp)        as mol                          (Brief="Molar Holdup in the tray");
57        ML                              as mol                          (Brief="Molar liquid holdup");
58        MV                              as mol                          (Brief="Molar vapour holdup");
59        E                                       as energy                       (Brief="Total Energy Holdup on tray");
60        vL                              as volume_mol   (Brief="Liquid Molar Volume");
61        vV                              as volume_mol   (Brief="Vapour Molar volume");
62        Level                   as length                       (Brief="Level of liquid phase");
63
64EQUATIONS
65"Component Molar Balance"
66        diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z- OutletV.F*OutletV.z;
67
68"Energy Balance"
69        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h- OutletV.F*OutletV.h + InletQ;
70
71"Molar Holdup"
72        M = ML*OutletL.z + MV*OutletV.z;
73       
74"Energy Holdup"
75        E = ML*OutletL.h + MV*OutletV.h - OutletV.P*V;
76       
77"Mol fraction normalisation"
78        sum(OutletL.z)=1.0;
79        sum(OutletL.z)=sum(OutletV.z);
80
81"Liquid Volume"
82        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
83       
84"Vapour Volume"
85        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
86
87"Chemical Equilibrium"
88        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
89                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
90
91"Thermal Equilibrium"
92        OutletL.T = OutletV.T;
93
94"Mechanical Equilibrium"
95        OutletV.P = OutletL.P;
96
97"Geometry Constraint"
98        V = ML*vL + MV*vV;
99
100"Level of liquid phase"
101        Level = ML*vL/Across;
102
103end
104
105
106#*----------------------------------------------------------------------
107* Model of a  Steady State condenser with no thermodynamics equilibrium
108*---------------------------------------------------------------------*#
109Model condenserSteady
110        ATTRIBUTES
111        Pallete         = true;
112        Icon            = "icon/CondenserSteady";
113        Brief           = "Model of a  Steady State condenser with no thermodynamics equilibrium.";
114        Info            =
115"== Assumptions ==
116* perfect mixing of both phases;
117* no thermodynamics equilibrium.
118       
119== Specify ==
120* the inlet stream;
121* the pressure drop in the condenser;
122* the heat supply.
123";
124       
125        PARAMETERS
126        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
127        outer NComp as Integer;
128
129        VARIABLES
130in      InletV as stream(Brief="Vapour inlet stream", PosX=0.3431, PosY=0, Symbol="_{inV}");
131out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.34375, PosY=1, Symbol="_{outL}");
132in      InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.5974, Symbol="_{in}");
133        DP as press_delta (Brief="Pressure Drop in the condenser");
134
135        EQUATIONS
136        "Molar Balance"
137        InletV.F = OutletL.F;
138        InletV.z = OutletL.z;
139               
140        "Energy Balance"
141        InletV.F*InletV.h = OutletL.F*OutletL.h + InletQ;
142       
143        "Pressure"
144        DP = InletV.P - OutletL.P;
145end
146
147#*-------------------------------------------------------------------
148* Condenser with reaction in liquid phase
149*--------------------------------------------------------------------*#
150Model condenserReact
151        ATTRIBUTES
152        Pallete         = true;
153        Icon            = "icon/Condenser";
154        Brief           = "Model of a Condenser with reaction in liquid phase.";
155        Info            =
156"== Assumptions ==
157* perfect mixing of both phases;
158* thermodynamics equilibrium;
159* the reaction only takes place in liquid phase.
160       
161== Specify ==
162* the reaction related variables;
163* the inlet stream;
164* the outlet flows: OutletV.F and OutletL.F;
165* the heat supply.
166
167== Initial Conditions ==
168* the condenser temperature (OutletL.T);
169* the condenser liquid level (Level);
170* (NoComps - 1) OutletL (OR OutletV) compositions.
171";
172       
173        PARAMETERS
174        outer PP as Plugin(Type="PP");
175        outer NComp as Integer;
176        V as volume (Brief="Condenser total volume");
177        Across as area (Brief="Cross Section Area of reboiler");
178
179        stoic(NComp) as Real(Brief="Stoichiometric matrix");
180        Hr as energy_mol;
181        Pstartup as pressure;
182
183        VARIABLES
184in      InletV as stream(Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}");
185out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");
186out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");
187in      InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
188
189        M(NComp) as mol (Brief="Molar Holdup in the tray");
190        ML as mol (Brief="Molar liquid holdup");
191        MV as mol (Brief="Molar vapour holdup");
192        E as energy (Brief="Total Energy Holdup on tray");
193        vL as volume_mol (Brief="Liquid Molar Volume");
194        vV as volume_mol (Brief="Vapour Molar volume");
195        Level as length (Brief="Level of liquid phase");
196        Vol as volume;
197        r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
198        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1);
199
200        EQUATIONS
201        "Molar Concentration"
202        OutletL.z = vL * C;
203       
204        "Reaction"
205        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s';
206       
207        "Component Molar Balance"
208        diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z
209                                - OutletV.F*OutletV.z + stoic*r3*ML*vL;
210
211        "Energy Balance"
212        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h
213                                - OutletV.F*OutletV.h + InletQ + Hr * r3 * ML*vL;
214
215        "Molar Holdup"
216        M = ML*OutletL.z + MV*OutletV.z;
217       
218        "Energy Holdup"
219        E = ML*OutletL.h + MV*OutletV.h - OutletV.P*V;
220       
221        "Mol fraction normalisation"
222        sum(OutletL.z)=1.0;
223
224        "Liquid Volume"
225        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
226        "Vapour Volume"
227        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
228
229        "Thermal Equilibrium"
230        OutletL.T = OutletV.T;
231
232        "Mechanical Equilibrium"
233        OutletV.P = OutletL.P;
234
235        "Geometry Constraint"
236        V = ML*vL + MV*vV;
237
238        Vol = ML*vL;
239       
240        "Level of liquid phase"
241        Level = ML*vL/Across;
242       
243        "Chemical Equilibrium"
244        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
245        PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
246
247        sum(OutletL.z)=sum(OutletV.z);
248
249end
Note: See TracBrowser for help on using the repository browser.