WIP: Add NeqSim compatibility suite#1560
Draft
olelod wants to merge 2 commits into
Draft
Conversation
e04c4eb to
98559f1
Compare
6b8d94a to
4a6df40
Compare
Adds an on-demand compatibility suite under tests/ecalc_neqsim_wrapper/compatibility/ that verifies the vendored NeqSim jar and wrapper across representative ecalc operating conditions. The suite includes a strict reference snapshot for numerical drift, sanity checks for finite and physically plausible properties, and behaviour checks for TP flash, PH flash, gas-phase extraction, mixing, EoS routing, and validator integration. A GitHub Actions workflow runs the suite when the jar, wrapper, suite, or workflow changes, and the README documents the rationale, operating envelope, commands, and failure triage. Snapshot tolerances allow Linux runner drift observed for c3_rich_wellstream_dry at 50 bara and 330 K: vapor_fraction_molar drift 1.293e-08 (abs tolerance relaxed from 1.0e-08 to 2.0e-08) and density relative drift 1.054e-08 (relative tolerance relaxed from 1.0e-08 to 2.0e-08).
…2_heavy - Add n2_heavy to COMPOSITION_NAMES (was in compositions.py but excluded) - Split snapshot into TP and PH tables: tp|... and ph|... keys - PH-flash: isenthalpic compression at 1.5× inlet pressure - Add PH_SNAPSHOT_PROPERTIES (density, enthalpy, temperature_kelvin, z_factor, viscosity, specific_heat, thermal_conductivity) - Update _regenerate.py to produce both tp|... and ph|... entries - Update test_reference_snapshot.py with separate parametrized tests for TP and PH flash, and test_snapshot_has_no_extra_states checks both - Regenerate reference_snapshot.json (2209 states) - state_key() backward-compat alias preserved for tp|... keys Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
75e95e7 to
63b8667
Compare
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.
Summary
Adds an on-demand NeqSim compatibility suite for the vendored jar and wrapper. The goal is to make NeqSim jar bumps explicit and reviewable: a bump should either pass unchanged, produce an accepted snapshot diff, or be rejected because it changes behaviour ecalc depends on.
The suite is deselected from normal test runs with the
neqsim_compatmarker and has its own workflow. The ordinary library test shards explicitly exclude it, so the expensive compatibility checks do not run as part of the default test matrix.What is covered
The suite is split into three layers:
regression/sanity/behaviour/The operating envelope is centralised in
tests/ecalc_neqsim_wrapper/compatibility/envelope.pyand covers representative pressure/temperature regimes, four EoS models (SRK,PR,GERG_SRK,GERG_PR), and natural-gas/wellstream compositions that exercise light gas, rich gas, CO2-heavy gas, N2-heavy gas, wet gas, and two-phase cases.Workflow behaviour
Adds
.github/workflows/test-neqsim-compatibility.yml:neqsim_version_info.mdis updated when the vendored jar changes;Notes for future jar bumps
If a jar bump changes snapshotted values,
regression/test_reference_snapshot.pyfails with the exact(composition, P, T, EoS)state and property diffs. Accepted drift should be handled by regeneratingreference_snapshot.jsonand reviewing that diff together with the jar bump.