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

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

Fixed port positions in sepComp.

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