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 744 2009-03-06 22:56:26Z bicca $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "streams"; |
---|
21 | |
---|
22 | Model sepComp_n |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = false; |
---|
25 | Icon = "icon/splitter_n"; |
---|
26 | Brief = "Model of a separator of components (NOT Handled by the GUI)"; |
---|
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 | |
---|
50 | PARAMETERS |
---|
51 | |
---|
52 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
53 | outer 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 | |
---|
57 | VARIABLES |
---|
58 | |
---|
59 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5, Symbol="_{in}"); |
---|
60 | out 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 | |
---|
65 | EQUATIONS |
---|
66 | |
---|
67 | "Flow" |
---|
68 | sum(Outlet.F) = Inlet.F; |
---|
69 | |
---|
70 | |
---|
71 | for i in [1:NOutlet-1] do |
---|
72 | |
---|
73 | "Mol fraction normalisation" |
---|
74 | sum(Outlet(i).z) = 1; |
---|
75 | |
---|
76 | end |
---|
77 | |
---|
78 | |
---|
79 | for i in [1:NComp] do |
---|
80 | |
---|
81 | "Composition" |
---|
82 | sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); |
---|
83 | |
---|
84 | end |
---|
85 | |
---|
86 | |
---|
87 | for i in [1:NOutlet] do |
---|
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 | |
---|
108 | end |
---|
109 | |
---|
110 | end |
---|
111 | |
---|
112 | |
---|
113 | Model sepComp |
---|
114 | ATTRIBUTES |
---|
115 | Pallete = true; |
---|
116 | Icon = "icon/SepComp"; |
---|
117 | Brief = "Model of a separator of components"; |
---|
118 | Info = |
---|
119 | "== Assumptions == |
---|
120 | * thermodynamics equilibrium |
---|
121 | |
---|
122 | == Specify == |
---|
123 | * the inlet stream |
---|
124 | * (NComp) Overhead_Splits or (NComp) Bottom_Splits |
---|
125 | * the Pressure and Temperature of the outlet streams |
---|
126 | "; |
---|
127 | |
---|
128 | PARAMETERS |
---|
129 | |
---|
130 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
131 | outer NComp as Integer (Brief = "Number of chemical components"); |
---|
132 | |
---|
133 | VARIABLES |
---|
134 | |
---|
135 | in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{Inlet}"); |
---|
136 | out Overhead_Outlet as streamPH (Brief = "Overhead_Outlet stream", PosX=0.5, PosY=0, Symbol="_{Overhead}"); |
---|
137 | out Bottom_Outlet as streamPH (Brief = "Bottom_Outlet stream", PosX=0.5, PosY=1, Symbol="_{Bottom}"); |
---|
138 | in InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); |
---|
139 | |
---|
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}"); |
---|
142 | |
---|
143 | EQUATIONS |
---|
144 | |
---|
145 | "Composition Overhead" |
---|
146 | Overhead_Outlet.F*Overhead_Outlet.z = Inlet.F * Inlet.z*Overhead_Splits; |
---|
147 | |
---|
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 | |
---|
175 | end |
---|
176 | |
---|
177 | |
---|