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

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

added control ports for pressure control

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