source: trunk/eml/mixers_splitters/sepComp.mso @ 127

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

Updated mixers_splitters files header

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 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 separator of components
17*--------------------------------------------------------------------
18*
19*       Streams:
20*               * a inlet stream
21*               * "Noutlet" outlet streams
22*
23*       Assumptions:
24*               * thermodynamics equilibrium
25*               * adiabatic
26*                       
27*       Specify:
28*               * the inlet stream
29*               * (NComp - 1) molar fractions to (Noutlet - 1) outlet streams
30*               * (Noutlet - 1) frac (fraction of split of the outlet streams):
31*                               
32*                                       frac(i) = (Mole Flow of the outlet stream "i" /
33*                                                                       Mole Flow of the inlet stream)
34*                                                                                                       where i = 1, 2,...,Noutlet
35*                       or
36*
37*                 (Noutlet - 1) recovery (Recovery of the component specified in the outlet stream i):
38*
39*                                       recovery(i) = (Mole Flow of the component specified in the Outlet stream i/
40*                                                                               Mole Flow of the component specified in the inlet stream)
41*                                                                                                       where i = 1, 2,...,Noutlet
42*
43*----------------------------------------------------------------------
44* Author: Maurício Carvalho Maciel
45* $Id: sepComp.mso 76 2006-12-08 19:05:33Z paula $
46*--------------------------------------------------------------------*#
47
48
49using "streams";
50
51
52Model sepComp_n
53       
54
55        PARAMETERS
56ext PP   as CalcObject (Brief = "External Physical Properties");
57ext     NComp as Integer (Brief = "Number of chemical components", Lower = 1);
58        NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1);
59        mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1);
60       
61        VARIABLES
62in      Inlet   as stream;
63out Outlet(NOutlet) as stream;
64        frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams");
65        recovery(NOutlet) as fraction (Brief = "Recovery of the component specified");
66
67        EQUATIONS
68       
69        "Flow"
70        sum(Outlet.F) = Inlet.F;
71       
72       
73        for i in [1:NOutlet-1]
74               
75                "Mol fraction normalisation"
76                sum(Outlet(i).z) = 1;
77        end
78       
79       
80        for i in [1:NComp]
81       
82        "Composition"
83                sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i);
84       
85        end     
86       
87       
88        for i in [1:NOutlet]
89               
90                "Flow"
91                Outlet(i).F = Inlet.F*frac(i);
92               
93                "Recovery"
94                recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp);
95       
96                "Pressure"
97                Outlet(i).P = Inlet.P;
98       
99                "Enthalpy"
100                Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) +
101                                Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z);
102       
103                "Temperature"   
104                Outlet(i).T = Inlet.T;
105         
106                "Vapourization Fraction"
107                Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z);
108        end
109end
110
111
112Model sepComp
113       
114        PARAMETERS
115ext PP   as CalcObject (Brief = "External Physical Properties");
116ext     NComp as Integer (Brief = "Number of chemical components", Lower = 1);
117        mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1);
118       
119        VARIABLES
120in      Inlet   as stream;
121out Outlet1 as stream;
122out Outlet2 as stream;
123        frac as fraction (Brief = "Fraction to Outlet 1");
124        recovery as fraction (Brief = "Recovery of the component specified");
125
126        EQUATIONS
127       
128        "Flow"
129        Outlet1.F = Inlet.F * frac;
130        Outlet1.F + Outlet2.F = Inlet.F;
131       
132        recovery*Inlet.z(mainComp) = frac*Outlet1.z(mainComp);
133       
134        sum(Outlet1.z) = 1;
135       
136        for i in [1:NComp]
137               
138        "Composition"
139                Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i);
140        end
141       
142        "Pressure"
143        Outlet1.P = Inlet.P;
144        Outlet2.P = Inlet.P;
145       
146        "Enthalpy"
147        Outlet1.h = (1-Outlet1.v)*PP.LiquidEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z) +
148                                Outlet1.v*PP.VapourEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z);
149        Outlet2.h = (1-Outlet2.v)*PP.LiquidEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z) +
150                                Outlet2.v*PP.VapourEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z);
151       
152        "Temperature"
153        Outlet1.T = Inlet.T;
154        Outlet2.T = Inlet.T;
155       
156        "Vapourization Fraction"
157        Outlet1.v = PP.VapourFraction(Outlet1.T, Outlet1.P, Outlet1.z);
158        Outlet2.v = PP.VapourFraction(Outlet2.T, Outlet2.P, Outlet2.z);
159end
160
161 
Note: See TracBrowser for help on using the repository browser.