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 sink streams |
---|
17 | *---------------------------------------------------------------------- |
---|
18 | * Author: Paula B. Staudt and Rafael de P. Soares |
---|
19 | * $Id: sink.mso 757 2009-06-03 20:07:22Z bicca $ |
---|
20 | *---------------------------------------------------------------------*# |
---|
21 | |
---|
22 | using "streams"; |
---|
23 | |
---|
24 | Model sink |
---|
25 | ATTRIBUTES |
---|
26 | Pallete = true; |
---|
27 | Icon = "icon/Sink"; |
---|
28 | Brief = "Material stream sink"; |
---|
29 | Info = " |
---|
30 | This model should be used for boundary streams when additional |
---|
31 | information about the stream is desired. |
---|
32 | |
---|
33 | Some of the additional informations calculated by this models are: |
---|
34 | * Mass density |
---|
35 | * Mass flow |
---|
36 | * Mass compostions |
---|
37 | * Specific volume |
---|
38 | * Vapour fraction |
---|
39 | * Volumetric flow |
---|
40 | * Liquid and Vapour compositions |
---|
41 | "; |
---|
42 | |
---|
43 | PARAMETERS |
---|
44 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
45 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
46 | M(NComp) as molweight (Brief = "Component Mol Weight"); |
---|
47 | |
---|
48 | SET |
---|
49 | |
---|
50 | M = PP.MolecularWeight(); |
---|
51 | |
---|
52 | VARIABLES |
---|
53 | in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.5308, Protected=true,Symbol="_{in}"); |
---|
54 | v as fraction (Brief = "Vapourization fraction",Hidden=true); |
---|
55 | x(NComp) as fraction (Brief = "Liquid Molar Fraction",Hidden=true); |
---|
56 | y(NComp) as fraction (Brief = "Vapour Molar Fraction",Hidden=true); |
---|
57 | zmass(NComp) as fraction (Brief = "Mass Fraction"); |
---|
58 | Mw as molweight (Brief = "Average Mol Weight"); |
---|
59 | vm as volume_mol (Brief = "Molar Volume"); |
---|
60 | rho as dens_mass (Brief = "Stream Mass Density"); |
---|
61 | rhom as dens_mol (Brief = "Stream Molar Density"); |
---|
62 | Fw as flow_mass (Brief = "Stream Mass Flow"); |
---|
63 | Fvol as flow_vol (Brief = "Volumetric Flow"); |
---|
64 | T_Cdeg as temperature (Brief = "Temperature in °C", Lower=-200); |
---|
65 | |
---|
66 | EQUATIONS |
---|
67 | "Flash Calculation" |
---|
68 | [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z); |
---|
69 | |
---|
70 | "Average Molecular Weight" |
---|
71 | Mw = sum(M*Inlet.z); |
---|
72 | |
---|
73 | "Molar Density" |
---|
74 | rhom * vm = 1; |
---|
75 | |
---|
76 | "Mass or Molar Density" |
---|
77 | rhom * Mw = rho; |
---|
78 | |
---|
79 | "Flow Mass" |
---|
80 | Fw = Mw*Inlet.F; |
---|
81 | |
---|
82 | "Molar Volume" |
---|
83 | vm = (1-v)*PP.LiquidVolume(Inlet.T, Inlet.P, x) + v*PP.VapourVolume(Inlet.T,Inlet.P,y); |
---|
84 | |
---|
85 | "Volumetric Flow" |
---|
86 | Fvol = Inlet.F*vm ; |
---|
87 | |
---|
88 | "Mass Fraction" |
---|
89 | zmass = M*Inlet.z / Mw; |
---|
90 | |
---|
91 | "Temperature in °C" |
---|
92 | T_Cdeg = Inlet.T - 273.15 * 'K'; |
---|
93 | |
---|
94 | end |
---|
95 | |
---|
96 | Model sink2 |
---|
97 | ATTRIBUTES |
---|
98 | Pallete = true; |
---|
99 | Icon = "icon/Sink2"; |
---|
100 | Brief = "Material stream sink"; |
---|
101 | Info = " |
---|
102 | This model should be used for boundary streams when additional |
---|
103 | information about the stream is desired. |
---|
104 | |
---|
105 | Some of the additional informations calculated by this models are: |
---|
106 | * Mass density |
---|
107 | * Mass flow |
---|
108 | * Mass compostions |
---|
109 | * Specific volume |
---|
110 | * Vapour fraction |
---|
111 | * Volumetric flow |
---|
112 | * Liquid and Vapour compositions |
---|
113 | "; |
---|
114 | |
---|
115 | PARAMETERS |
---|
116 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
117 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
118 | M(NComp) as molweight (Brief = "Component Mol Weight"); |
---|
119 | |
---|
120 | SET |
---|
121 | |
---|
122 | M = PP.MolecularWeight(); |
---|
123 | |
---|
124 | VARIABLES |
---|
125 | in Inlet as stream (Brief = "Inlet Stream", PosX=1, PosY=0.5308, Protected=true,Symbol="_{in}"); |
---|
126 | v as fraction (Brief = "Vapourization fraction",Hidden=true); |
---|
127 | x(NComp) as fraction (Brief = "Liquid Molar Fraction",Hidden=true); |
---|
128 | y(NComp) as fraction (Brief = "Vapour Molar Fraction",Hidden=true); |
---|
129 | zmass(NComp) as fraction (Brief = "Mass Fraction"); |
---|
130 | Mw as molweight (Brief = "Average Mol Weight"); |
---|
131 | vm as volume_mol (Brief = "Molar Volume"); |
---|
132 | rho as dens_mass (Brief = "Stream Mass Density"); |
---|
133 | rhom as dens_mol (Brief = "Stream Molar Density"); |
---|
134 | Fw as flow_mass (Brief = "Stream Mass Flow"); |
---|
135 | Fvol as flow_vol (Brief = "Volumetric Flow"); |
---|
136 | T_Cdeg as temperature (Brief = "Temperature in °C", Lower=-200); |
---|
137 | |
---|
138 | EQUATIONS |
---|
139 | "Flash Calculation" |
---|
140 | [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z); |
---|
141 | |
---|
142 | "Average Molecular Weight" |
---|
143 | Mw = sum(M*Inlet.z); |
---|
144 | |
---|
145 | "Molar Density" |
---|
146 | rhom * vm = 1; |
---|
147 | |
---|
148 | "Mass or Molar Density" |
---|
149 | rhom * Mw = rho; |
---|
150 | |
---|
151 | "Flow Mass" |
---|
152 | Fw = Mw*Inlet.F; |
---|
153 | |
---|
154 | "Molar Volume" |
---|
155 | vm = (1-v)*PP.LiquidVolume(Inlet.T, Inlet.P, x) + v*PP.VapourVolume(Inlet.T,Inlet.P,y); |
---|
156 | |
---|
157 | "Volumetric Flow" |
---|
158 | Fvol = Inlet.F*vm ; |
---|
159 | |
---|
160 | "Mass Fraction" |
---|
161 | zmass = M*Inlet.z / Mw; |
---|
162 | |
---|
163 | "Temperature in °C" |
---|
164 | T_Cdeg = Inlet.T - 273.15 * 'K'; |
---|
165 | |
---|
166 | end |
---|
167 | |
---|
168 | Model simple_sink |
---|
169 | ATTRIBUTES |
---|
170 | Pallete = true; |
---|
171 | Icon = "icon/Sink"; |
---|
172 | Brief = "Simple material stream sink"; |
---|
173 | Info = " |
---|
174 | This model should be used for boundary streams when no additional |
---|
175 | information about the stream is desired. |
---|
176 | "; |
---|
177 | |
---|
178 | VARIABLES |
---|
179 | in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.5308, Protected=true,Symbol="_{in}"); |
---|
180 | end |
---|
181 | |
---|
182 | Model simple_sink2 |
---|
183 | ATTRIBUTES |
---|
184 | Pallete = true; |
---|
185 | Icon = "icon/Sink2"; |
---|
186 | Brief = "Simple material stream sink"; |
---|
187 | Info = " |
---|
188 | This model should be used for boundary streams when no additional |
---|
189 | information about the stream is desired. |
---|
190 | "; |
---|
191 | |
---|
192 | VARIABLES |
---|
193 | in Inlet as stream (Brief = "Inlet Stream", PosX=1, PosY=0.5308, Protected=true,Symbol="_{in}"); |
---|
194 | |
---|
195 | end |
---|
196 | |
---|
197 | Model sinkNoFlow |
---|
198 | ATTRIBUTES |
---|
199 | Pallete = true; |
---|
200 | Icon = "icon/SinkNoFlow"; |
---|
201 | Brief = "Simple material stream sink"; |
---|
202 | Info = " |
---|
203 | This model should be used for seal an outlet material stream port. |
---|
204 | "; |
---|
205 | |
---|
206 | VARIABLES |
---|
207 | in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.5308, Protected=true,Symbol="_{in}"); |
---|
208 | |
---|
209 | EQUATIONS |
---|
210 | "Stream Molar Flow" |
---|
211 | Inlet.F = 0 * 'kmol/h'; |
---|
212 | |
---|
213 | end |
---|