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

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