source: mso/eml/stage_separators/tank.mso @ 46

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

Stage separators modifications

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1#*-------------------------------------------------------------------
2* Model of tanks
3*--------------------------------------------------------------------
4*       Streams:
5*               * an inlet stream
6*               * an outlet stream
7*
8*       Specify:
9*               * the Inlet stream
10*               * the Outlet flow
11*               * the tank Q
12*
13*       Initial:
14*               * the tank temperature (OutletL.T)
15*               * the tank level (h)
16*               * (NoComps - 1) Outlet compositions
17*----------------------------------------------------------------------
18* Author: Paula B. Staudt
19* $Id: tank.mso 42 2006-10-26 19:44:05Z paula $
20*--------------------------------------------------------------------*#
21
22using "streams";
23
24Model tank
25
26        PARAMETERS
27ext PP as CalcObject;
28ext NComp as Integer;
29        Across as area (Brief="Tank cross section area", Default=2);
30       
31        VARIABLES
32in      Inlet as stream;
33out     Outlet as stream_therm;
34
35in      Q as heat_rate (Brief="Rate of heat supply");
36        Level    as length(Brief="Tank level");
37        M(NComp) as mol (Brief="Molar Holdup in the tank");
38        E as energy (Brief="Total Energy Holdup on tank");
39        vL as volume_mol (Brief="Liquid Molar Volume");
40
41        EQUATIONS
42        "Mass balance"
43        diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
44       
45        "Energy balance"
46        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
47
48        "Energy Holdup"
49        E = sum(M)*Outlet.h;
50
51        "Mechanical Equilibrium"
52        Inlet.P = Outlet.P;
53       
54        "Liquid Volume"
55        vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
56       
57        "Composition"
58        M = Outlet.z*sum(M);
59       
60        "Level of liquid phase"
61        Level = sum(M)*vL/Across;
62       
63        "Vapourisation Fraction"
64        Outlet.v = Inlet.v;
65end
66
67Model tank_cylindrical
68
69        PARAMETERS
70ext PP as CalcObject;
71ext NComp as Integer;
72        radius as length(Brief="Tank radius");
73        L as length(Brief="Tank length");
74       
75        VARIABLES
76in      Inlet as stream;
77out     Outlet as stream_therm;
78
79in      Q as heat_rate (Brief="Rate of heat supply");
80        Level    as length(Brief="Tank level");
81        Across as area (Brief="Tank cross section area", Default=2);
82        M(NComp) as mol (Brief="Molar Holdup in the tank");
83        E as energy (Brief="Total Energy Holdup on tank");
84        vL as volume_mol (Brief="Liquid Molar Volume");
85
86        EQUATIONS
87        "Mass balance"
88        diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z;
89       
90        "Energy balance"
91        diff(E) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + Q;
92
93        "Energy Holdup"
94        E = sum(M)*Outlet.h;
95       
96        "Mechanical Equilibrium"
97        Inlet.P = Outlet.P;
98       
99        "Liquid Volume"
100        vL = PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.z);
101       
102        "Composition"
103        M = Outlet.z*sum(M);
104       
105        "Cylindrical Area"
106        Across = radius^2 * (asin(1) - asin((radius-Level)/radius) ) +
107                                (Level-radius)*sqrt(Level*(2*radius - Level));
108
109        "Level of liquid phase"
110        Level = sum(M)*vL/Across;
111       
112        "Vapourisation Fraction"
113        Outlet.v = Inlet.v;
114end
115
116Model tank_simplified
117        PARAMETERS
118        k as Real (Brief="Valve Constant", Unit = "m^2.5/h", Default=4);
119        A as area (Brief="Tank area", Default=2);
120
121        VARIABLES
122        h    as length(Brief="Tank level");
123in      Fin  as flow_vol(Brief="Input flow");
124out     Fout as flow_vol(Brief="Output flow");
125
126        EQUATIONS
127        "Mass balance"
128        diff(A*h) = Fin - Fout;
129       
130        "Valve equation"
131        Fout = k*sqrt(h);               
132end
Note: See TracBrowser for help on using the repository browser.