Changeset 579 for branches/gui/eml/streams.mso
- Timestamp:
- Jul 26, 2008, 4:01:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/streams.mso
r578 r579 143 143 end 144 144 145 Model simple_source146 ATTRIBUTES147 Pallete = true;148 Icon = "icon/Source";149 Brief = "Simple material stream source";150 Info = "151 This model should be used for boundary streams.152 Usually these streams are known and come from another process153 units.154 155 The user should specify:156 * Total molar flow157 * Temperature158 * Pressure159 * Molar composition160 ";161 162 PARAMETERS163 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");164 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);165 166 VARIABLES167 out Outlet as stream (Brief = "Outlet stream", PosX=1, PosY=0.5256, Symbol="_{out}");168 x(NComp) as fraction (Brief = "Liquid Molar Fraction",Hidden=true);169 y(NComp) as fraction (Brief = "Vapour Molar Fraction",Hidden=true);170 hl as enth_mol (Brief = "Liquid Enthalpy");171 hv as enth_mol (Brief = "Vapour Enthalpy");172 s as entr_mol (Brief = "Stream Entropy");173 sl as entr_mol (Brief = "Liquid Entropy");174 sv as entr_mol (Brief = "Vapour Entropy");175 176 EQUATIONS177 "Flash Calculation"178 [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);179 180 "Overall Enthalpy"181 Outlet.h = (1-Outlet.v)*hl + Outlet.v*hv;182 183 "Liquid Enthalpy"184 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);185 186 "Vapour Enthalpy"187 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);188 189 "Overall Entropy"190 s = (1-Outlet.v)*sl + Outlet.v*sv;191 192 "Liquid Entropy"193 sl = PP.LiquidEntropy(Outlet.T, Outlet.P, x);194 195 "Vapour Entropy"196 sv = PP.VapourEntropy(Outlet.T, Outlet.P, y);197 end198 199 145 Model sink 200 146 ATTRIBUTES … … 582 528 583 529 end 530 531 Model simple_source 532 533 ATTRIBUTES 534 Pallete = true; 535 Icon = "icon/Source"; 536 Brief = "Simple Material stream source"; 537 Info = " 538 This model should be used for boundary streams. 539 Usually these streams are known and come from another process 540 units. 541 542 The user should specify: 543 * Total molar flow 544 * Temperature 545 * Pressure 546 * Molar composition 547 "; 548 549 PARAMETERS 550 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 551 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 552 M(NComp) as molweight (Brief = "Component Mol Weight"); 553 ValidPhases as Switcher (Brief = "Valid Phases for Flash Calculation", Valid = ["Vapour-Only", "Liquid-Only","Vapour-Liquid"], Default="Vapour-Liquid"); 554 555 556 SET 557 558 M = PP.MolecularWeight(); 559 560 VARIABLES 561 562 out Outlet as stream (Brief = "Outlet stream", PosX=1, PosY=0.5256, Symbol="_{out}",Protected=false); 563 564 MolarComposition(NComp) as fraction (Brief = "Stream Molar Composition"); 565 F as flow_mol (Brief = "Stream Molar Flow Rate"); 566 T as temperature (Brief = "Stream Temperature"); 567 T_Cdeg as temperature (Brief = "Temperature in °C", Lower=-200); 568 P as pressure (Brief = "Stream Pressure"); 569 570 x(NComp) as fraction (Brief = "Liquid Molar Fraction",Hidden=true); 571 y(NComp) as fraction (Brief = "Vapour Molar Fraction",Hidden=true); 572 573 574 EQUATIONS 575 576 "Stream Molar Composition" 577 Outlet.z = MolarComposition/sum(MolarComposition); 578 579 580 switch ValidPhases 581 582 case "Liquid-Only": 583 584 "Vapour Fraction" 585 Outlet.v = 0; 586 587 "Liquid Composition" 588 x = Outlet.z; 589 590 "Vapour Composition" 591 y = Outlet.z; 592 593 "Overall Enthalpy" 594 Outlet.h = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x); 595 596 597 case "Vapour-Only": 598 599 "Vapor Fraction" 600 Outlet.v = 1; 601 602 "Liquid Composition" 603 x = Outlet.z; 604 605 "Vapour Composition" 606 y = Outlet.z; 607 608 "Overall Enthalpy" 609 Outlet.h = PP.VapourEnthalpy(Outlet.T, Outlet.P, y); 610 611 612 case "Vapour-Liquid": 613 614 "Flash Calculation" 615 [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z); 616 617 "Overall Enthalpy" 618 Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y); 619 620 621 end 622 623 "Temperature in °C" 624 T_Cdeg = Outlet.T - 273.15 * 'K'; 625 626 "Equate Flow" 627 Outlet.F = F; 628 629 "Equate Pressures" 630 Outlet.P = P; 631 632 "Equate Temperatures" 633 Outlet.T = T; 634 635 end
Note: See TracChangeset
for help on using the changeset viewer.