Skip to content

Fix CO2 hydrate tutorial for 10 wt% KCl and finite CO2 inventory - #188

Merged
EvenSol merged 1 commit into
masterfrom
codex/fix-kcl-hydrate-notebook-20261005
Oct 5, 2026
Merged

EvenSol merged 1 commit into
masterfrom
codex/fix-kcl-hydrate-notebook-20261005

Conversation

@EvenSol

@EvenSol EvenSol commented Oct 5, 2026

Copy link
Copy Markdown
Owner

The hydrate tutorial pins a September Java snapshot that does not return within 90 s for 11.3 bara, 10 wt% KCl and 2.805906013 mol CO2/kg water. Refresh the source pin to the inspected NeqSim master snapshot containing the existing CO2/brine phase-selection and inventory repairs.

The reported case now converges to -2.545659 °C, with GAS+AQUEOUS, conserved original feed and saturated-boundary evidence. Add the exact reproducer plus 16 pressure/inventory controls, a fresh-fluid hydt comparison, solver convergence and original-feed diagnostics. Retest the formerly rejected high-pressure and calcium controls and retain all freshly executed outputs. Diagnostic tables show full labels and small residuals.

At 9, 11.3 and 15 bara, 2.805906013 and 10 mol CO2 both have a free CO2-rich phase and differ by at most 8.20e-5 K. At 20 bara, the smaller inventory is single aqueous in this model and is kept separate from the saturated boundary. hydt returns kelvin; Python bridge 3.20.0 defaults to structure I and the integer overload, whose starting policy differs from the no-argument call.

Validation:

  • Java source: f59810115c07d9a3ef479e55be45a5972963231d, clean source-built 3.23.0 JAR; class origin and SHA-256 asserted. Python bridge 3.20.0, Java 17.0.20, Python 3.12.14.
  • Final fresh Python/IPython process and JVM: 21/21 cells in 198.1 s; 19 integrated checks passed; 85 hydrate attempts retained, 36/36 principal curve points accepted; zero stored exceptions or stderr. Reported KCl case: about 0.24 s in the final run.
  • Original September source: external 90 s deadline exceeded (exit 124); bundled bridge JAR separately exceeded 60 s.
  • Ten-point NaCl benchmark: MAE 0.143375 K, RMSE 0.186998 K; no parameter fitting. KCl controls are numerical regression evidence, not experimental qualification; ice coexistence is outside the notebook.
  • Checker unit tests: 6 passed. Focused strict notebook/provenance checker: 0 errors, 0 warnings. Schema, AST, <=100-character code lines, complete retained outputs, Colab math and whitespace checks passed.
  • All 24 rendered review pages, seven figures and 26 MathJax expressions inspected through nbconvert/MathJax SVG, WeasyPrint and Poppler. Entire catalog also rendered and inspected; existing catalog target set unchanged.
  • Reused verified source JAR via documented environment overrides; hosted Colab installation/remote-checkout path not exercised locally. Repository-wide integrity awaits CI.

Documentation impact: source/restart instructions, KCl pressure/inventory explanation, hydt units/overloads, historical repaired controls, CSV export, catalog entry and maintenance ledger updated. Java implementation and model parameters are unchanged. Existing equinor/neqsim#3584 and equinor/neqsim#3585 track the library repairs; no duplicate defect filed.

Open the corrected branch in Colab

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.

1 participant