Changeset 775 for branches/gui/eml/stage_separators/column.mso
- Timestamp:
- Jun 19, 2009, 5:16:03 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/column.mso
r774 r775 92 92 ATTRIBUTES 93 93 Pallete = false; 94 Icon = "icon/SectionColumn"; 95 Brief = "Model of a column section."; 94 Brief = "Model of a basic column section."; 96 95 Info = 97 96 "Model of a basic column section containing a vetor of TRAYS numbered from the top-down."; … … 330 329 end 331 330 332 Model Section_Column as Section_ColumnBasic 331 332 333 334 335 Model Section_Column 333 336 334 337 ATTRIBUTES … … 352 355 "; 353 356 357 PARAMETERS 358 outer PP as Plugin (Brief="External Physical Properties", Type="PP"); 359 outer NComp as Integer (Brief="Number of components"); 360 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 361 # Section Column Feed Tray - Side Streams Location and Numbering 362 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 363 NumberOfTrays as Integer (Brief="Number of trays", Default=8); 364 FeedTrayIndex(NumberOfTrays) as Integer (Brief="Feed Tray Index", Default=0,Hidden=true); 365 LiqSideTrayIndex(NumberOfTrays) as Integer (Brief="Liquid Side Tray Index", Default=0,Hidden=true); 366 VapSideTrayIndex(NumberOfTrays) as Integer (Brief="Vapour Side Tray Index", Default=0,Hidden=true); 367 FeedTrayLocation as Integer (Brief="Feed tray Location", Default=2); 368 LiquidSideStreamLocation as Integer (Brief="Liquid Side Stream Location", Default=2); 369 VapourSideStreamLocation as Integer (Brief="Vapour Side Stream Location", Default=2); 370 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 371 Mw(NComp) as molweight (Brief="Component Mol Weight",Hidden=true); 372 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 373 # Section Column Flow Model for Liquid and Vapour 374 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 375 VapourFlowModel as Switcher (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer"); 376 LiquidFlowModel as Switcher (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default"); 377 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 378 # Section Column Tray Geometry and Auxiliar Parameters 379 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 380 VolumeOfTray as volume (Brief="Total Volume of the tray"); 381 HeatSupply as heat_rate (Brief="Rate of heat supply"); 382 PlateArea as area (Brief="Plate area = Atray - Adowncomer"); 383 HolesArea as area (Brief="Total holes area"); 384 WeirLength as length (Brief="Weir length"); 385 WeirHeight as length (Brief="Weir height"); 386 FeeheryCoeff as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1); 387 ElgueCoeff as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1); 388 OlsenCoeff as Real (Brief="Olsens correlation coefficient", Default=1); 389 TrayLiquidPasses as Real (Brief="Number of liquid passes in the tray", Default=1); 390 391 V as volume (Brief="Total Volume of the tray",Hidden=true); 392 Q as heat_rate (Brief="Rate of heat supply",Hidden=true); 393 Ap as area (Brief="Plate area = Atray - Adowncomer",Hidden=true); 394 Ah as area (Brief="Total holes area",Hidden=true); 395 lw as length (Brief="Weir length",Hidden=true); 396 hw as length (Brief="Weir height",Hidden=true); 397 beta as fraction (Brief="Aeration fraction"); 398 alfa as fraction (Brief="Dry pressure drop coefficient"); 399 w as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1,Hidden=true); 400 btray as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1,Hidden=true); 401 fw as Real (Brief="Olsens correlation coefficient", Default=1,Hidden=true); 402 Np as Real (Brief="Number of liquid passes in the tray", Default=1,Hidden=true); 403 404 VapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); 405 LiquidFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); 406 407 SET 408 FeedTrayIndex(FeedTrayLocation) =1; 409 VapSideTrayIndex(FeedTrayLocation) =1; 410 LiqSideTrayIndex(FeedTrayLocation) =1; 411 Mw = PP.MolecularWeight(); 412 413 V=VolumeOfTray; 414 Q=HeatSupply; 415 Ap=PlateArea; 416 Ah=HolesArea; 417 lw=WeirLength; 418 hw=WeirHeight ; 419 w=FeeheryCoeff; 420 btray=ElgueCoeff; 421 fw=OlsenCoeff; 422 Np=TrayLiquidPasses; 423 354 424 VARIABLES 355 425 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 356 # Section Inlet and Outlet Material Ports 357 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 426 # Tray Initialization For the Whole Column Section 427 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 428 INITIALIZATION as InitializeSection (Brief = "Column Model Initialization"); 429 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 430 # Control Ports 431 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 432 CONTROL as ControlSection (Brief = "Control"); 433 out TCI as control_signal (Brief="Temperature Indicator", Protected = true, PosX=1, PosY=0.90); 434 out PCI as control_signal (Brief="Pressure Indicator", Protected = true, PosX=1, PosY=0.80); 435 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 436 # Section Inlet Liquid and Outlet Vapour Material Ports 437 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 438 in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0); 439 out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0); 440 358 441 out VapourDrawOff as vapour_stream (Brief="Vapour Draw Off Port in the section", PosX=1, PosY=0.35,Protected = true); 359 442 out LiquidDrawOff as liquid_stream (Brief="Liquid Draw Off Port in the section", PosX=1, PosY=0.65,Protected = true); 360 361 in LiquidInlet as stream (Brief="Liquid Inlet in the section", PosX=0.70, PosY=0); 362 out VapourOutlet as vapour_stream (Brief="Vapour Outlet in the section", PosX=0.30, PosY=0); 363 443 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 444 # Column Feed - Side Stream Flow and Murphree Efficiency 445 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 446 in FeedTray as stream (Brief="Feed stream", PosX=0, PosY=0.55); 447 TRAYS(NumberOfTrays) as tray (Brief="Number of trays in the Column Section"); 448 VapourDrawOffFlow as flow_mol (Brief="Stream Molar Flow Rate"); 449 LiquidDrawOffFlow as flow_mol (Brief="Stream Molar Flow Rate"); 450 MurphreeEff as positive (Brief="Murphree efficiency for All Trays"); 451 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 452 # Section Inlet Vapour and Outlet Liquid Material Ports 453 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 364 454 in VapourInlet as stream (Brief="Vapour Inlet in the section", PosX=0.30, PosY=1); 365 455 out LiquidOutlet as liquid_stream (Brief="Liquid Outlet in the section", PosX=0.70, PosY=1); 366 456 367 457 LiquidConnector as stream (Brief="Liquid connection in the middle TRAYS", PosX=0.75, PosY=1,Hidden=true); 368 458 VapourConnector as stream (Brief="Vapour connection in the middle TRAYS", PosX=0.55, PosY=0,Hidden=true); 369 459 370 460 CONNECTIONS 371 461 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 462 # Connecting Intermediate Trays 463 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 464 TRAYS([2:NumberOfTrays]).OutletVapour to TRAYS([1:NumberOfTrays-1]).InletVapour; 465 TRAYS([1:NumberOfTrays-1]).OutletLiquid to TRAYS([2:NumberOfTrays]).InletLiquid; 466 467 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 468 # Connecting Connectors 469 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 372 470 LiquidConnector to TRAYS(1).InletLiquid; 373 471 VapourConnector to TRAYS(NumberOfTrays).InletVapour; 374 472 473 INITIAL 474 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 475 # Tray Initialization 476 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 477 for i in 1:NumberOfTrays do 478 479 "The initial temperature of the TRAYS" 480 TRAYS(i).OutletLiquid.T = INITIALIZATION.TopTemperature+(INITIALIZATION.BottomTemperature-INITIALIZATION.TopTemperature)*((i-1)/(NumberOfTrays-1)); 481 482 "The initial Level of the TRAYS" 483 TRAYS(i).Level = INITIALIZATION.LevelFraction*hw; 484 end 485 486 for i in 1:NComp-1 do 487 488 for j in 1:NumberOfTrays do 489 490 "The initial composition of the TRAYS - Normalized" 491 TRAYS(j).OutletLiquid.z(i) = INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) +(INITIALIZATION.BottomComposition(i)/sum(INITIALIZATION.BottomComposition)-INITIALIZATION.TopComposition(i)/sum(INITIALIZATION.TopComposition) )*((j-1)/(NumberOfTrays-1)); 492 end 493 494 end 495 375 496 EQUATIONS 497 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 498 # Control Ports 499 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 500 501 "Tray Temperature Indicator" 502 #TCI*'K' = TRAYS(min([NumberOfTrays, CONTROL.Tindicator_TrayNumber])).OutletVapour.T; 503 TCI*'K' = TRAYS(CONTROL.Tindicator_TrayNumber).OutletVapour.T; 504 505 "Tray Pressure Indicator" 506 #PCI*'atm' = TRAYS(min([NumberOfTrays, CONTROL.Pindicator_TrayNumber])).OutletVapour.P; 507 PCI*'atm' = TRAYS(CONTROL.Pindicator_TrayNumber).OutletVapour.P; 508 509 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 510 # Equating Feed Tray Variables to Trays Variables 511 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 512 "Feed Tray Inlet Flow" 513 FeedTray.F*FeedTrayIndex= TRAYS.Inlet.F; 514 515 "Feed Tray Inlet Temperature" 516 FeedTray.T = TRAYS.Inlet.T; 517 518 "Feed Tray Inlet Pressure" 519 FeedTray.P = TRAYS.Inlet.P; 520 521 "Feed Tray Inlet Composition" 522 FeedTray.z = TRAYS.Inlet.z; 523 524 "Feed Tray Inlet Vapour Fraction" 525 FeedTray.v = TRAYS.Inlet.v; 526 527 "Feed Tray Inlet Enthalpy" 528 FeedTray.h = TRAYS.Inlet.h; 529 530 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 531 # Trays Equations 532 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 533 for i in [1:NumberOfTrays] do 534 535 "Murphree Efficiency" 536 TRAYS(i).OutletVapour.z = MurphreeEff * (TRAYS(i).yideal - TRAYS(i).InletVapour.z) + TRAYS(i).InletVapour.z; 537 538 "Level of clear liquid over the weir" 539 TRAYS(i).Level = TRAYS(i).ML*TRAYS(i).vL/Ap; 540 541 "Geometry Constraint" 542 V = TRAYS(i).ML* TRAYS(i).vL + TRAYS(i).MV*TRAYS(i).vV; 543 544 "Energy Holdup" 545 TRAYS(i).E = TRAYS(i).ML*TRAYS(i).OutletLiquid.h + TRAYS(i).MV*TRAYS(i).OutletVapour.h - TRAYS(i).OutletLiquid.P*V; 546 547 "Energy Balance" 548 diff(TRAYS(i).E) = ( TRAYS(i).Inlet.F*TRAYS(i).Inlet.h + TRAYS(i).InletLiquid.F*TRAYS(i).InletLiquid.h + TRAYS(i).InletVapour.F*TRAYS(i).InletVapour.h- TRAYS(i).OutletLiquid.F*TRAYS(i).OutletLiquid.h - TRAYS(i).OutletVapour.F*TRAYS(i).OutletVapour.h 549 -TRAYS(i).VapourSideStream.F*TRAYS(i).VapourSideStream.h - TRAYS(i).LiquidSideStream.F*TRAYS(i).LiquidSideStream.h + Q ); 550 551 switch LiquidFlow 552 case "on": 553 switch LiquidFlowModel 554 case "default": 555 "Francis Equation" 556 TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'1/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^2; 557 558 case "Wang_Fl": 559 TRAYS(i).OutletLiquid.F*TRAYS(i).vL = 1.84*'m^0.5/s'*lw*((TRAYS(i).Level-(beta*hw))/(beta))^1.5; 560 561 case "Olsen": 562 TRAYS(i).OutletLiquid.F / 'mol/s'= lw*Np*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletVapour.z)/(0.665*fw)^1.5 * ((TRAYS(i).ML*sum(Mw*TRAYS(i).OutletLiquid.z)/TRAYS(i).rhoL/Ap)-hw)^1.5 * 'm^0.5/mol'; 563 564 case "Feehery_Fl": 565 TRAYS(i).OutletLiquid.F = lw*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletLiquid.z) * ((TRAYS(i).Level-hw)/750/'mm')^1.5 * 'm^2/s'; 566 567 case "Roffel_Fl": 568 TRAYS(i).OutletLiquid.F = 2/3*TRAYS(i).rhoL/sum(Mw*TRAYS(i).OutletLiquid.z)*lw*(TRAYS(i).ML*sum(Mw*TRAYS(i).OutletLiquid.z)/(Ap*1.3)/TRAYS(i).rhoL)^1.5*sqrt(2*g/ 569 (2*(1 - 0.3593/'Pa^0.0888545'*abs(TRAYS(i).OutletVapour.F*sum(Mw*TRAYS(i).OutletVapour.z)/(Ap*1.3)/sqrt(TRAYS(i).rhoV))^0.177709)-1)); #/'(kg/m)^0.0888545/s^0.177709'; 570 end 571 when TRAYS(i).Level < (beta *hw) switchto "off"; 572 573 case "off": 574 "Low level" 575 TRAYS(i).OutletLiquid.F = 0 * 'mol/h'; 576 when TRAYS(i).Level > (beta * hw) + 1e-6*'m' switchto "on"; 577 end 578 579 switch VapourFlow 580 case "on": 581 switch VapourFlowModel 582 case "Reepmeyer": 583 TRAYS(i).InletVapour.F*TRAYS(i).vV = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/(TRAYS(i).rhoV*alfa))*Ah; 584 585 case "Feehery_Fv": 586 TRAYS(i).InletVapour.F = TRAYS(i).rhoV/Ap/w/sum(Mw*TRAYS(i).OutletVapour.z) * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-(TRAYS(i).rhoV*g*TRAYS(i).ML*TRAYS(i).vL/Ap))/TRAYS(i).rhoV); 587 588 case "Roffel_Fv": 589 TRAYS(i).InletVapour.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)*1e5 - (beta*sum(TRAYS(i).M*Mw)/(Ap*1.3)*g*1e5) * (TRAYS(i).rhoV*Ah/sum(Mw*TRAYS(i).OutletVapour.z))^1.08 * 'm^1.08/mol^1.08'; 590 591 case "Klingberg": 592 TRAYS(i).InletVapour.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV); 593 594 case "Wang_Fv": 595 TRAYS(i).InletVapour.F * TRAYS(i).vV = Ap * sqrt(((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)-TRAYS(i).rhoL*g*TRAYS(i).Level)/TRAYS(i).rhoV*alfa); 596 597 case "Elgue": 598 TRAYS(i).InletVapour.F = sqrt((TRAYS(i).InletVapour.P - TRAYS(i).OutletVapour.P)/btray); 599 end 600 when TRAYS(i).InletVapour.F < 1e-6 * 'kmol/h' switchto "off"; 601 602 case "off": 603 TRAYS(i).InletVapour.F = 0 * 'mol/s'; 604 when TRAYS(i).InletVapour.P > TRAYS(i).OutletVapour.P + TRAYS(i).Level*g*TRAYS(i).rhoL + 1e-1 * 'atm' switchto "on"; 605 end 606 607 end 608 376 609 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 377 610 # Equating Inlet Liquid Connector Variables
Note: See TracChangeset
for help on using the changeset viewer.