Changeset 436
 Timestamp:
 Dec 19, 2007, 2:06:02 PM (15 years ago)
 Location:
 branches/packed
 Files:

 1 edited
 2 copied
Legend:
 Unmodified
 Added
 Removed

branches/packed/eml/stage_separators/tray.mso
r398 r436 323 323 V = ML* vL + MV*vV; 324 324 end 325 326 Model packedStage1 as trayBasic 327 #it's not working....initialization problems. 328 PARAMETERS 329 PPwater as Plugin(Brief="Physical Properties", 330 Type="PP", 331 Components = [ "water" ], 332 LiquidModel = "PR", 333 VapourModel = "PR" 334 ); 335 336 PackingType as Switcher(Valid = ["random", "structured"], Default = "randon"); 337 PressureDropModel as Switcher(Valid = ["Leva", "Prahl"], Default = "Prahl"); 338 339 a as Real (Brief="Constant used in Leva equation", Unit='1/m', Default=873.55); 340 b as Real (Brief="Constant used in Leva equation", Unit='m^2*s/kg', Default=0.058); 341 Fp as Real (Brief="Packing factor", Default = 300); 342 e as fraction (Brief="Packing Porosity", Default=0.84); 343 dp as length (Brief="Packing Dimension", Default=0.013); 344 C as Real (Brief="Prahl method constant", Unit = 'kg^0.2*m^1.8/s^2.2', Default = 2.994); 345 346 S as length (Brief="Structured packing parameter", Default=0.009); 347 teta as Real (Brief="Structured packing parameter", Unit= 'deg', Default=45); 348 C3 as Real (Brief="Structured packing parameter", Default=3.38); 349 350 Across as area (Brief="Tower cross section area"); 351 Mw(NComp) as molweight (Brief = "Component Mol Weight"); 352 g as acceleration (Default=9.81); 353 354 SET 355 Mw = PP.MolecularWeight(); 356 357 VARIABLES 358 rhoL as dens_mass (Brief="Liquid density"); 359 rhoV as dens_mass (Brief="Vapor density"); 360 viscL as viscosity (Brief="Liquid Viscosity"); 361 viscV as viscosity (Brief="Vapor Viscosity"); 362 rhow as dens_mass (Brief="Water density"); 363 visclw as viscosity (Brief="Water viscosity"); 364 365 L as flux_mass (Brief="Liquid mass flux"); 366 G as flux_mass (Brief="Liquid mass flux"); 367 Llin as flux_mass (Brief="Water contribution on liquid mass flux"); 368 X as Real (Brief="Term in Prahl correlation"); 369 Y as Real (Brief="Term in Prahl correlation"); 370 Reg as Real (Brief="Packing Reynolds"); 371 Ge as velocity (Brief="Temporay variable"); 372 Fr as Real (Brief="Froud number"); 373 phiL as Real (Brief="Liquid holdup in packed towers"); 374 375 EQUATIONS 376 "If the liquid is not water  mass flux correction" 377 Llin = L * rhow/rhoL; 378 379 "Base unit conversion" 380 L = OutletL.F*sum(Mw)/Across; 381 G = OutletV.F*sum(Mw)/Across; 382 383 "X in Prahl correlation" 384 X * G = L * (rhoV/rhoL)^0.5; 385 386 "Y in Prahl correlation" 387 Y = G^2 * Fp * (rhow/rhoL) * viscL^0.2 / (rhoV*rhoL*C) ; 388 389 "Water Liquid Viscosity" 390 visclw = PPwater.LiquidViscosity(OutletL.T, OutletL.P, 1); 391 "Water Liquid Density" 392 rhow = PPwater.LiquidDensity(OutletL.T, OutletL.P, 1); 393 "Liquid Viscosity" 394 viscL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z); 395 "Vapor Viscosity" 396 viscV = PP.VapourViscosity(OutletV.T, OutletV.P, OutletV.z); 397 "Liquid Density" 398 rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); 399 "Vapour Density" 400 rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); 401 402 "Froud number" 403 Fr = (L/rhoL)^2 / S/g; 404 "Reynolds number" 405 Reg = S*(G/rhoV/(e*sin(teta)))*rhoV/viscV; 406 "Temporary variable" 407 Ge = G/rhoV /(e*sin(teta)); 408 "Conversion from ML to phiL" 409 phiL = ML*vL / V; 410 411 switch PackingType 412 case "random": 413 switch PressureDropModel 414 case "Leva": 415 (InletV.P  OutletV.P) = (V/Across) * a * 10^(b*Llin) * G^2/rhoV; 416 case "Prahl": 417 (InletV.P  OutletV.P)/'0.101972*Pa' = (V/Across)/'m' * Y*(1116*X+500)/(1Y*(35*X+3)); 418 end 419 phiL = (1.53e4 + 2.9e5 * e * (dp * L/viscL/e)^0.66 * (viscL/visclw)^0.75) * (dp/'m')^(1.2); 420 421 case "structured": 422 (InletV.P  OutletV.P) = (V/Across) * (0.171 + 92.7/Reg)*(rhoV*(Ge)^2 / S) 423 * (1/(1C3 * Fr^0.5))^5; 424 425 phiL = C3 * Fr^0.5; 426 end 427 428 # OutletL.F = 220 * 'kmol/h'; 429 # OutletV.F = 150 * 'kmol/h'; 430 end 431 432 Model packedStage2 as trayBasic 433 PARAMETERS 434 PPwater as Plugin(Brief="Physical Properties", 435 Type="PP", 436 Components = [ "water" ], 437 LiquidModel = "PR", 438 VapourModel = "PR" 439 ); 440 441 PackingType as Switcher(Valid = ["random", "structured"], Default = "randon"); 442 PressureDropModel as Switcher(Valid = ["Leva", "Prahl"], Default = "Prahl"); 443 444 a as Real (Brief="Constant used in Leva equation", Default=873.55); 445 b as Real (Brief="Constant used in Leva equation", Default=0.058); 446 Fp as Real (Brief="Packing factor", Default = 300); 447 e as fraction (Brief="Packing Porosity", Default=0.84); 448 dp as length (Brief="Packing Dimension", Default=0.013); 449 C as Real (Brief="Prahl method constant", Unit = 'kg^0.2*m^1.8/s^2.2', Default = 2.994); 450 451 S as length (Brief="Structured packing parameter", Default=0.009); 452 teta as Real (Brief="Structured packing parameter", Unit= 'deg', Default=45); 453 C3 as Real (Brief="Structured packing parameter", Default=3.38); 454 455 Across as area (Brief="Tower cross section area"); 456 Mw(NComp) as molweight (Brief = "Component Mol Weight"); 457 g as acceleration (Default=9.81); 458 459 SET 460 Mw = PP.MolecularWeight(); 461 462 VARIABLES 463 rhoL as dens_mass (Brief="Liquid density"); 464 rhoV as dens_mass (Brief="Vapor density"); 465 viscL as viscosity (Brief="Liquid Viscosity"); 466 viscV as viscosity (Brief="Vapor Viscosity"); 467 rhow as dens_mass (Brief="Water density"); 468 visclw as viscosity (Brief="Water viscosity"); 469 470 L as flux_mass (Brief="Liquid mass flux"); 471 G as flux_mass (Brief="Liquid mass flux"); 472 Llin as flux_mass (Brief="Water contribution on liquid mass flux"); 473 X as Real (Brief="Term in Prahl correlation"); 474 Y as Real (Brief="Term in Prahl correlation"); 475 Reg as Real (Brief="Packing Reynolds"); 476 Ge as velocity (Brief="Temporay variable"); 477 Fr as Real (Brief="Froud number"); 478 phiL as Real (Brief="Liquid holdup in packed towers"); 479 480 deltaP_z as Real (Unit = 'inH2O/ft'); 481 482 EQUATIONS 483 deltaP_z = (InletV.P  OutletV.P) / (V/Across); 484 485 "If the liquid is not water  mass flux correction" 486 Llin = L * rhow/rhoL; 487 488 "Base unit conversion (mol > mass)" 489 L = OutletL.F*sum(Mw*OutletL.z)/Across; 490 G = OutletV.F*sum(Mw*OutletV.z)/Across; 491 492 "X in Prahl correlation" 493 X * G = L * (rhoV/rhoL)^0.5; 494 495 "Y in Prahl correlation" 496 Y = G^2 * Fp * (rhow/rhoL) * viscL^0.2 / (rhoV*rhoL*C) ; 497 498 "Water Liquid Viscosity" 499 visclw = PPwater.LiquidViscosity(OutletL.T, OutletL.P, 1); 500 "Water Liquid Density" 501 rhow = PPwater.LiquidDensity(OutletL.T, OutletL.P, 1); 502 "Liquid Viscosity" 503 viscL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z); 504 "Vapor Viscosity" 505 viscV = PP.VapourViscosity(OutletV.T, OutletV.P, OutletV.z); 506 "Liquid Density" 507 rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); 508 "Vapour Density" 509 rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); 510 511 "Froud number" 512 Fr = (L/rhoL)^2 / S/g; 513 "Reynolds number" 514 Reg = S*(G/rhoV/(e*sin(teta)))*rhoV/viscV; 515 "Temporary variable" 516 Ge = G/rhoV /(e*sin(teta)); 517 "Conversion from ML to phiL" 518 phiL = ML*vL / V; 519 520 switch PackingType 521 case "random": 522 switch PressureDropModel 523 case "Leva": 524 #(InletV.P  OutletV.P)/'Pa' / (V/'m^3'/(Across/'m^2') ) = a * 10^(b*Llin/'kg/m^2/s') * (G/('kg/m^2/s'))^2/(rhoV/('kg/m^3')); 525 (InletV.P  OutletV.P) / (V/(Across) ) = a * 10^(b*Llin) * (G)^2/(rhoV); 526 case "Prahl": 527 (InletV.P  OutletV.P)/'0.03937*inH2O' = (V/Across)/'m' * Y*(1116*X+500)/(1Y*(35*X+3)); 528 end 529 phiL = (1.53e4 + (2.9e5*e*(dp*L/(viscL*e))^0.66 * (viscL/visclw)^0.75)) * (dp/'m')^(1.2); 530 531 case "structured": 532 (InletV.P  OutletV.P)/'Pa'= (V/Across)/'m' * ( (0.171 + 92.7/Reg) * (rhoV/('kg/m^3')*(Ge/('m/s'))^2/(S/'m')) ) 533 * (1/(1C3 * sqrt(Fr) ))^5; 534 535 phiL = C3 * sqrt(Fr); 536 end 537 538 539 end 
branches/packed/sample/stage_separators/sample_tray.mso
r423 r436 38 38 NComp = PP.NumberOfComponents; 39 39 40 VARIABLES 41 deltaP as pressure; 42 phiL as Real; 43 40 44 DEVICES 41 45 t1 as tray; … … 48 52 inL to t1.InletL; 49 53 inV to t1.InletV; 54 55 EQUATIONS 56 deltaP = t1.InletV.P  t1.OutletV.P; 57 phiL = t1.ML*t1.vL / t1.V; 50 58 51 59 SPECIFY … … 78 86 79 87 INITIAL 80 t1.OutletL.T = 290 *'K';81 t1.Level = 0.9* t1.hw;88 t1.OutletL.T = 320 *'K'; 89 t1.Level = 1.2 * t1.hw; 82 90 t1.OutletL.z(1) = 0.5; 83 91 84 92 OPTIONS 85 TimeEnd = 100; 93 InitialFile = "/home/paula/tray_Test.rlt"; 94 TimeStep = 0.5; 95 TimeEnd = 10; 86 96 end 97 98 FlowSheet packedStage_Test 99 PARAMETERS 100 PP as Plugin(Brief="Physical Properties", 101 Type="PP", 102 Components = [ "npentane", "benzene"], 103 LiquidModel = "PR", 104 VapourModel = "PR" 105 ); 106 NComp as Integer; 107 108 SET 109 NComp = PP.NumberOfComponents; 110 111 VARIABLES 112 deltaP as pressure; 113 114 DEVICES 115 t1 as packedStage2; 116 feed as source; 117 inL as liquid_stream; 118 inV as vapour_stream; 119 120 CONNECTIONS 121 feed.Outlet to t1.Inlet; 122 inL to t1.InletL; 123 inV to t1.InletV; 124 125 EQUATIONS 126 deltaP = t1.InletV.P  t1.OutletV.P; 127 128 SPECIFY 129 feed.Outlet.F = 113.4 * 'kmol/h'; 130 feed.Outlet.T = 291 * 'K'; 131 feed.Outlet.P = 1.66 * 'atm'; 132 feed.Outlet.z = [0.5, 0.5]; 133 134 inL.F = 61.99 * 'kmol/h'; 135 inL.P = 1.63 * 'atm'; 136 inL.T = 310 * 'K'; 137 inL.z = [0.1641, 0.8359]; 138 139 inV.F = 201.25 * 'kmol/h'; 140 #inV.F = 240 * 'kmol/h'; 141 inV.P = 1.48 * 'atm'; 142 inV.T = 321 * 'K'; 143 inV.z = [0.0584, 0.9416]; 144 145 t1.Emv = 1; 146 147 SET 148 t1.PressureDropModel = "Leva"; 149 t1.PackingType = "random"; 150 t1.V = 4.1 * 'ft^3'; 151 t1.Q = 0 * 'kW'; 152 t1.Across = 3.94 * 'ft^2';#3.94 * 'ft^2'; 153 t1.Ap = 3.94 * 'ft^2'; 154 155 INITIAL 156 t1.OutletL.T = 320 *'K'; 157 t1.Level = 1.2 * 0.125 * 'ft'; 158 t1.OutletL.z(1) = 0.5; 159 160 OPTIONS 161 InitialFile = "/home/paula/tray_Test.rlt"; 162 TimeStep = 0.5; 163 TimeEnd = 10; 164 end
Note: See TracChangeset
for help on using the changeset viewer.