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.
Select one of 5 recorded scenarios. Intermediate states are not interpolated.
Temperature (K) = 280. Maximum component balance error: 5.55111512e-17; Maximum log-fugacity mismatch: 1.86327065e-10; Relative EOS pressure residual: 8.76188011e-12.
- Maximum component balance error
- Maximum log-fugacity mismatch
- Relative EOS pressure residual
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. 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. 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. 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. 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.
| Temperature (K) | Maximum component balance error | Maximum log-fugacity mismatch | Relative EOS pressure residual |
|---|---|---|---|
| 240 | 2.9490e-17 | 6.2463e-10 | 1.1936e-11 |
| 260 | 5.5511e-17 | 1.7344e-10 | 1.0192e-11 |
| 280 | 5.5511e-17 | 1.8633e-10 | 8.7619e-12 |
| 300 | 5.5511e-17 | 7.2631e-10 | 7.5697e-12 |
| 320 | 2.7756e-17 | 8.9095e-10 | 6.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. 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. 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. 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. 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 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.