PetroCalcHub

Engineering lesson

Why phase stability is different from solver convergence

Convergence means an iterative calculation satisfied its numerical stopping rules. Phase stability asks whether the proposed equilibrium can lower its Gibbs energy by forming another phase. One does not automatically imply the other.

By PetroCalcHub Team · Updated October 24, 2026 · Free to read and use

Use independent numerical questions

A candidate split should close component balances and satisfy phase fugacity equality within stated tolerances. A single-phase candidate additionally needs a stability assessment under the implemented method.

A solver can converge to a mathematically consistent but inappropriate branch, particularly near difficult phase regions or with poor initialization.

Inspect residual scales and limits

Absolute component error, log-fugacity mismatch and pressure residual use different scales. Reporting only a generic success flag hides which conditions were checked.

The case table records diagnostics from the supported flash engine. The lesson does not claim that one small residual proves global thermodynamic stability for every possible phase model.

Separate implementation verification from fluid validation

Replaying a snapshot checks reproducibility. Comparing an independent implementation checks shared equations. Comparing laboratory measurements evaluates the model for a fluid.

These are different evidence levels. Keep all three distinct when discussing a converged thermodynamic result.

Explore the example

Original synthetic teaching calculation. Equations and fixed controls are stated here; these are not field measurements.

280

Select one of 5 recorded scenarios. Intermediate states are not interpolated.

Selected scenario

Temperature (K) = 280. Maximum component balance error: 5.55111512e-17; Maximum log-fugacity mismatch: 1.86327065e-10; Relative EOS pressure residual: 8.76188011e-12.

Selected result04.5e-108.9e-10240280320Scenario input
  • Maximum component balance error
  • Maximum log-fugacity mismatch
  • Relative EOS pressure residual
Maximum component balance error versus Temperature (K). Green marks the selected row. Lines connect recorded points for orientation; exact solved values are tabulated below.

Worked example

Separate conservation and equilibrium residuals

Same PR feed and 2 MPa pressure as the EOS comparison; temperature varies among actual two-phase solves.

Relation and unit basis

component residual = max|zi − (1 − β)xi − βyi|; equilibrium residual = max|ln(fi,L/fi,V)|

The two errors are dimensionless but measure different conditions. Neither alone establishes experimental accuracy.

  1. 1. Define the baseline

    Temperature (K) = 280

    Same PR feed and 2 MPa pressure as the EOS comparison; temperature varies among actual two-phase solves.

  2. 2. Select the relation

    component residual = max|zi − (1 − β)xi − βyi|; equilibrium residual = max|ln(fi,L/fi,V)|

    The two errors are dimensionless but measure different conditions. Neither alone establishes experimental accuracy.

  3. 3. Substitute the values

    At 280 K: balance error = 5.55111512e-17; log-fugacity mismatch = 1.86327065e-10

    Retain intermediate precision. The displayed values are rounded only after evaluation.

  4. 4. Read the result

    Maximum component balance error = 5.55111512e-17; Maximum log-fugacity mismatch = 1.86327065e-10; Relative EOS pressure residual = 8.76188011e-12

    Inspect stability method, conservation and equilibrium independently. A small residual is numerical evidence for the selected model.

Result and interpretation

Maximum component balance error = 5.55111512e-17; Maximum log-fugacity mismatch = 1.86327065e-10; Relative EOS pressure residual = 8.76188011e-12

Inspect stability method, conservation and equilibrium independently. A small residual is numerical evidence for the selected model.

The selected states are actual recorded solves with separate component and fugacity diagnostics.

Exact scenario data

Original synthetic teaching calculation. Equations and fixed controls are stated here; these are not field measurements.

Exact recorded values for Separate conservation and equilibrium residuals. Units are included in the headers.
Temperature (K)Maximum component balance errorMaximum log-fugacity mismatchRelative EOS pressure residual
2402.9490e-176.2463e-101.1936e-11
2605.5511e-171.7344e-101.0192e-11
2805.5511e-171.8633e-108.7619e-12
3005.5511e-177.2631e-107.5697e-12
3202.7756e-178.9095e-106.5417e-12

Scroll the table to see all columns. The highlighted row is the worked baseline. Downloads retain full numerical precision.

Test your understanding

Work through the question before revealing its answer. Use the stated assumptions and include units in every numerical step.

  1. 1. Can component balances close while fugacities remain unequal?

    Show the worked answer

    Yes. Conservation alone does not establish equilibrium; the chemical-potential conditions require separate checks.

  2. 2. Reproduce the baseline Maximum component balance error without rounding intermediate values.

    Show the worked answer

    At 280 K: balance error = 5.55111512e-17; log-fugacity mismatch = 1.86327065e-10. Maximum component balance error = 5.55111512e-17. Inspect stability method, conservation and equilibrium independently. A small residual is numerical evidence for the selected model.

  3. 3. Compare the first and last recorded scenarios. Which input changes?

    Show the worked answer

    Temperature (K) changes from 240 to 320. Other controls remain as stated in the premise. Maximum component balance error changes from 2.94902991e-17 to 2.77555756e-17.

  4. 4. What would be needed to apply this example to a different physical system?

    Show the worked answer

    Replace the synthetic controls with compatible documented inputs and check the relation's assumptions. The two errors are dimensionless but measure different conditions. Neither alone establishes experimental accuracy. Inspect stability method, conservation and equilibrium independently. A small residual is numerical evidence for the selected model.

Before using the result

  • Inspect conservation and equilibrium separately.
  • Read stability-method scope.
  • Do not equate convergence with experimental accuracy.

Inspect stability method, conservation and equilibrium independently. A small residual is numerical evidence for the selected model.

Continue in the calculator with your documented inputs →

Continue learning

Start with the broader workflow guide

Sources and method

The explanation and synthetic examples are original PetroCalcHub teaching material. The references below support the definitions and model context. They do not supply field validation for the synthetic scenarios.

Report a correction · Read the calculation review method