source: branches/newlanguage/eml/stage_separators/condenser.mso @ 123

Last change on this file since 123 was 72, checked in by Paula Bettio Staudt, 16 years ago

Updated stage_separators file header and added headers template files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.9 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* Model of a dynamic condenser
17*--------------------------------------------------------------------
18*
19*       Streams:
20*               * a vapour inlet stream
21*               * a liquid outlet stream
22*
23*       Assumptions:
24*               * perfect mixing of both phases
25*               * thermodynamics equilibrium
26*
27*       Specify:
28*               * the Inlet stream
29*               * the Outlet flows
30*
31*       Initial:
32*               * the condenser temperature (OutletL.T)
33*               * the condenser level (Ll)
34*               * (NoComps - 1) Outlet compositions
35*
36*----------------------------------------------------------------------
37* Author: Paula B. Staudt
38* $Id: condenser.mso 72 2006-12-08 18:29:10Z paula $
39*--------------------------------------------------------------------*#
40
41using "streams";
42
43Model condenser
44        PARAMETERS
45ext PP as CalcObject;
46ext NComp as Integer;
47        V as volume (Brief="Condenser total volume");
48        Across as area (Brief="Cross Section Area of reboiler");
49
50        VARIABLES
51in      InletV as stream; #(Brief="Vapour inlet stream");
52out     OutletL as stream_therm; #(Brief="Liquid outlet stream");
53out     OutletV as stream_therm; #(Brief="Vapour outlet stream");
54in      Q as heat_rate (Brief="Heat supplied");
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
64        EQUATIONS
65        "Component Molar Balance"
66        diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z
67                                - OutletV.F*OutletV.z;
68
69        "Energy Balance"
70        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h
71                                - OutletV.F*OutletV.h + Q;
72
73        "Molar Holdup"
74        M = ML*OutletL.z + MV*OutletV.z;
75       
76        "Energy Holdup"
77        E = ML*OutletL.h + MV*OutletV.h - OutletV.P*V;
78       
79        "Mol fraction normalisation"
80        sum(OutletL.z)=1.0;
81        sum(OutletL.z)=sum(OutletV.z);
82
83        "Liquid Volume"
84        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
85        "Vapour Volume"
86        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
87
88        "Chemical Equilibrium"
89        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
90                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
91
92        "Thermal Equilibrium"
93        OutletL.T = OutletV.T;
94
95        "Mechanical Equilibrium"
96        OutletV.P = OutletL.P;
97
98        "Geometry Constraint"
99        V = ML*vL + MV*vV;
100
101        "Level of liquid phase"
102        Level = ML*vL/Across;
103       
104        "Vapourisation Fraction"
105        OutletL.v = 0.0;
106        OutletV.v = 1.0;
107end
108
109
110#*----------------------------------------------------------------------
111* Model of a  Steady State condenser with no thermodynamics equilibrium
112*---------------------------------------------------------------------*#
113Model condenserSteady
114        PARAMETERS
115ext PP as CalcObject;
116ext NComp as Integer;
117
118        VARIABLES
119in      InletV as stream; #(Brief="Vapour inlet stream");
120out     OutletL as stream_therm; #(Brief="Liquid outlet stream");
121in      Q as heat_rate (Brief="Heat supplied");
122        DP as press_delta (Brief="Pressure Drop in the condenser");
123
124        EQUATIONS
125        "Molar Balance"
126        InletV.F = OutletL.F;
127        InletV.z = OutletL.z;
128               
129        "Energy Balance"
130        InletV.F*InletV.h = OutletL.F*OutletL.h + Q;
131       
132        "Pressure"
133        DP = InletV.P - OutletL.P;
134
135        "Vapourisation Fraction"
136        OutletL.v = 0.0;
137end
138
139#*-------------------------------------------------------------------
140* Condenser with reaction in liquid phase
141*--------------------------------------------------------------------*#
142Model condenserReact
143        PARAMETERS
144ext PP as CalcObject;
145ext NComp as Integer;
146        V as volume (Brief="Condenser total volume");
147        Across as area (Brief="Cross Section Area of reboiler");
148
149        stoic(NComp) as Real(Brief="Stoichiometric matrix");
150        Hr as energy_mol;
151        Pstartup as pressure;
152
153        VARIABLES
154in      InletV as stream;                       #(Brief="Vapour inlet stream");
155out     OutletL as stream_therm;        #(Brief="Liquid outlet stream");
156out     OutletV as stream_therm;        #(Brief="Vapour outlet stream");
157
158        M(NComp) as mol (Brief="Molar Holdup in the tray");
159        ML as mol (Brief="Molar liquid holdup");
160        MV as mol (Brief="Molar vapour holdup");
161        E as energy (Brief="Total Energy Holdup on tray");
162        vL as volume_mol (Brief="Liquid Molar Volume");
163        vV as volume_mol (Brief="Vapour Molar volume");
164        Level as length (Brief="Level of liquid phase");
165        Q as heat_rate (Brief="Heat supplied");
166        Vol as volume;
167        r as reaction_mol (Brief = "Reaction rate", Unit = "mol/l/s");
168        C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1);
169
170        EQUATIONS
171        "Molar Concentration"
172        OutletL.z = vL * C;
173       
174        "Component Molar Balance"
175        diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z
176                                - OutletV.F*OutletV.z + stoic*r*ML*vL;
177
178        "Energy Balance"
179        diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h
180                                - OutletV.F*OutletV.h + Q + Hr * r * ML*vL;
181
182        "Molar Holdup"
183        M = ML*OutletL.z + MV*OutletV.z;
184       
185        "Energy Holdup"
186        E = ML*OutletL.h + MV*OutletV.h - OutletV.P*V;
187       
188        "Mol fraction normalisation"
189        sum(OutletL.z)=1.0;
190
191        "Liquid Volume"
192        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
193        "Vapour Volume"
194        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
195
196        "Thermal Equilibrium"
197        OutletL.T = OutletV.T;
198
199        "Mechanical Equilibrium"
200        OutletV.P = OutletL.P;
201
202        "Geometry Constraint"
203        V = ML*vL + MV*vV;
204
205        Vol = ML*vL;
206       
207        "Level of liquid phase"
208        Level = ML*vL/Across;
209       
210        "Vapourisation Fraction"
211        OutletL.v = 0.0;
212        OutletV.v = 1.0;
213       
214        "Chemical Equilibrium"
215        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
216        PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
217
218        sum(OutletL.z)=sum(OutletV.z);
219
220end
Note: See TracBrowser for help on using the repository browser.