Skip to content

Conversation

@prehner
Copy link
Contributor

@prehner prehner commented Dec 18, 2025

This is based on the discussion in #254

This issue seems to affect most phase equilibrium algorithms in feos. We focus on the most important ones

Critical points ✅

The issue is related to the eigenvectors of the 0 components, as well as their composition going to 0 which creates numerical problems. I did not find a way to circumvent this by rewriting the expressions, but we can simply catch the special case (although that might effect the calculation of derivatives)

Bubble and dew points ℹ️

There are actually a number of points where x_i=0 leads to failure:
  • The definition of the residual in the outer loop |(k_i x_i)/y_i| -> could be changed to absolute error
  • The residual in the newton step mu_i^L=mu_i^V due to to the divergence in the ideal gas term -> could be changed to isofugacity
  • related: Other divisions by 0/divergences in the ideal gas term in the calculation of the Jacobian -> should be gone when switching to fugacities

Tp flash ✅

An actual bug that set `ln(x/y)` to zero instead of the residual `ln(x phi_l/(y phi_v))`. Fixed by changing the residual (which is only used for determining convergence) from `ln(x phi_l/(y phi_v))` to `x phi_l/phi_v - y`.

@prehner
Copy link
Contributor Author

prehner commented Jan 14, 2026

I suggest merging these fixes for critical points and the tp flash and postponing bubble and dew points to a later stage. While these fixes only marginally affect convergence (through a slightly different stopping criterion), changing the bubble/dew point routines would mean a more thorough rewrite that would likely also have an influence on the convergence behavior of the method.

@prehner prehner marked this pull request as ready for review January 14, 2026 12:10
@prehner prehner requested a review from g-bauer January 14, 2026 12:10
@prehner prehner merged commit a1bca60 into main Jan 15, 2026
16 checks passed
@prehner prehner deleted the zero_composition branch January 15, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants