Fix electrlyte cpa statoil - #2382
Open
EvenSol wants to merge 10 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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); | ||
| } |
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); |
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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Thank you for contributing to NeqSim! Please complete the following checklist before requesting review:
./mvnw testruns successfullySee CONTRIBUTING.md for the full contribution process.