Changeset 339 for branches/tests/eml/streams.mso
- Timestamp:
- Aug 14, 2007, 2:46:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tests/eml/streams.mso
r325 r339 35 35 36 36 VARIABLES 37 F as flow_mol ;38 T as temperature ;39 P as pressure ;37 F as flow_mol(Brief = "Molar Flow"); 38 T as temperature(Brief = "Temperature"); 39 P as pressure(Brief = "Pressure"); 40 40 z(NComp) as fraction(Brief = "Overall Molar Fraction"); 41 h as enth_mol ;41 h as enth_mol(Brief = "Molar Enthalpy"); 42 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 43 59 end 44 60 … … 60 76 "Liquid stream" 61 77 v = 0; 78 62 79 end 63 80 … … 79 96 "Vapour stream" 80 97 v = 1; 81 end 82 83 Model streamPH as stream 98 99 end 100 101 Model streamPH as streamTherm 84 102 ATTRIBUTES 85 103 Brief = "Stream with built-in flash calculation"; … … 99 117 PARAMETERS 100 118 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 101 102 VARIABLES103 x(NComp) as fraction(Brief = "Liquid Molar Fraction");104 y(NComp) as fraction(Brief = "Vapour Molar Fraction");105 119 106 120 EQUATIONS … … 150 164 151 165 VARIABLES 152 out Outlet as stream (Brief = "Outlet stream", PosX=1, PosY=0.5256); 153 x(NComp) as fraction (Brief = "Liquid Molar Fraction"); 154 y(NComp) as fraction (Brief = "Vapour Molar Fraction"); 166 out Outlet as streamTherm (Brief = "Outlet stream", PosX=1, PosY=0.5256); 155 167 hl as enth_mol; 156 168 hv as enth_mol; … … 165 177 EQUATIONS 166 178 "Flash Calculation" 167 [Outlet.v, x,y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);179 [Outlet.v, Outlet.x, Outlet.y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z); 168 180 169 181 "Overall Enthalpy" 170 Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) +171 Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y);172 173 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);174 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);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); 175 187 176 188 "Average Molecular Weight" … … 184 196 case "correlation": 185 197 "Mass Density" 186 rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P, x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,y)) = 1;198 rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P,Outlet.x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,Outlet.y)) = 1; 187 199 end 188 200 … … 194 206 195 207 "Molar Volume" 196 vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y);208 vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, Outlet.x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,Outlet.y); 197 209 198 210 "Volumetric Flow" … … 226 238 227 239 VARIABLES 228 out Outlet as stream (Brief = "Outlet stream", PosX=1, PosY=0.5256); 229 x(NComp) as fraction (Brief = "Liquid Molar Fraction"); 230 y(NComp) as fraction (Brief = "Vapour Molar Fraction"); 240 out Outlet as streamTherm (Brief = "Outlet stream", PosX=1, PosY=0.5256); 231 241 hl as enth_mol; 232 242 hv as enth_mol; … … 234 244 EQUATIONS 235 245 "Flash Calculation" 236 [Outlet.v, x,y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);246 [Outlet.v, Outlet.x, Outlet.y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z); 237 247 238 248 "Overall Enthalpy" 239 Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) +240 Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y);241 242 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);243 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);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); 244 254 end 245 255 … … 274 284 275 285 VARIABLES 276 in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.5308); 277 v as fraction (Brief = "Vapourization fraction"); 278 x(NComp) as fraction (Brief = "Liquid Molar Fraction"); 279 y(NComp) as fraction (Brief = "Vapour Molar Fraction"); 286 in Inlet as streamTherm (Brief = "Inlet Stream", PosX=0, PosY=0.5308); 280 287 zmass(NComp) as fraction (Brief = "Mass Fraction"); 281 288 Mw as molweight (Brief = "Average Mol Weight"); … … 287 294 288 295 EQUATIONS 289 "Flash Calculation"290 [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z);291 292 296 "Average Molecular Weight" 293 297 Mw = sum(M*Inlet.z); … … 300 304 case "correlation": 301 305 "Mass Density" 302 rho * ((1- v)/PP.LiquidDensity(Inlet.T,Inlet.P,x) + v/PP.VapourDensity(Inlet.T,Inlet.P,y)) = 1;306 rho * ((1-Inlet.v)/PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.x) + Inlet.v/PP.VapourDensity(Inlet.T,Inlet.P,Inlet.y)) = 1; 303 307 end 304 308 … … 310 314 311 315 "Molar Volume" 312 vm = (1- v)*PP.LiquidVolume(Inlet.T, Inlet.P, x) + v*PP.VapourVolume(Inlet.T,Inlet.P,y);316 vm = (1-Inlet.v)*PP.LiquidVolume(Inlet.T, Inlet.P, Inlet.x) + Inlet.v*PP.VapourVolume(Inlet.T,Inlet.P,Inlet.y); 313 317 314 318 "Volumetric Flow"
Note: See TracChangeset
for help on using the changeset viewer.