Skip to content

Fix electrlyte cpa statoil - #2382

Open
EvenSol wants to merge 10 commits into
masterfrom
fix-electrlyte-cpa-statoil
Open

Fix electrlyte cpa statoil#2382
EvenSol wants to merge 10 commits into
masterfrom
fix-electrlyte-cpa-statoil

Conversation

@EvenSol

@EvenSol EvenSol commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Thank you for contributing to NeqSim! Please complete the following checklist before requesting review:

  • Confirm ./mvnw test runs successfully
  • Verify code formatting using Checkstyle
  • Update any relevant docs/README
  • Link to an associated issue or discussion

See CONTRIBUTING.md for the full contribution process.

Copilot AI review requested due to automatic review settings July 22, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Electrolyte CPA Statoil reactive amine (MDEA/CO₂/H₂O) behavior by refitting database parameters and aligning the chemical-equilibrium activity handling with the intended EOS activity standard state, with new regression tests to validate CO₂ partial pressure and phase/speciation outcomes.

Changes:

  • Add new JUnit tests for reactive CO₂–water–MDEA TPflash (with methane present) and bubble-point pressure flash, including screening vs Kent–Eisenberg reference correlations.
  • Refit/update reaction and interaction-parameter database entries used by the Electrolyte CPA Statoil amine system.
  • Adjust reaction loading and chemical-equilibrium activity-term handling to support the updated electrolyte CPA behavior (including a model-specific reaction skip for Desmukh–Mather).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/java/neqsim/thermo/system/SystemElectrolyteCPATest.java Adds reactive MDEA/CO₂ tests + replaces System.out.println with logger output.
src/main/resources/data/REACTIONDATA.csv Updates/refits the MDEACO2CH4 reaction entry and enables it for loading.
src/main/resources/data/INTER.csv Updates CPA interaction parameters for the CO₂–MDEA pair used by the EOS/activity behavior.
src/main/java/neqsim/chemicalreactions/chemicalreaction/ChemicalReactionList.java Trims reaction names, filters zero stoichiometric coefficients, and conditionally skips MDEACO2CH4 for Desmukh–Mather.
src/main/java/neqsim/chemicalreactions/chemicalequilibrium/ChemicalEquilibrium.java Adjusts activity-term evaluation for aqueous amine electrolyte CPA phases to use the EOS mole-fraction activity basis.

Comment on lines +129 to +131
private boolean shouldSkipReaction(SystemInterface system, String reactionName) {
return "Desmukh-Mather-model".equals(system.getModelName()) && "MDEACO2CH4".equals(reactionName);
}
Copilot AI review requested due to automatic review settings July 22, 2026 08:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment on lines 37 to 40
system.chemicalReactionInit();
assertNull(system.getChemicalReactionOperations().getReactionList().getReaction("MDEACO2CH4"),
"Desmukh-Mather must not load the Electrolyte CPA-specific MDEACO2CH4 reaction");
system.createDatabase(true);
Copilot AI review requested due to automatic review settings July 22, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment on lines +435 to +438
ThermodynamicOperations ops = new ThermodynamicOperations(system);
assertDoesNotThrow(() -> ops.TPflash());
system.init(3);

Comment on lines +479 to +482
ThermodynamicOperations ops = new ThermodynamicOperations(system);
assertDoesNotThrow(() -> ops.bubblePointPressureFlash(false));
system.init(3);

Comment on lines +460 to +461
assertTrue(aqueousPhase.getDensity() > 900.0 && aqueousPhase.getDensity() < MDEA_TPFLASH_DENSITY_MAX_KG_PER_M3,
"Aqueous MDEA density should be physically plausible, density=" + aqueousPhase.getDensity());
Comment on lines +499 to +500
assertTrue(aqueousPhase.getDensity() > 900.0 && aqueousPhase.getDensity() < 1300.0,
"Bubble-point aqueous MDEA density should be physically plausible");
Copilot AI review requested due to automatic review settings July 22, 2026 09:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

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.

2 participants