Skip to content

Apply the SSHIFT volume shift to the density and the viscosity - #5322

Draft
GitPaean wants to merge 3 commits into
OPM:masterfrom
GitPaean:sshift_standalone
Draft

Apply the SSHIFT volume shift to the density and the viscosity#5322
GitPaean wants to merge 3 commits into
OPM:masterfrom
GitPaean:sshift_standalone

Conversation

@GitPaean

Copy link
Copy Markdown
Member

SSHIFT was parsed and stored but never reached the equation of state. Against a reference run of the same deck, the gas density was 3.7 percent high and the liquid 10 percent low.

The shift now sits on the component parameters, and the density subtracts it from the molar volume.

The parameter cache keeps the unshifted volume, because the fugacity coefficients are computed from it. A volume shift cancels out of the equilibrium ratios, so it must leave the phase split untouched. Subtracting it there would change the coefficients and move the split.

@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Aug 26, 2026
@GitPaean
GitPaean requested a balanced review from Copilot August 26, 2026 13:50

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

Applies parsed SSHIFT values to compositional phase-density calculations without altering fugacity coefficients.

Changes:

  • Stores component volume shifts in the fluid system.
  • Subtracts mixture volume shift when calculating density.
  • Adds volume-shift regression tests.

Reviewed changes

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

File Description
CMakeLists_files.cmake Registers the new test.
GenericOilGasWaterFluidSystem.hpp Propagates and applies SSHIFT.
PTFlashParameterCache.hpp Calculates phase volume shift.
test_volume_shift.cpp Tests density and fugacity behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp
Comment thread tests/material/test_volume_shift.cpp Outdated
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this failure_report please

@GitPaean

GitPaean commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7391 failure_report please

@GitPaean GitPaean changed the title Apply the SSHIFT volume shift to the density Apply the SSHIFT volume shift to the density and the viscosity Sep 8, 2026
Pass the parsed component SSHIFT coefficients to the fluid system and
cache each phase's volume translation, sum_c x_c s_c b_c. Use the
corrected molar volume for density and the molar-density input to the
LBC correlation. Reject corrected volumes that are non-positive or NaN.

Keep the cached EOS molar volume unshifted for fugacity calculations.
At equal phase pressure and temperature, the translation factors cancel
from the equilibrium ratios, preserving the phase split.

Add tests for density, viscosity, equilibrium ratios, AD derivatives,
parsed SSHIFT values and invalid volumes. Saturation updates are handled
in opm-simulators PR #7391.
Clear the static component list in init() so a later initialization can
register a different configuration. Without this reset, addComponent()
rejects new registrations once the list is full, leaving the previous
component properties and SSHIFT coefficients active.
Default to zero translation for fluid systems without volumeShift().
This restores compilation of the CO2/brine flash, cubic-EOS finite-guard
and SSI/Newton fallback tests.

Let checkFluidSystem() accept an initializer and run it before creating
the state and cache. Register the generic fluid system's components for
each scalar/AD check, preserving the reset in init().

Validation: six focused opm-common tests and both compositional well
tests pass. SIMPLE_COMP_SSHIFT completes with flow_comp3_2p.
@GitPaean

GitPaean commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

jenkins build this opm-simulators=7391 failure_report please

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

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants