CalebBell / thermo

Thermodynamics and Phase Equilibrium component of Chemical Engineering Design Library (ChEDL)
MIT License
594 stars 114 forks source link

Need example/method for Txy, Pxy, and xy diagrams for binary systems #109

Closed alexchandel closed 1 year ago

alexchandel commented 2 years ago

Txy, Pxy, and xy diagrams are some of the simplest and most fundamental thermodynamic diagrams for characterizing a binary system, and something any thermo user (or student) would want to produce.

There are no examples of, or methods for, generating Txy, Pxy, or xy diagrams. The closest is the plot_TP method of Flash.

They were implemented once here, but this is now relegated to the Legacy Property Packages module.

CalebBell commented 2 years ago

Hi Alex, I may be able to get to this. Two-component systems are essentially two phase, and the flash algorithms for that are pretty good. It is only near the critical point that issues occur, or at very low pressures.

To improve the behavior and allow convergence near the critical point, I want to figure out and understand Dr. Ulrich Deiters and Dr. Ian Bell's paper on the topic:

Deiters, Ulrich K., and Ian H. Bell. “Calculation of Phase Envelopes of Fluid Mixtures through Parametric Marching.” AIChE Journal 0, no. 0 (n.d.): e16730. https://doi.org/10.1002/aic.16730.

I haven't made progress on understanding it so far, however.

Caleb

CalebBell commented 1 year ago

This functionality is now implemented. Binary systems are shown with the Modified UNIFAC model for the liquid phase and Peng-Robinson for the vapor phase, here. Phase envelope functionality for multicomponent systems also has an example, in this case the nitrogen-oxygen-argon system, here.

Limited improvements to the convergence of bubble and dew points has been made in the mean time, as well.