Changeset 460 for branches/tests/eml/streams.mso
- Timestamp:
- Feb 14, 2008, 6:56:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tests/eml/streams.mso
r339 r460 35 35 36 36 VARIABLES 37 F as flow_mol(Brief = "Molar Flow"); 38 T as temperature(Brief = "Temperature"); 39 P as pressure(Brief = "Pressure"); 40 z(NComp) as fraction(Brief = "Overall Molar Fraction"); 41 h as enth_mol(Brief = "Molar Enthalpy"); 42 v as fraction(Brief = "Vapourization fraction"); 43 end 44 45 Model streamTherm as stream 46 ATTRIBUTES 47 Pallete = false; 48 Brief = "General Material Stream"; 49 Info = 50 "comments."; 51 52 PARAMETERS 53 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 54 55 VARIABLES 56 x(NComp) as fraction(Brief = "Liquid Molar Fraction"); 57 y(NComp) as fraction(Brief = "Vapour Molar Fraction"); 58 37 F as flow_mol (Brief = "Stream Molar Flow Rate"); 38 T as temperature (Brief = "Stream Temperature"); 39 P as pressure (Brief = "Stream Pressure"); 40 z(NComp) as fraction (Brief = "Stream Molar Fraction"); 41 h as enth_mol (Brief = "Stream Enthalpy"); 42 v as fraction (Brief = "Vapourization fraction"); 59 43 end 60 44 … … 76 60 "Liquid stream" 77 61 v = 0; 78 79 62 end 80 63 … … 96 79 "Vapour stream" 97 80 v = 1; 98 99 end 100 101 Model streamPH as streamTherm 81 end 82 83 Model streamPH as stream 102 84 ATTRIBUTES 103 85 Brief = "Stream with built-in flash calculation"; … … 118 100 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 119 101 102 VARIABLES 103 x(NComp) as fraction (Brief = "Liquid Molar Fraction"); 104 y(NComp) as fraction (Brief = "Vapour Molar Fraction"); 105 s as entr_mol (Brief = "Stream Entropy"); 106 120 107 EQUATIONS 121 108 "Flash Calculation" 122 109 [v, x, y] = PP.FlashPH(P, h, z); 110 123 111 "Enthalpy" 124 112 h = (1-v)*PP.LiquidEnthalpy(T, P, x) + 125 113 v*PP.VapourEnthalpy(T, P, y); 114 115 "Entropy" 116 s = (1-v)*PP.LiquidEntropy(T, P, x) + 117 v*PP.VapourEntropy(T, P, y); 126 118 end 127 119 … … 164 156 165 157 VARIABLES 166 out Outlet as streamTherm (Brief = "Outlet stream", PosX=1, PosY=0.5256); 167 hl as enth_mol; 168 hv as enth_mol; 158 out Outlet as stream (Brief = "Outlet stream", PosX=1, PosY=0.5256, Symbol="_{out}"); 159 x(NComp) as fraction (Brief = "Liquid Molar Fraction"); 160 y(NComp) as fraction (Brief = "Vapour Molar Fraction"); 161 hl as enth_mol (Brief = "Liquid Enthalpy"); 162 hv as enth_mol (Brief = "Vapour Enthalpy"); 163 s as entr_mol (Brief = "Stream Entropy"); 164 sl as entr_mol (Brief = "Liquid Entropy"); 165 sv as entr_mol (Brief = "Vapour Entropy"); 169 166 zmass(NComp) as fraction (Brief = "Mass Fraction"); 170 167 Mw as molweight (Brief = "Average Mol Weight"); … … 177 174 EQUATIONS 178 175 "Flash Calculation" 179 [Outlet.v, Outlet.x, Outlet.y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);176 [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z); 180 177 181 178 "Overall Enthalpy" 182 Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x) + 183 Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y); 184 185 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x); 186 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y); 187 179 Outlet.h = (1-Outlet.v)*hl + Outlet.v*hv; 180 181 "Liquid Enthalpy" 182 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x); 183 184 "Vapour Enthalpy" 185 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y); 186 187 "Overall Entropy" 188 s = (1-Outlet.v)*sl + Outlet.v*sv; 189 190 "Liquid Entropy" 191 sl = PP.LiquidEntropy(Outlet.T, Outlet.P, x); 192 193 "Vapour Entropy" 194 sv = PP.VapourEntropy(Outlet.T, Outlet.P, y); 195 188 196 "Average Molecular Weight" 189 197 Mw = sum(M*Outlet.z); … … 196 204 case "correlation": 197 205 "Mass Density" 198 rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P, Outlet.x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,Outlet.y)) = 1;206 rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P,x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,y)) = 1; 199 207 end 200 208 … … 206 214 207 215 "Molar Volume" 208 vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,Outlet.y);216 vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y); 209 217 210 218 "Volumetric Flow" … … 238 246 239 247 VARIABLES 240 out Outlet as streamTherm (Brief = "Outlet stream", PosX=1, PosY=0.5256); 241 hl as enth_mol; 242 hv as enth_mol; 248 out Outlet as stream (Brief = "Outlet stream", PosX=1, PosY=0.5256, Symbol="_{out}"); 249 x(NComp) as fraction (Brief = "Liquid Molar Fraction"); 250 y(NComp) as fraction (Brief = "Vapour Molar Fraction"); 251 hl as enth_mol (Brief = "Liquid Enthalpy"); 252 hv as enth_mol (Brief = "Vapour Enthalpy"); 253 s as entr_mol (Brief = "Stream Entropy"); 254 sl as entr_mol (Brief = "Liquid Entropy"); 255 sv as entr_mol (Brief = "Vapour Entropy"); 243 256 244 257 EQUATIONS 245 258 "Flash Calculation" 246 [Outlet.v, Outlet.x, Outlet.y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);259 [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z); 247 260 248 261 "Overall Enthalpy" 249 Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x) + 250 Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y); 251 252 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, Outlet.x); 253 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, Outlet.y); 262 Outlet.h = (1-Outlet.v)*hl + Outlet.v*hv; 263 264 "Liquid Enthalpy" 265 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x); 266 267 "Vapour Enthalpy" 268 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y); 269 270 "Overall Entropy" 271 s = (1-Outlet.v)*sl + Outlet.v*sv; 272 273 "Liquid Entropy" 274 sl = PP.LiquidEntropy(Outlet.T, Outlet.P, x); 275 276 "Vapour Entropy" 277 sv = PP.VapourEntropy(Outlet.T, Outlet.P, y); 254 278 end 255 279 … … 284 308 285 309 VARIABLES 286 in Inlet as streamTherm (Brief = "Inlet Stream", PosX=0, PosY=0.5308); 310 in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.5308, Symbol="_{in}"); 311 v as fraction (Brief = "Vapourization fraction"); 312 x(NComp) as fraction (Brief = "Liquid Molar Fraction"); 313 y(NComp) as fraction (Brief = "Vapour Molar Fraction"); 287 314 zmass(NComp) as fraction (Brief = "Mass Fraction"); 288 315 Mw as molweight (Brief = "Average Mol Weight"); … … 292 319 Fw as flow_mass (Brief = "Stream Mass Flow"); 293 320 Fvol as flow_vol (Brief = "Volumetric Flow"); 294 295 EQUATIONS 321 s as entr_mol (Brief = "Stream Entropy"); 322 323 EQUATIONS 324 "Flash Calculation" 325 [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z); 326 296 327 "Average Molecular Weight" 297 328 Mw = sum(M*Inlet.z); … … 304 335 case "correlation": 305 336 "Mass Density" 306 rho * ((1- Inlet.v)/PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.x) + Inlet.v/PP.VapourDensity(Inlet.T,Inlet.P,Inlet.y)) = 1;337 rho * ((1-v)/PP.LiquidDensity(Inlet.T,Inlet.P,x) + v/PP.VapourDensity(Inlet.T,Inlet.P,y)) = 1; 307 338 end 308 339 … … 314 345 315 346 "Molar Volume" 316 vm = (1- Inlet.v)*PP.LiquidVolume(Inlet.T, Inlet.P, Inlet.x) + Inlet.v*PP.VapourVolume(Inlet.T,Inlet.P,Inlet.y);347 vm = (1-v)*PP.LiquidVolume(Inlet.T, Inlet.P, x) + v*PP.VapourVolume(Inlet.T,Inlet.P,y); 317 348 318 349 "Volumetric Flow" … … 322 353 zmass = M*Inlet.z / Mw; 323 354 355 "Overall Entropy" 356 s = (1-v)*PP.LiquidEntropy(Inlet.T, Inlet.P, x) + 357 v*PP.VapourEntropy(Inlet.T, Inlet.P, y); 324 358 end 325 359 … … 335 369 336 370 VARIABLES 337 in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.5308 );371 in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.5308, Symbol="_{in}"); 338 372 end 339 373 … … 358 392 359 393 VARIABLES 360 out OutletQ as energy_stream (Brief = "Outlet energy stream", PosX=1, PosY=0.5349 );361 end 394 out OutletQ as energy_stream (Brief = "Outlet energy stream", PosX=1, PosY=0.5349, Symbol="_{out}"); 395 end
Note: See TracChangeset
for help on using the changeset viewer.