Skip to content

Fuse relperm and capillary-pressure evaluation behind one problem hook - #7304

Draft
hnil wants to merge 1 commit into
OPM:masterfrom
hnil:pr-fused-relperm-pc
Draft

Fuse relperm and capillary-pressure evaluation behind one problem hook#7304
hnil wants to merge 1 commit into
OPM:masterfrom
hnil:pr-fused-relperm-pc

Conversation

@hnil

@hnil hnil commented Aug 10, 2026

Copy link
Copy Markdown
Member

NFC. The intensive quantities ask the problem for relperms and capillary pressures through one call when the problem provides updateRelpermsAndCapillaryPressures(); the FlowProblem default does exactly the previous two operations (dispatched via asImp_() so derived updateRelperms overrides stay effective). Problems without the method keep the old two-call path.

Verified: identical iteration counts on NORNE_ATW2013_SHORT, both dispatch paths.

Motivation — measured on Norne (44 927 cells, eval3, standalone harness, identical states and checksums):

relperm + pc ns/cell
today, six separate calls 89.9
same math, arguments derived once behind one call 59.8 (−33 %)
table-based representation behind the same call 20.6

With EHYSTR active, as Norne actually runs: 201.6 → 24.6 ns/cell for the table-based path. In flow, Props/update 10.9 → 8.5 s (−23 %), iteration counts unchanged.

This PR is only the override point; the implementations above are separate (OPM/opm-common#5284).

🤖 Generated with Claude Code

@hnil hnil added the manual:enhancement This is an enhancement/improvent that needs to be documented in the manual label Aug 11, 2026
The intensive quantities now ask the problem for relperms and capillary
pressures through a single call, updateRelpermsAndCapillaryPressures(),
when the problem provides it; the default implementation on FlowProblem
performs exactly the previous two operations (updateRelperms +
MaterialLaw::capillaryPressures), dispatched via asImp_() so
derived-problem updateRelperms overrides remain effective. Problems
without the method keep the old two-call path.

No functional change; this creates the single override point needed for
table-based saturation-function representations that produce kr and pc
from one lookup pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:enhancement This is an enhancement/improvent that needs to be documented in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant