source: branches/gui/eml/stage_separators/condenser.mso @ 698

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

added heat_flow model for control purposes - starting to modify the reactive distillation column (BRANCH)

File size: 7.3 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 condenser
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
125PARAMETERS
126        outer PP                as Plugin       (Brief = "External Physical Properties", Type="PP");
127        outer NComp as Integer;
128
129VARIABLES
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",Default=0);
134
135EQUATIONS
136
137"Molar Balance"
138        InletV.F = OutletL.F;
139        InletV.z = OutletL.z;
140
141"Energy Balance"
142        InletV.F*InletV.h = OutletL.F*OutletL.h + InletQ;
143
144"Pressure"
145        DP = InletV.P - OutletL.P;
146
147end
148
149#*-------------------------------------------------------------------
150* Condenser with reaction in liquid phase
151*--------------------------------------------------------------------*#
152Model condenserReact
153        ATTRIBUTES
154        Pallete         = true;
155        Icon            = "icon/Condenser";
156        Brief           = "Model of a Condenser with reaction in liquid phase.";
157        Info            =
158"== Assumptions ==
159* perfect mixing of both phases;
160* thermodynamics equilibrium;
161* the reaction only takes place in liquid phase.
162       
163== Specify ==
164* the reaction related variables;
165* the inlet stream;
166* the outlet flows: OutletV.F and OutletL.F;
167* the heat supply.
168
169== Initial Conditions ==
170* the condenser temperature (OutletL.T);
171* the condenser liquid level (Level);
172* (NoComps - 1) OutletL (OR OutletV) compositions.
173";
174       
175        PARAMETERS
176        outer PP as Plugin(Type="PP");
177        outer NComp as Integer;
178        V as volume (Brief="Condenser total volume");
179        Across as area (Brief="Cross Section Area of reboiler");
180
181        stoic(NComp) as Real(Brief="Stoichiometric matrix");
182        Hr as energy_mol;
183        Pstartup as pressure;
184
185        VARIABLES
186in      InletV as stream(Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}");
187out     OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}");
188out     OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}");
189        InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}");
190
191        M(NComp) as mol (Brief="Molar Holdup in the tray");
192        ML as mol (Brief="Molar liquid holdup");
193        MV as mol (Brief="Molar vapour holdup");
194        E as energy (Brief="Total Energy Holdup on tray");
195        vL as volume_mol (Brief="Liquid Molar Volume");
196        vV as volume_mol (Brief="Vapour Molar volume");
197        Level as length (Brief="Level of liquid phase");
198        Vol as volume;
199        r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s');
200        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1);
201
202        EQUATIONS
203        "Molar Concentration"
204        OutletL.z = vL * C;
205       
206        "Reaction"
207        r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s';
208       
209        "Component Molar Balance"
210        diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z
211                                - OutletV.F*OutletV.z + stoic*r3*ML*vL;
212
213        "Energy Balance"
214        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h
215                                - OutletV.F*OutletV.h + InletQ + Hr * r3 * ML*vL;
216
217        "Molar Holdup"
218        M = ML*OutletL.z + MV*OutletV.z;
219       
220        "Energy Holdup"
221        E = ML*OutletL.h + MV*OutletV.h - OutletV.P*V;
222       
223        "Mol fraction normalisation"
224        sum(OutletL.z)=1.0;
225
226        "Liquid Volume"
227        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
228        "Vapour Volume"
229        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
230
231        "Thermal Equilibrium"
232        OutletL.T = OutletV.T;
233
234        "Mechanical Equilibrium"
235        OutletV.P = OutletL.P;
236
237        "Geometry Constraint"
238        V = ML*vL + MV*vV;
239
240        Vol = ML*vL;
241       
242        "Level of liquid phase"
243        Level = ML*vL/Across;
244       
245        "Chemical Equilibrium"
246        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
247        PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
248
249        sum(OutletL.z)=sum(OutletV.z);
250
251end
Note: See TracBrowser for help on using the repository browser.