|
486 | 486 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", |
487 | 487 | "\u001b[1;31mInfeasibleRegion\u001b[0m Traceback (most recent call last)", |
488 | 488 | "Cell \u001b[1;32mIn[16], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m vle(x\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39marray([\u001b[38;5;241m0.2\u001b[39m, \u001b[38;5;241m0.8\u001b[39m]), P\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m101325\u001b[39m)\n\u001b[0;32m 2\u001b[0m vle\n", |
489 | | - "File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:439\u001b[0m, in \u001b[0;36mVLE.__call__\u001b[1;34m(self, T, P, V, H, S, x, y, gas_conversion, liquid_conversion)\u001b[0m\n\u001b[0;32m 437\u001b[0m thermal_condition\u001b[38;5;241m.\u001b[39mP \u001b[38;5;241m=\u001b[39m P\n\u001b[0;32m 438\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m x_spec:\n\u001b[1;32m--> 439\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Px(P, np\u001b[38;5;241m.\u001b[39masarray(x))\n\u001b[0;32m 440\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m: \u001b[38;5;66;03m# y_spec\u001b[39;00m\n\u001b[0;32m 441\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Py(P, np\u001b[38;5;241m.\u001b[39masarray(y))\n", |
490 | | - "File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:653\u001b[0m, in \u001b[0;36mVLE.set_Px\u001b[1;34m(self, P, x)\u001b[0m\n\u001b[0;32m 651\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_N \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnumber of species in equilibrium must be 2 to specify x\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m 652\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_thermal_condition\u001b[38;5;241m.\u001b[39mT, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_bubble_point\u001b[38;5;241m.\u001b[39msolve_Ty(x, P) \n\u001b[1;32m--> 653\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lever_rule(x, y)\n", |
491 | | - "File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:635\u001b[0m, in \u001b[0;36mVLE._lever_rule\u001b[1;34m(self, x, y)\u001b[0m\n\u001b[0;32m 633\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_z[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\u001b[38;5;241m/\u001b[39m(y[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\n\u001b[0;32m 634\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.00001\u001b[39m \u001b[38;5;241m<\u001b[39m split_frac \u001b[38;5;241m<\u001b[39m \u001b[38;5;241m1.00001\u001b[39m:\n\u001b[1;32m--> 635\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InfeasibleRegion(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mphase composition\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 636\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m split_frac \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 637\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n", |
| 489 | + "File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:450\u001b[0m, in \u001b[0;36mVLE.__call__\u001b[1;34m(self, T, P, V, H, S, Q, B, x, y, gas_conversion, liquid_conversion)\u001b[0m\n\u001b[0;32m 448\u001b[0m thermal_condition\u001b[38;5;241m.\u001b[39mP \u001b[38;5;241m=\u001b[39m P\n\u001b[0;32m 449\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m x_spec:\n\u001b[1;32m--> 450\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Px(P, np\u001b[38;5;241m.\u001b[39masarray(x))\n\u001b[0;32m 451\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m: \u001b[38;5;66;03m# y_spec\u001b[39;00m\n\u001b[0;32m 452\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Py(P, np\u001b[38;5;241m.\u001b[39masarray(y))\n", |
| 490 | + "File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:664\u001b[0m, in \u001b[0;36mVLE.set_Px\u001b[1;34m(self, P, x)\u001b[0m\n\u001b[0;32m 662\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_N \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnumber of species in equilibrium must be 2 to specify x\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m 663\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_thermal_condition\u001b[38;5;241m.\u001b[39mT, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_bubble_point\u001b[38;5;241m.\u001b[39msolve_Ty(x, P) \n\u001b[1;32m--> 664\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lever_rule(x, y)\n", |
| 491 | + "File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:646\u001b[0m, in \u001b[0;36mVLE._lever_rule\u001b[1;34m(self, x, y)\u001b[0m\n\u001b[0;32m 644\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_z[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\u001b[38;5;241m/\u001b[39m(y[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\n\u001b[0;32m 645\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.00001\u001b[39m \u001b[38;5;241m<\u001b[39m split_frac \u001b[38;5;241m<\u001b[39m \u001b[38;5;241m1.00001\u001b[39m:\n\u001b[1;32m--> 646\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InfeasibleRegion(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mphase composition\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 647\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m split_frac \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 648\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n", |
492 | 492 | "\u001b[1;31mInfeasibleRegion\u001b[0m: phase composition is infeasible" |
493 | 493 | ] |
494 | 494 | } |
|
514 | 514 | }, |
515 | 515 | { |
516 | 516 | "cell_type": "code", |
517 | | - "execution_count": 17, |
| 517 | + "execution_count": null, |
518 | 518 | "metadata": { |
519 | 519 | "tags": [ |
520 | 520 | "nbval-skip" |
521 | 521 | ] |
522 | 522 | }, |
523 | | - "outputs": [ |
524 | | - { |
525 | | - "data": { |
526 | | - "text/plain": [ |
527 | | - "LLE(imol=MolarFlowIndexer(\n", |
528 | | - " L=[('Water', 290.6), ('Octane', 0.02062), ('Butanol', 4.3)],\n", |
529 | | - " l=[('Water', 13.35), ('Octane', 99.98), ('Butanol', 25.7)]),\n", |
530 | | - " thermal_condition=ThermalCondition(T=360.00, P=101325))" |
531 | | - ] |
532 | | - }, |
533 | | - "execution_count": 17, |
534 | | - "metadata": {}, |
535 | | - "output_type": "execute_result" |
536 | | - } |
537 | | - ], |
| 523 | + "outputs": [], |
538 | 524 | "source": [ |
539 | 525 | "bst.settings.set_thermo(['Water', 'Octane', 'Butanol'])\n", |
540 | 526 | "lle = bst.equilibrium.LLE()\n", |
|
566 | 552 | }, |
567 | 553 | { |
568 | 554 | "cell_type": "code", |
569 | | - "execution_count": 18, |
| 555 | + "execution_count": 17, |
570 | 556 | "metadata": {}, |
571 | 557 | "outputs": [ |
572 | 558 | { |
|
577 | 563 | " thermal_condition=ThermalCondition(T=298.15, P=101325))" |
578 | 564 | ] |
579 | 565 | }, |
580 | | - "execution_count": 18, |
| 566 | + "execution_count": 17, |
581 | 567 | "metadata": {}, |
582 | 568 | "output_type": "execute_result" |
583 | 569 | } |
|
610 | 596 | }, |
611 | 597 | { |
612 | 598 | "cell_type": "code", |
613 | | - "execution_count": 19, |
| 599 | + "execution_count": 18, |
614 | 600 | "metadata": {}, |
615 | 601 | "outputs": [ |
616 | 602 | { |
|
623 | 609 | " thermal_condition=ThermalCondition(T=355.00, P=101325))" |
624 | 610 | ] |
625 | 611 | }, |
626 | | - "execution_count": 19, |
| 612 | + "execution_count": 18, |
627 | 613 | "metadata": {}, |
628 | 614 | "output_type": "execute_result" |
629 | 615 | } |
|
635 | 621 | }, |
636 | 622 | { |
637 | 623 | "cell_type": "code", |
638 | | - "execution_count": 20, |
| 624 | + "execution_count": 19, |
639 | 625 | "metadata": {}, |
640 | 626 | "outputs": [ |
641 | 627 | { |
|
648 | 634 | " thermal_condition=ThermalCondition(T=355.00, P=101325))" |
649 | 635 | ] |
650 | 636 | }, |
651 | | - "execution_count": 20, |
| 637 | + "execution_count": 19, |
652 | 638 | "metadata": {}, |
653 | 639 | "output_type": "execute_result" |
654 | 640 | } |
|
661 | 647 | }, |
662 | 648 | { |
663 | 649 | "cell_type": "code", |
664 | | - "execution_count": 24, |
| 650 | + "execution_count": 20, |
665 | 651 | "metadata": {}, |
666 | 652 | "outputs": [ |
667 | 653 | { |
668 | 654 | "data": { |
669 | 655 | "text/plain": [ |
670 | | - "VLLE(imol=MolarFlowIndexer(phases=('L', 'g', 'l'),\n", |
671 | | - " L=[('Water', 0.0277), ('Octane', 0.3545), ('Ethanol', 0.006609)],\n", |
672 | | - " g=[('Water', 0.4723), ('Octane', 0.1455), ('Ethanol', 0.09339)]),\n", |
673 | | - " thermal_condition=ThermalCondition(T=352.48, P=101325))" |
| 656 | + "VLLE(imol=MolarFlowIndexer(\n", |
| 657 | + " L=[('Water', 0.1662), ('Octane', 1.281e-05), ('Ethanol', 0.004298)],\n", |
| 658 | + " g=[('Water', 0.3142), ('Octane', 0.1462), ('Ethanol', 0.08958)],\n", |
| 659 | + " l=[('Water', 0.01961), ('Octane', 0.3538), ('Ethanol', 0.006125)]),\n", |
| 660 | + " thermal_condition=ThermalCondition(T=358.76, P=101325))" |
674 | 661 | ] |
675 | 662 | }, |
676 | | - "execution_count": 24, |
| 663 | + "execution_count": 20, |
677 | 664 | "metadata": {}, |
678 | 665 | "output_type": "execute_result" |
679 | 666 | } |
|
682 | 669 | "vlle(V=0.5, P=101325)\n", |
683 | 670 | "vlle" |
684 | 671 | ] |
685 | | - }, |
686 | | - { |
687 | | - "cell_type": "code", |
688 | | - "execution_count": 26, |
689 | | - "metadata": {}, |
690 | | - "outputs": [ |
691 | | - { |
692 | | - "data": { |
693 | | - "text/plain": [ |
694 | | - "VLLE(imol=MolarFlowIndexer(phases=('L', 'g', 'l'),\n", |
695 | | - " L=[('Water', 0.02769), ('Octane', 0.3545), ('Ethanol', 0.006608)],\n", |
696 | | - " g=[('Water', 0.4723), ('Octane', 0.1455), ('Ethanol', 0.09339)]),\n", |
697 | | - " thermal_condition=ThermalCondition(T=352.48, P=101323))" |
698 | | - ] |
699 | | - }, |
700 | | - "execution_count": 26, |
701 | | - "metadata": {}, |
702 | | - "output_type": "execute_result" |
703 | | - } |
704 | | - ], |
705 | | - "source": [ |
706 | | - "vlle(V=0.5, T=352.48)\n", |
707 | | - "vlle" |
708 | | - ] |
709 | 672 | } |
710 | 673 | ], |
711 | 674 | "metadata": { |
|
0 commit comments