source: trunk/eml/stage_separators/tank.mso @ 127

Last change on this file since 127 was 127, checked in by Paula Bettio Staudt, 15 years ago

Fixed geometric constraint equation in tank_cylindrical model

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 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 tanks
17*--------------------------------------------------------------------
18*       Streams:
19*               * an inlet stream
20*               * an outlet stream
21*
22*       Specify:
23*               * the Inlet stream
24*               * the Outlet flow
25*               * the tank Q
26*
27*       Initial:
28*               * the tank temperature (OutletL.T)
29*               * the tank level (h)
30*               * (NoComps - 1) Outlet compositions
31*----------------------------------------------------------------------
32* Author: Paula B. Staudt
33* $Id: tank.mso 127 2007-01-23 18:21:08Z paula $
34*--------------------------------------------------------------------*#
35
36using "streams";
37
38Model tank
39
40        PARAMETERS
41ext PP as CalcObject;
42ext NComp as Integer;
43        Across as area (Brief="Tank cross section area", Default=2);
44       
45        VARIABLES
46in      Inlet as stream;
47out     Outlet as stream_therm;
48
49in      Q as heat_rate (Brief="Rate of heat supply");
50        Level    as length(Brief="Tank level");
51        M(NComp) as mol (Brief="Molar Holdup in the tank");
52        E as energy (Brief="Total Energy Holdup on tank");
53        vL as volume_mol (Brief="Liquid Molar Volume");
54
55        EQUATIONS
56        "Mass balance"
57        diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
58       
59        "Energy balance"
60        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
61
62        "Energy Holdup"
63        E = sum(M)*Outlet.h;
64
65        "Mechanical Equilibrium"
66        Inlet.P = Outlet.P;
67       
68        "Liquid Volume"
69        vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
70       
71        "Composition"
72        M = Outlet.z*sum(M);
73       
74        "Level of liquid phase"
75        Level = sum(M)*vL/Across;
76       
77        "Vapourisation Fraction"
78        Outlet.v = Inlet.v;
79end
80
81#*----------------------------------------------------------
82*
83*Model of a tank with a lain cylinder geometry
84*
85*---------------------------------------------------------*#
86Model tank_cylindrical
87
88        PARAMETERS
89ext PP as CalcObject;
90ext NComp as Integer;
91        radius as length(Brief="Tank radius");
92        L as length(Brief="Tank length");
93       
94        VARIABLES
95in      Inlet as stream;
96out     Outlet as stream_therm;
97
98in      Q as heat_rate (Brief="Rate of heat supply");
99        Level    as length(Brief="Tank level");
100        Across as area (Brief="Tank cross section area", Default=2);
101        M(NComp) as mol (Brief="Molar Holdup in the tank");
102        E as energy (Brief="Total Energy Holdup on tank");
103        vL as volume_mol (Brief="Liquid Molar Volume");
104
105        EQUATIONS
106        "Mass balance"
107        diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
108       
109        "Energy balance"
110        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
111
112        "Energy Holdup"
113        E = sum(M)*Outlet.h;
114       
115        "Mechanical Equilibrium"
116        Inlet.P = Outlet.P;
117       
118        "Liquid Volume"
119        vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
120       
121        "Composition"
122        M = Outlet.z*sum(M);
123       
124        "Cylindrical Area"
125        Across = radius^2 * (asin(1) - asin((radius-Level)/radius) ) +
126                                (Level-radius)*sqrt(Level*(2*radius - Level));
127
128        "Level of liquid phase"
129        L*Across = sum(M)*vL;
130       
131        "Vapourisation Fraction"
132        Outlet.v = Inlet.v;
133end
134
135Model tank_simplified
136        PARAMETERS
137        k as Real (Brief="Valve Constant", Unit = "m^2.5/h", Default=4);
138        A as area (Brief="Tank area", Default=2);
139
140        VARIABLES
141        h    as length(Brief="Tank level");
142in      Fin  as flow_vol(Brief="Input flow");
143out     Fout as flow_vol(Brief="Output flow");
144
145        EQUATIONS
146        "Mass balance"
147        diff(A*h) = Fin - Fout;
148       
149        "Valve equation"
150        Fout = k*sqrt(h);               
151end
152
153Model tank_feed
154
155        PARAMETERS
156ext PP as CalcObject;
157ext NComp as Integer;
158        Across as area (Brief="Tank cross section area", Default=2);
159       
160        VARIABLES
161in      Feed as stream;
162in      Inlet as stream;
163out     Outlet as stream_therm;
164
165in      Q as heat_rate (Brief="Rate of heat supply");
166        Level    as length(Brief="Tank level");
167        M(NComp) as mol (Brief="Molar Holdup in the tank");
168        E as energy (Brief="Total Energy Holdup on tank");
169        vL as volume_mol (Brief="Liquid Molar Volume");
170
171        EQUATIONS
172        "Mass balance"
173        diff(M) = Feed.F*Feed.z + Inlet.F*Inlet.z - Outlet.F*Outlet.z;
174       
175        "Energy balance"
176        diff(E) = Feed.F*Feed.h + Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
177
178        "Energy Holdup"
179        E = sum(M)*Outlet.h;
180
181        "Mechanical Equilibrium"
182        Inlet.P = Outlet.P;
183       
184        "Liquid Volume"
185        vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
186       
187        "Composition"
188        M = Outlet.z*sum(M);
189       
190        "Level of liquid phase"
191        Level = sum(M)*vL/Across;
192       
193        "Vapourisation Fraction"
194        Outlet.v = Inlet.v;
195       
196end
Note: See TracBrowser for help on using the repository browser.