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

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

Updated documentation of mixer_splitter models

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