ipqa-research / yaeos

Thermodynamic Equations of State, Fortran library with both automatic and anallytical derivation capabilities
https://ipqa-research.github.io/yaeos/
Mozilla Public License 2.0
26 stars 4 forks source link

BUG: Flash doesn't really provide the true light phase #60

Closed fedebenelli closed 3 months ago

fedebenelli commented 3 months ago

Right now the flash routine assures that the y fraction is that of the lighter phase. While it generally works, the approach given now in the flash routine is not the most robust one, since it compares molar volumes and the true density of the phase can differ a lot (or even invert concerning molar volumes) on highly asymmetric mixtures.

For now I would just remove that option and just leave the user to know which phase is lighter. A feasible way to do this would be to convert to mass volumes but I don't like the idea of forcing the user to provide molar weights just for this.

fedebenelli commented 3 months ago

For now we provide the solution of the Flash as-is. It's up to the user to know which phase is the light phase.

longemen3000 commented 3 months ago

What about using the phase identification parameter (Π) ? https://doi.org/10.1016/j.fluid.2010.12.001 (at least in VLE, you cannot differentiate the lighter phase in LLE using Π)

fedebenelli commented 3 months ago

Yes! That's a good idea, we had that paper in mind for other part of our algorithms. But now I think it can be a good option in general for our EquilibriaState object. Thanks for the input!