source: mso/eml/stage_separators/flash.mso @ 1

Last change on this file since 1 was 1, checked in by Rafael de Pelegrini Soares, 16 years ago

Initial import of the library

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1#*-------------------------------------------------------------------
2* Model of a dynamic flash
3*--------------------------------------------------------------------
4*       - Streams
5*               * a liquid outlet stream
6*               * a vapour outlet stream
7*               * a feed stream
8*
9*       - Assumptions
10*               * both phases are perfectly mixed
11*
12*       - Specify:
13*               * the feed stream;
14*               * the outlet flows: OutletV.F and OutletL.F
15*
16*       - Initial:
17*               * the flash initial temperature (OutletL.T)
18*               * the flash initial liquid level (Ll)
19*               * (NoComps - 1) OutletL (OR OutletV) compositions
20*----------------------------------------------------------------------
21* Author: Paula B. Staudt
22* $Id: flash.mso 1 2006-06-20 17:33:53Z rafael $
23*--------------------------------------------------------------------*#
24
25using "streams";
26
27Model flash
28        PARAMETERS
29ext PP as CalcObject;
30ext NComp as Integer;
31        V as volume(Brief="Total Volume of the flash");
32        Mw(NComp) as molweight;
33        Across as area  (Brief="Flash Cross section area");
34       
35        SET
36        Mw=PP.MolecularWeight();
37       
38        VARIABLES
39in      Inlet as stream; #(Brief="Feed Stream");
40out     OutletL as stream_therm; #(Brief="Liquid outlet stream");
41out     OutletV as stream_therm; #(Brief="Vapour outlet stream");
42in      Q as heat_rate (Brief="Rate of heat supply");
43
44        M(NComp) as mol (Brief="Molar Holdup in the tray");
45        ML as mol (Brief="Molar liquid holdup");
46        MV as mol (Brief="Molar vapour holdup");
47        E as energy (Brief="Total Energy Holdup on tray");
48        vL as volume_mol (Brief="Liquid Molar Volume");
49        vV as volume_mol (Brief="Vapour Molar volume");
50        Level as length (Brief="liquid height");
51       
52        EQUATIONS
53        "Component Molar Balance"
54        diff(M)=Inlet.F*Inlet.z - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
55       
56        "Energy Balance"
57        diff(E) = Inlet.F*Inlet.h       - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q;
58       
59        "Molar Holdup"
60        M = ML*OutletL.z + MV*OutletV.z;
61       
62        "Energy Holdup"
63        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
64       
65        "Mol fraction normalisation"
66        sum(OutletL.z)=1.0;
67        "Mol fraction normalisation"
68        sum(OutletL.z)=sum(OutletV.z);
69       
70        "Liquid Volume"
71        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
72        "Vapour Volume"
73        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
74       
75        "Chemical Equilibrium"
76        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
77                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
78       
79        "Thermal Equilibrium"
80        OutletV.T = OutletL.T;
81       
82        "Mechanical Equilibrium"
83        OutletV.P = OutletL.P;
84       
85        "Geometry Constraint"
86        V = ML* vL + MV*vV;
87        "Liquid Level"
88        ML* vL = Across * Level;
89       
90        "vaporization fraction "
91        OutletV.v = 1.0;
92        "vaporization fraction "
93        OutletL.v = 0.0;
94
95end
96
97#*----------------------------------------------------------------------
98* Model of a  Steady State flash
99*---------------------------------------------------------------------*#
100Model flash_Steady
101        PARAMETERS
102ext PP as CalcObject;
103ext NComp as Integer;
104       
105        VARIABLES
106in      Inlet as stream; #(Brief="Feed Stream");
107out     OutletL as stream_therm; #(Brief="Liquid outlet stream");
108out     OutletV as stream_therm; #(Brief="Vapour outlet stream");
109in      Q as heat_rate (Brief="Rate of heat supply");
110        vfrac as fraction;
111
112        EQUATIONS
113        "The flash calculation"
114        [vfrac, OutletL.z, OutletV.z] = PP.Flash(OutletV.T, OutletV.P, Inlet.z);
115       
116        "Global Molar Balance"
117        Inlet.F = OutletV.F + OutletL.F;
118        OutletV.F = Inlet.F * vfrac;
119               
120        "Energy Balance"
121        Inlet.F*Inlet.h  + Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
122       
123        "Thermal Equilibrium"
124        OutletV.T = OutletL.T;
125       
126        "Mechanical Equilibrium"
127        OutletV.P = OutletL.P;
128       
129        "vaporization fraction "
130        OutletV.v = 1.0;
131        "vaporization fraction "
132        OutletL.v = 0.0;
133end
134
Note: See TracBrowser for help on using the repository browser.