source: branches/gui/eml/mixers_splitters/sepComp.mso @ 965

Last change on this file since 965 was 744, checked in by gerson bicca, 14 years ago

improved SepComp? model (testing)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.7 KB
RevLine 
[1]1#*-------------------------------------------------------------------
[76]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*
[1]15*----------------------------------------------------------------------
16* Author: Maurício Carvalho Maciel
17* $Id: sepComp.mso 744 2009-03-06 22:56:26Z bicca $
18*--------------------------------------------------------------------*#
19
20using "streams";
21
22Model sepComp_n
[269]23        ATTRIBUTES
[739]24        Pallete         = false;
[304]25        Icon            = "icon/splitter_n";
[739]26        Brief           = "Model of a separator of components (NOT Handled by the GUI)";
[354]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
[356]40
[269]41                        or
42
[356]43* (Noutlet - 1) recovery (Recovery of the component specified in the outlet stream i):
[269]44
[354]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";
[269]49       
[175]50PARAMETERS
[1]51
[176]52outer PP                        as Plugin       (Brief = "External Physical Properties", Type="PP");
[175]53outer   NComp           as Integer      (Brief = "Number of chemical components", Lower = 1);
[364]54                NOutlet         as Integer      (Brief = "Number of Outlet Streams", Lower = 1);
[175]55                mainComp        as Integer      (Brief = "Component specified", Default = 1, Lower = 1);
[1]56       
[175]57VARIABLES
[1]58
[364]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}");
[175]61
[364]62        frac(NOutlet)           as fraction (Brief = "Distribution of the Outlet streams", Symbol="\phi");
[351]63        recovery(NOutlet)       as fraction (Brief = "Recovery of the component specified", Symbol="\eta");
[175]64
65EQUATIONS
[1]66       
[175]67"Flow"
[1]68        sum(Outlet.F) = Inlet.F;
69       
70       
[574]71for i in [1:NOutlet-1] do
[175]72
73"Mol fraction normalisation"
74        sum(Outlet(i).z) = 1;
75
76end
[1]77       
78       
[574]79for i in [1:NComp] do
[1]80       
[175]81"Composition"
82        sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i);
[1]83       
[175]84end     
[1]85       
86       
[574]87for i in [1:NOutlet] do
[1]88       
[175]89"Flow"
90        Outlet(i).F = Inlet.F*frac(i);
[1]91       
[175]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) +
[1]100                                Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z);
101       
[175]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       
[1]108end
109
[175]110end
[1]111
[175]112
[1]113Model sepComp
[269]114        ATTRIBUTES
115        Pallete         = true;
[744]116        Icon            = "icon/SepComp";
[269]117        Brief           = "Model of a separator of components";
[354]118        Info            =
119"== Assumptions ==
120* thermodynamics equilibrium
[1]121       
[354]122== Specify ==
123* the inlet stream
[744]124* (NComp) Overhead_Splits or (NComp) Bottom_Splits
125* the Pressure and Temperature of the outlet streams
[354]126";
[269]127
[175]128PARAMETERS
129
[744]130outer   PP                      as Plugin       (Brief = "External Physical Properties", Type="PP");
131outer   NComp   as Integer (Brief = "Number of chemical components");
[1]132       
[175]133VARIABLES
[1]134
[744]135in              Inlet                                           as stream               (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{Inlet}");
136out     Overhead_Outlet         as streamPH     (Brief = "Overhead_Outlet stream", PosX=0.5, PosY=0, Symbol="_{Overhead}");
137out     Bottom_Outlet           as streamPH     (Brief = "Bottom_Outlet stream", PosX=0.5, PosY=1, Symbol="_{Bottom}");
138in              InletQ                                  as power                (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}");
[175]139
[744]140        Overhead_Splits(NComp)  as fraction     (Brief = "Fraction to Overhead_Outlet", Symbol="\phi_{overhead}");
141        Bottom_Splits(NComp)            as fraction     (Brief = "Fraction to Bottom_Outlet", Symbol="\phi_{bottom}");
[1]142       
[744]143EQUATIONS
[175]144
[744]145"Composition Overhead"
146        Overhead_Outlet.F*Overhead_Outlet.z = Inlet.F * Inlet.z*Overhead_Splits;
[175]147
[744]148"Bottom Composition Constraints"
149        sum(Bottom_Outlet.z) = 1;
150
151"Sum Of Splits"
152        Overhead_Splits+Bottom_Splits = 1;
153
154"Overhead Composition Constraints"
155        sum(Overhead_Outlet.z) = 1;
156
157 "Global Composition"
158        Overhead_Outlet.F*Overhead_Outlet.z + Bottom_Outlet.F*Bottom_Outlet.z = Inlet.F*Inlet.z;
159
160"Energy Balance"
161        Inlet.F*Inlet.h = Overhead_Outlet.F*Overhead_Outlet.h + Bottom_Outlet.F*Bottom_Outlet.h - InletQ;
162
163#"Overhead Pressure"
164#       Overhead_Outlet.P = Inlet.P;
165
166#"Bottom Pressure"
167#       Bottom_Outlet.P = Inlet.P;
168
169#"Overhead Temperature"
170#       Overhead_Outlet.T = Inlet.T;
171
172#"Bottom Temperature"
173#       Bottom_Outlet.T = Inlet.T;
174
[1]175end
176
[744]177 
Note: See TracBrowser for help on using the repository browser.