Skip to content

[Campaign] Electrolyte thermodynamics, reactive equilibrium and phase-behavior roadmap #3144

Description

@EvenSol

Purpose

Create a durable engineering campaign for continuously improving NeqSim electrolyte calculations, including thermodynamic models, flash and stability algorithms, chemical-reaction equilibrium, data regression, and coupled process applications.

The campaign must turn literature and public experimental data into verified, reusable NeqSim improvements. It is not a sequence of isolated dataset fits: every increment must improve a clearly stated validity range without degrading previously supported fluids, neutral systems, or established APIs.

Maintain at most one active implementation PR for this campaign. Use this issue as the persistent roadmap and run ledger for scope, evidence, accepted data, active work, blockers, merged increments, and the next dependency-ready hypothesis.

Engineering outcomes

Improve reliable calculation of:

  1. gas–water–salt and gas–oil–water–ion phase equilibrium;
  2. hydrate equilibrium in brines, hydrocarbon liquids, mixed inhibitors, acid gases, and reactive aqueous systems;
  3. mineral-scale saturation and precipitation in gas–oil–water systems;
  4. aqueous chemical equilibrium with ions, charge balance, acid/base reactions, water dissociation, complex formation, and salt speciation;
  5. CO2 and H2S absorption in alkanolamines, including MEA, MDEA and promoted/mixture systems where supported by public data;
  6. reactive absorbers and process calculations using the same thermodynamic and reaction basis as standalone equilibrium calculations;
  7. electrolyte-model parameters, mixing rules, activity/fugacity formulations, properties, initialization, convergence, diagnostics, and performance;
  8. Java and Python usability, documentation, examples, and reproducible benchmarks.

Owned scope

  • electrolyte CPA and other NeqSim electrolyte-capable thermodynamic models;
  • aqueous activity/fugacity coefficients, standard states, dielectric/electrostatic terms, association, ion–molecule and ion–ion interactions;
  • parameter provenance, regression, uncertainty, validity ranges, and missing-parameter behavior;
  • electrolyte-aware phase stability, TP/multiphase/reactive/solid/hydrate flashes and continuation/fallback behavior;
  • reaction-set construction, speciation, electroneutrality, elemental conservation, reaction-equilibrium residuals, and phase/reaction coupling;
  • hydrate chemical-potential calculations with salts, thermodynamic inhibitors, hydrocarbons, oil, and reactive brines;
  • mineral precipitation/dissolution, saturation indices, solid-phase selection, and complementarity;
  • alkanolamine acid-gas VLE/speciation/loading/heat effects and equilibrium support needed by rigorous absorber calculations;
  • electrolyte-specific diagnostics, deterministic repeated execution, stale-state protection, cloning, serialization and thread safety;
  • focused performance work that preserves the accepted physical and numerical path;
  • validation datasets, regression tools, tests, documentation, and executable examples.

Coordination boundaries

Coordinate instead of duplicating:

  • generic TP-flash and multiphase solver work: #2937;
  • reactive absorber equipment and column architecture: #205;
  • neutral-salt input/API behavior: #448;
  • generic hybrid EOS/aqueous model architecture: #2862.

A generic flash defect belongs to #2937. An electrolyte-specific reproducer, thermodynamic-model change, reaction coupling, or parameter/data improvement belongs here. If one increment touches both areas, use one coordinated PR and update both ledgers; never open competing implementation PRs.

The current electrolyte/hydrate increment is draft PR #3142. The first campaign run must inspect its exact current head, CI, reviews, diff, scientific evidence, and overlap before selecting new work.

Frozen validation matrix

Every applicable implementation increment must freeze a deterministic subset of this matrix before editing and retain the smallest public reproducer.

A. Brine and aqueous speciation

  • water + NaCl over dilute to concentrated conditions and a justified temperature/pressure range;
  • mixed ions including Na+, K+, Ca2+, Mg2+, Cl-, sulfate and carbonate species where model support and public data exist;
  • water dissociation, acid/base systems, CO2/H2O/carbonate/bicarbonate, and H2S species where applicable;
  • charge-neutral and deliberately difficult initial compositions;
  • repeated, changed-state, and nearby concentration/T/P paths.

B. Multiphase hydrocarbon/electrolyte systems

  • GAS+AQUEOUS, OIL+AQUEOUS, and GAS+OIL+AQUEOUS;
  • methane-rich, CO2-rich, H2S-containing, condensate/oil, water, single salt, and mixed brine;
  • phase appearance/disappearance, trace ions, high water cut, low water cut, and difficult initial guesses;
  • ordinary versus explicit multiphase paths where both are applicable.

C. Hydrates and inhibitors

  • methane and representative natural-gas hydrate dissociation points;
  • salts alone and salts with MEG, methanol, and mixed inhibitors;
  • CO2/H2S-containing systems and reactive brines;
  • gas–oil–water–salt cases when public validation data are available;
  • hydrate temperature at fixed pressure and hydrate pressure at fixed temperature.

D. Mineral scale

  • at minimum CaCO3, BaSO4, SrSO4, CaSO4 and FeCO3 as public data and NeqSim component support permit;
  • saturation index without precipitated solid;
  • equilibrium precipitation/dissolution with non-negative solid amount;
  • mixed brines, acid-gas speciation, pressure/temperature change, and gas/oil/water phase coupling.

E. Alkanolamines and acid-gas removal

  • CO2 and, where supported, H2S in aqueous MEA and MDEA;
  • promoted or mixed amines only when the reaction set and parameter provenance are explicit;
  • acid-gas partial pressure versus loading, speciation, heat of absorption/enthalpy and physical properties where data exist;
  • lean/rich conditions and T/P/concentration ranges relevant to absorber and regenerator calculations;
  • standalone equilibrium plus at least one process-level mass/energy-balance case when absorber support is available.

F. Controls

  • neutral PR/SRK/CPA hydrocarbon systems;
  • neutral hydrocarbon–water systems;
  • non-reactive process calculations;
  • cold start, warm continuation, identical repeat, changed composition/model/mixing rule, clone, and parallel execution.

Scientific acceptance gates

For each applicable case, record equations, conventions, units, reference state, model and mixing rule, reaction set, parameter source, data license, validity range, and uncertainty.

Required checks:

  • total and elemental material balance;
  • aqueous electroneutrality;
  • finite, non-negative and normalized phase fractions/compositions within case-specific tolerances;
  • phase-equilibrium chemical-potential or log-fugacity/activity residual;
  • reaction-equilibrium residual, for example max absolute ln(Q/K), with a frozen tolerance;
  • stable phase topology and lower defensible total Gibbs energy;
  • hydrate water chemical-potential residual and agreement with independent dissociation data;
  • mineral complementarity: absent solids remain undersaturated/non-precipitating and present solids satisfy saturation equilibrium with non-negative amounts;
  • deterministic repeated execution and no stale state after T/P/composition/model/reaction-set changes;
  • physically plausible nearby-state trends and no discontinuity introduced merely by solver history;
  • mass and energy closure for process examples;
  • no unexplained regression outside the fitted range.

Do not silently tune to one dataset. Separate calibration and validation data, report residual definitions and parameter covariance/sensitivity where practical, and retain cross-dataset or hold-out evidence. A parameter improvement must not be accepted solely because it reduces its training objective.

Performance and compatibility gates

  • benchmark the complete calculation as well as any optimized kernel;
  • report iterations, retries/fallbacks, residuals, and failure rate, not wall time alone;
  • preserve public API and serialized compatibility unless a reviewed migration is justified;
  • neutral/non-ionic systems must show no statistically or practically material slowdown; target no more than about 1% median overhead in representative controls unless a larger cost is explicitly justified by new requested behavior;
  • electrolyte calculations must not gain speed by weakening convergence, stability, balance, or diagnostics;
  • preserve Java/Python composability, cloning, deterministic calculation identity, and thread safety.

Literature and data workflow

Each run may search peer-reviewed literature, authoritative public databases, standards, theses, and open benchmark datasets. Prefer primary sources and stable public data.

For every adopted dataset or correlation:

  1. record the full citation/DOI or stable URL and license/access conditions;
  2. preserve original units and reported uncertainty;
  3. store only redistributable data in the repository;
  4. document digitization or preprocessing;
  5. map species, apparent/true composition basis, standard states, and reaction conventions explicitly;
  6. split regression and validation evidence;
  7. compare current master before proposing code or parameters;
  8. explain discrepancies instead of silently fitting them away.

Commercial simulator output may be supporting evidence only when legally shareable and independently described; never infer or copy proprietary algorithms or parameters.

Scheduled-run protocol

Every scheduled run must:

  1. read this issue and its newest comments;
  2. inspect current master, repository instructions, related open/recent PRs and issues, and the previous run ledger;
  3. inspect and repair the sole active campaign PR first, including CI and review feedback, before starting another increment;
  4. search for existing or superseding implementation and avoid duplicate work;
  5. choose the largest coherent dependency-ready increment with a frozen scope, baseline, public reproducer, acceptance criteria, stop boundary, documentation impact, and validation target;
  6. search current relevant literature/data when it can materially improve the selected increment;
  7. reproduce the limitation on unmodified current master before editing;
  8. implement the smallest reusable model/solver/data/API improvement with focused regression coverage;
  9. run the applicable NeqSim formatting, documentation, focused/broader test, scientific-validation and performance gates;
  10. publish or update at most one draft implementation PR; do not merge, enable auto-merge, force-push, weaken checks, or mark ready for review;
  11. add a concise run-ledger comment here with date, exact master/base/head SHAs, active PR, question, data/references, files, tests, numerical evidence, documentation impact, blocker, and next dependency;
  12. stop without a PR when no unique evidence-qualified improvement is ready.

Repository-wide scheduled campaigns may have no more than ten open autonomous implementation PRs in total.

Initial dependency-ordered queue

  1. Complete or repair electrolyte CPA hydrate/reactive-brine PR Fix electrolyte CPA hydrate equilibrium, including reactive brines #3142 and establish its exact supported case matrix.
  2. Freeze a common electrolyte benchmark harness with balance, electroneutrality, phase/reaction residual, phase-topology, repeatability, and timing metrics.
  3. Audit species/reaction construction and stale-state behavior for CO2/H2O/carbonate and water dissociation.
  4. Validate and improve simple/mixed-brine activity and phase-equilibrium parameters against public data.
  5. Extend hydrate validation from simple brines to inhibitors, acid gases, oil, and reactive systems.
  6. Establish mineral saturation/precipitation architecture and public scale benchmarks.
  7. Improve MEA/MDEA CO2/H2S equilibrium, properties and parameter provenance.
  8. Connect the validated equilibrium basis to rigorous reactive-absorber calculations under Implement reactive absorber #205.
  9. Continue ranked, evidence-based parameter/model/solver improvements without losing the frozen controls.

Definition of done

This is a long-running roadmap. Individual increments are complete only after the implementation, focused tests, applicable broader tests, scientific benchmark, documentation-impact assessment, repository publication gates, and exact-head CI/review audit are recorded.

The campaign is complete only when the supported scope and validity ranges are documented; the frozen matrix passes on current master; outstanding limitations are either resolved or explicitly accepted; and a final audit shows no dependency-ready evidence-qualified improvement remains.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions