source: trunk/eml/stage_separators/flash.mso @ 262

Last change on this file since 262 was 235, checked in by Argimiro Resende Secchi, 16 years ago

Added orientation type (vertical and horizontal) into the flash model. "Across" is now a variable and "diameter" is a new parameter.

  • 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 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 235 2007-04-12 01:16:05Z arge $
37*--------------------------------------------------------------------*#
38
39using "streams";
40
41Model flash
42        PARAMETERS
43        outer PP as Plugin (Brief = "External Physical Properties", Type="PP");
44        outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);
45        V as volume (Brief="Total Volume of the flash");
46        Mw(NComp) as molweight;
47        orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical");
48        diameter as length (Brief="Vessel diameter");
49
50        SET
51        Mw=PP.MolecularWeight();
52
53        VARIABLES
54        in      Inlet as stream(Brief="Feed Stream");
55        out     OutletL as liquid_stream(Brief="Liquid outlet stream");
56        out     OutletV as vapour_stream(Brief="Vapour outlet stream");
57        in      Q as heat_rate (Brief="Rate of heat supply");
58
59        M(NComp) as mol (Brief="Molar Holdup in the tray");
60        ML as mol (Brief="Molar liquid holdup");
61        MV as mol (Brief="Molar vapour holdup");
62        E as energy (Brief="Total Energy Holdup on tray");
63        vL as volume_mol (Brief="Liquid Molar Volume");
64        vV as volume_mol (Brief="Vapour Molar volume");
65        Level as length (Brief="liquid height");
66        Across as area (Brief="Flash Cross section area");
67
68        EQUATIONS
69        "Component Molar Balance"
70        diff(M)=Inlet.F*Inlet.z - OutletL.F*OutletL.z - OutletV.F*OutletV.z;
71       
72        "Energy Balance"
73        diff(E) = Inlet.F*Inlet.h - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q;
74       
75        "Molar Holdup"
76        M = ML*OutletL.z + MV*OutletV.z;
77       
78        "Energy Holdup"
79        E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V;
80       
81        "Mol fraction normalisation"
82        sum(OutletL.z)=1.0;
83        "Mol fraction normalisation"
84        sum(OutletL.z)=sum(OutletV.z);
85       
86        "Liquid Volume"
87        vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z);
88        "Vapour Volume"
89        vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z);
90       
91        "Chemical Equilibrium"
92        PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z =
93                PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z;
94       
95        "Thermal Equilibrium"
96        OutletV.T = OutletL.T;
97       
98        "Mechanical Equilibrium"
99        OutletV.P = OutletL.P;
100       
101        "Geometry Constraint"
102        V = ML * vL + MV * vV;
103
104        switch orientation
105        case "vertical":
106        "Cross Section Area"
107                Across = 0.5 * asin(1) * diameter^2;
108       
109        "Liquid Level"
110                ML * vL = Across * Level;
111
112        case "horizontal":
113        "Cylindrical Side Area"
114                Across = 0.25*diameter^2 * (asin(1) - asin((diameter - 2*Level)/diameter)) +
115                                (Level - 0.5*diameter)*sqrt(Level*(diameter - Level));
116
117        "Liquid Level"
118                0.5 * asin(1) * diameter^2 * ML* vL = Across * V;
119        end
120end
121
122#*----------------------------------------------------------------------
123* Model of a  Steady State flash
124*---------------------------------------------------------------------*#
125Model flash_steady
126        PARAMETERS
127        outer PP as Plugin(Brief = "External Physical Properties", Type="PP");
128       
129        VARIABLES
130        in      Inlet as stream(Brief="Feed Stream");
131        out     OutletL as liquid_stream(Brief="Liquid outlet stream");
132        out     OutletV as vapour_stream(Brief="Vapour outlet stream");
133        in      Q as heat_rate (Brief="Rate of heat supply");
134        vfrac as fraction;
135
136        EQUATIONS
137        "The flash calculation"
138        [vfrac, OutletL.z, OutletV.z] = PP.Flash(OutletV.T, OutletV.P, Inlet.z);
139       
140        "Global Molar Balance"
141        Inlet.F = OutletV.F + OutletL.F;
142        "Vaporisation Fraction"
143        OutletV.F = Inlet.F * vfrac;
144       
145        "Energy Balance"
146        Inlet.F*Inlet.h  + Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h;
147       
148        "Thermal Equilibrium"
149        OutletV.T = OutletL.T;
150       
151        "Mechanical Equilibrium"
152        OutletV.P = OutletL.P;
153end
Note: See TracBrowser for help on using the repository browser.