 Timestamp:
 Jun 26, 2008, 4:48:34 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/tests/eml/pressure_changers/pipe.mso
r541 r543 1 1 2 2 using "streams"; 3 3 4 # Not Finished yet !!!! 4 5 # Do Not Use it … … 12 13 PARAMETERS 13 14 14 outer N as Integer (Brief = "Number of Profile Intervals", Default = 1, Lower = 1, Upper = 100);15 outer N as Integer (Brief = "Number of Profile Intervals", Default = 1, Lower = 1, Upper = 100); 15 16 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 16 17 17 18 VARIABLES 18 19 19 Fw(N+1) as flow_mass(Brief = "Mass Flow Profile" , Symbol = "F_w");20 rho(N+1) as dens_mass(Brief = "Mass Density Profile" , Symbol = "\rho");21 mu(N+1) as viscosity(Brief = "Viscosity Profile" , Symbol = "\mu");22 23 Vel(N+1) as velocity (Brief = "Velocity Profile");24 vm(N+1) as vol_mol (Brief = "Molar Volume Profile");25 frac(N+1) as fraction(Brief = "Molar Fraction Profile");26 Vsfrac(N+1) as fraction(Brief = "No Slip Volume Fraction Profile",Lower=0);27 Holdup(N+1) as fraction(Brief = "Holdup Profile",Lower=0);28 Mfrac(N+1,NComp) as fraction (Brief = "Phase Molar Fraction Profile");29 h(N+1) as enth_mol(Brief = "Molar Enthalpy profile");30 20 Fw(N+1) as flow_mass (Brief = "Mass Flow Profile" , Symbol = "F_w"); 21 rho(N+1) as dens_mass (Brief = "Mass Density Profile" , Symbol = "\rho"); 22 mu(N+1) as viscosity (Brief = "Viscosity Profile" , Symbol = "\mu"); 23 24 Vel(N+1) as velocity (Brief = "Velocity Profile"); 25 vm(N+1) as vol_mol (Brief = "Molar Volume Profile"); 26 frac(N+1) as fraction (Brief = "Molar Fraction Profile"); 27 Vsfrac(N+1) as fraction (Brief = "No Slip Volume Fraction Profile",Lower=0); 28 Holdup(N+1) as fraction (Brief = "Holdup Profile",Lower=0); 29 Mfrac(N+1,NComp) as fraction (Brief = "Phase Molar Fraction Profile"); 30 h(N+1) as enth_mol (Brief = "Molar Enthalpy profile"); 31 31 32 end 32 33 … … 36 37 Pallete = true; 37 38 Icon = "icon/pipe"; 38 Brief 39 Brief = "pipe"; 39 40 Info = 40 41 "This distributed model describes the pressure drop of a material stream flowing in a pipe. … … 49 50 50 51 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 51 outer PP as Plugin (Brief = "External Physical Properties",Type="PP");52 outer PP as Plugin (Brief = "External Physical Properties",Type="PP"); 52 53 53 54 N as Integer (Brief = "Number of Profile Intervals", Default = 1, Lower = 1, Upper = 100); … … 62 63 M(NComp) as molweight (Brief="Component Mol Weight"); 63 64 FlowRegime as Switcher (Brief="Pipe flow regime",Valid=["laminar","turbulent"],Default="laminar"); 64 Correlation as Switcher (Brief="Holdup Correlation for Two Phase Flow", Valid=["BeggsBrill","LockhartMartinelli"], Default="BeggsBrill"); 65 Correlation as Switcher (Brief="Holdup Correlation for Two Phase Flow", Valid=["BeggsBrill","LockhartMartinelli"], Default="BeggsBrill"); 65 66 Thermal as Switcher (Brief="Pipe Thermal Specification ",Valid=["Constant Temperature","Linear Temperature profile"],Default="Constant Temperature"); 66 67 Toutlet as temperature (Brief= "Outlet Temperature", Symbol = "T_{out}"); … … 93 94 Lincr(N+1) as length (Brief = "Length Points", Symbol = "L_{incr}"); 94 95 fns(N+1) as fricfactor (Brief = "No Slip Friction Factor"); 95 ftp(N+1) as fricfactor (Brief = "Two phase Friction Factor");96 96 Mw as molweight (Brief = "Average Mol Weight"); 97 97 zmass(NComp) as fraction (Brief = "Mass Fraction"); … … 105 105 h(N+1) as enth_mol (Brief = "Molar Enthalpy profile"); 106 106 107 dPdLfric(N+1) as positive (Brief = "Friction Gradient",Lower = 0, Unit = 'Pa/m', DisplayUnit = 'kPa/m'); 108 dPelvdL(N+1) as positive (Brief = "Elevation Gradient", Lower = 0 , Unit = 'Pa/m', DisplayUnit = 'kPa/m'); 109 #dPaccdL(N+1) as positive (Brief = "Acceleration Gradient",Lower = 0 , Unit = 'Pa/m', DisplayUnit = 'kPa/m'); 110 111 #Beggs&Brill Method 107 #Beggs & Brill Method 112 108 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 113 NFR(N+1) as positive (Brief="Froude Number", Lower=1E10,Symbol = "N_{FR}"); 114 BBLine1(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 1"); 115 BBLine2(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 2"); 116 BBLine3(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 3"); 117 BBLine4(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 4"); 118 Map(N+1) as positive (Brief="Beggs and Brill Flag ");#apenas verificação do algoritmo 119 Atrans(N+1) as positive (Brief="Beggs and Brill Correction When Flow is in Transition Pattern"); 120 Y(N+1) as positive (Brief="Beggs and Brill Correction for Friction Factor in Two Phase Flow"); 121 S(N+1) as Real (Brief="Beggs and Brill Correction for Friction Factor in Two Phase Flow"); 122 123 #Lockhart&Martinelli Method 109 NFR(N+1) as positive (Brief="Froude Number", Lower=1E10,Hidden=true, Symbol = "N_{FR}"); 110 BBLine1(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 1",Hidden=true); 111 BBLine2(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 2",Hidden=true); 112 BBLine3(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 3",Hidden=true); 113 BBLine4(N+1) as positive (Brief="Beggs and Brill Correlation Parameter 4",Hidden=true); 114 Map(N+1) as positive (Brief="Beggs and Brill Flag "); 115 Atrans(N+1) as positive (Brief="Beggs and Brill Correction When Flow is in Transition Pattern"); 116 117 #Lockhart & Martinelli Method 124 118 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 125 119 126 XLM(N+1) as Real (Brief="Lockhart and Martinelli Parameter  Square", Lower=1E6);127 PhiLM(N+1) as Real (Brief="Lockhart and Martinelli Two phase Multiplier  Square", Lower=1E3);120 XLM(N+1) as Real (Brief="Lockhart and Martinelli Parameter", Hidden=true, Lower=1E6); 121 PhiLM(N+1) as Real (Brief="Lockhart and Martinelli Two phase Multiplier", Hidden=true, Lower=1E3); 128 122 129 123 EQUATIONS … … 148 142 if Vapour.frac(i) equal 0 then # Only Liquid phase 149 143 144 "Incremental Friction Pressure Drop" 145 dPfric(i) = 0.5*fns(i)*Lincr(i)*Liquid.rho(i)*Vel(i)*Vel(i)/Dpipe; 146 150 147 "Reynolds Number" 151 148 Re(i)*mu(i) = rho(i)*Vel(i)*Dpipe; … … 166 163 Liquid.Holdup(i) = 1; 167 164 168 "Lockhartmartinelli Two Phase Multiplier"169 XLM(i) = 1;170 171 PhiLM(i) = 1;172 173 165 "Beggs and Brill Line 1" 174 166 BBLine1(i) = 1; … … 185 177 Map(i)=10; 186 178 Atrans(i) = 1; 187 Y(i) = 1; 188 189 ftp(i)= 1; 190 191 S(i)= 1; 179 180 "Lockhartmartinelli Parameter" 181 XLM(i) = 1; 182 183 "Lockhartmartinelli Two Phase Multiplier" 184 PhiLM(i) = 1; 192 185 193 186 else if Liquid.frac(i) equal 0 then # Only Vapour phase 187 188 "Incremental Friction Pressure Drop" 189 dPfric(i) = 0.5*fns(i)*Lincr(i)*Vapour.rho(i)*Vel(i)*Vel(i)/Dpipe; 194 190 195 191 "Reynolds Number" … … 211 207 Liquid.Holdup(i) = 0; 212 208 213 "Lockhartmartinelli Two Phase Multiplier"214 XLM(i) = 1;215 216 PhiLM(i) = 1;217 218 209 "Beggs and Brill Line 1" 219 210 BBLine1(i) = 1; … … 230 221 Map(i)=11; 231 222 Atrans(i) = 1; 232 Y(i) = 1; 233 234 ftp(i)= 1; 235 236 S(i)= 1; 237 223 224 "Lockhartmartinelli Parameter" 225 XLM(i) = 1; 226 227 "Lockhartmartinelli Two Phase Multiplier" 228 PhiLM(i) = 1; 229 238 230 else # Two phase 239 231 240 232 "Reynolds Number" 241 Re(i)*(Liquid.mu(i)*Liquid.Vsfrac(i)+Vapour.mu(i)*Vapour.Vsfrac(i))= (Liquid.rho(i)*Liquid.Vsfrac(i)+Vapour.rho(i)*Vapour.Vsfrac(i))*Vel(i)*Dpipe; #no sip Reynolds Number233 Re(i)*(Liquid.mu(i)*Liquid.Vsfrac(i)+Vapour.mu(i)*Vapour.Vsfrac(i))= (Liquid.rho(i)*Liquid.Vsfrac(i)+Vapour.rho(i)*Vapour.Vsfrac(i))*Vel(i)*Dpipe; 242 234 243 235 "Vapour Superficial Velocity" … … 252 244 "Vapour Mass Flow" 253 245 Vapour.Fw(i) = Inlet.F*Vapour.frac(i)*sumt(M(1:NComp)*Vapour.Mfrac(i,1:NComp)); 254 246 255 247 switch Correlation 256 248 257 249 case "BeggsBrill": 258 259 "Lockhartmartinelli Two Phase Multiplier"260 XLM(i) = 1;261 262 PhiLM(i) = 1;263 250 264 251 "Beggs and Brill Line 1" 265 BBLine1(i) = 2.499687083 + 0.302*log(Liquid.Vsfrac(i)); #aplicado o log somente no lado direito da equação252 BBLine1(i) = 2.499687083 + 0.302*log(Liquid.Vsfrac(i)); 266 253 267 254 "Beggs and Brill Line 2" 268 BBLine2(i) = 3.033764376  2.4684*log(Liquid.Vsfrac(i)); #aplicado o log somente no lado direito da equação255 BBLine2(i) = 3.033764376  2.4684*log(Liquid.Vsfrac(i)); 269 256 270 257 "Beggs and Brill Line 3" 271 BBLine3(i) = 1  1.4516*log(Liquid.Vsfrac(i)); #aplicado o log somente no lado direito da equação258 BBLine3(i) = 1  1.4516*log(Liquid.Vsfrac(i)); 272 259 273 260 "Beggs and Brill Line 4" 274 BBLine4(i) = 0.301029996  6.738*log(Liquid.Vsfrac(i));#aplicado o log somente no lado direito da equação 275 276 Y(i)*Liquid.Holdup(i)*Liquid.Holdup(i) = Liquid.Vsfrac(i); 277 278 ftp(i)= fns(i)*exp(S(i)); 279 280 S(i)= ln(abs(2.2*Y(i)1.2)); 281 261 BBLine4(i) = 0.301029996  6.738*log(Liquid.Vsfrac(i)); 262 282 263 # Find the Flow Pattern for BeggsBrill Method 283 264 #++++++++++++++++++++++++++++++++++++++++++ … … 357 338 358 339 end 359 #++++++++++++++++++++++++++++++++++++++++++ 340 341 "Incremental Friction Pressure Drop" 342 dPfric(i) = 0.5*fns(i)*Lincr(i)*(Liquid.rho(i)*Liquid.Vsfrac(i)+Vapour.rho(i)*Vapour.Vsfrac(i))*Vel(i)*Vel(i)/Dpipe; 343 344 "Lockhartmartinelli Parameter" 345 XLM(i) = 1; 346 347 "Lockhartmartinelli Two Phase Multiplier" 348 PhiLM(i) = 1; 349 360 350 case "LockhartMartinelli": 361 362 "Do Not Use Variables related to Beggs and Brill Method" 351 352 "Lockhartmartinelli Parameter" 353 XLM(i) = (((1Vapour.frac(i))/Vapour.frac(i))^0.9)*((Vapour.rho(i)/Liquid.rho(i))^0.5)*((Liquid.mu(i)/Vapour.mu(i)))^0.1; 354 355 "Lockhartmartinelli Two Phase Multiplier" 356 PhiLM(i) = (1+20/XLM(i)+1/(XLM(i)^2))^0.5; 357 358 "Liquid Holdup" 359 Liquid.Holdup(i) = 1/abs(PhiLM(i)); 360 361 "Incremental Friction Pressure Drop"#FIXME 362 dPfric(i) = 0.5*PhiLM(i)*PhiLM(i)*Lincr(i)*(1Vapour.frac(i))^2*fns(i)*(Fw/Apipe)^2/(Liquid.rho(i)*Dpipe); 363 364 "Beggs and Brill Line 1" 363 365 BBLine1(i) = 1; 364 366 365 " Do Not Use Variables related to Beggs and Brill Method"366 BBLine2 (i)= 1;367 368 " Do Not Use Variables related to Beggs and Brill Method"367 "Beggs and Brill Line 2" 368 BBLine2(i) = 1; 369 370 "Beggs and Brill Line 3" 369 371 BBLine3(i) = 1; 370 372 371 "Do Not Use Variables related to Beggs and Brill Method" 372 BBLine4 (i)= 1; 373 374 "Lockhartmartinelli Two Phase Multiplier" 375 XLM(i)*Vapour.rho(i)*Vapour.Vel(i)^2 = Liquid.rho(i)*Liquid.Vel(i)^2; 376 377 PhiLM(i) = 1+20/sqrt(XLM(i))+1/XLM(i); 378 379 "Liquid Holdup" 380 Liquid.Holdup(i) = (1/abs(PhiLM(i)))^(1/3); 381 382 Atrans(i) = 1; 383 384 Map(i)=20; 385 386 Y(i)=1; 387 388 ftp(i)= 1; 389 390 S(i)= 1; 391 392 end 393 373 "Beggs and Brill Line 4" 374 BBLine4(i) = 1; 375 376 Map(i)=11; 377 Atrans(i) = 1; 378 379 end 394 380 395 381 end … … 446 432 "Incremental Elevation Pressure Drop" 447 433 dPelv= rho*g*Lincr*sin(Hrise); 448 449 dPelvdL= rho*g*sin(Hrise); 450 451 "Incremental Friction Pressure Drop" 452 #dPfric = (0.5*fns*Lincr*(Liquid.rho*Liquid.Vsfrac+Vapour.rho*Vapour.Vsfrac)*Vel*Vel/Dpipe); 453 dPfric = PhiLM*(0.5*fns*Lincr*(Liquid.rho*Liquid.Vsfrac+Vapour.rho*Vapour.Vsfrac)*Vel*Vel/Dpipe); 454 455 dPdLfric = (0.5*fns*(Liquid.rho*Liquid.Vsfrac+Vapour.rho*Vapour.Vsfrac)*Vel*Vel/Dpipe); 456 434 457 435 for i in [1:N+1] 458 436 … … 512 490 513 491 case "Constant Temperature": 514 "Outlet Temperature" 515 Tincr(i+1) = Inlet.T; 492 493 "Outlet Temperature" 494 Tincr(i+1) = Inlet.T; 516 495 517 496 case "Linear Temperature profile": 518 "Outlet Temperature" 519 Toutlet  Tincr(1) = Lpipe*((Tincr(i+1)Tincr(i))/(Lincr(i+1)Lincr(i))); 497 498 "Outlet Temperature" 499 Toutlet  Tincr(1) = Lpipe*((Tincr(i+1)Tincr(i))/(Lincr(i+1)Lincr(i))); 520 500 521 501 end … … 548 528 549 529 550 FlowSheet Pipe_ simples530 FlowSheet Pipe_Flow 551 531 552 532 PARAMETERS … … 567 547 SET 568 548 NComp = PP.NumberOfComponents; 569 Tube.N = 5; 549 Tube.N = 10; 550 551 #Tube.Correlation ="BeggsBrill"; 552 Tube.Correlation ="LockhartMartinelli"; 570 553 571 554 #Tube.Thermal ="Constant Temperature"; … … 579 562 580 563 SPECIFY 581 Feed.Outlet.F = 10* 'kmol/h';564 Feed.Outlet.F = 5 * 'kmol/h'; 582 565 Feed.Outlet.P = 3* 'atm'; 583 566 Feed.Outlet.T = (60+273.15) * 'K'; … … 586 569 SET 587 570 Tube.Lpipe = 5*'m'; 588 Tube.Hrise = 0*'deg'; # working only in the horizontal , must be updated 589 Tube.Correlation = "BeggsBrill"; 590 #Tube.Correlation = "LockhartMartinelli"; 591 571 Tube.Hrise = 0*'deg'; 592 572 593 573 Tube.Dpipe = 3*'in'; … … 596 576 OPTIONS 597 577 Dynamic = false; 598 #GuessFile="Pipe_simples"; 599 600 end 578 579 end
Note: See TracChangeset
for help on using the changeset viewer.