Repository navigation
Add weighted JutulDarcy adjoints for PET - #18
Merged
KriFos1 merged 1 commit intoNov 27, 2026
Merged
Conversation
This was referenced Nov 26, 2026
This was referenced Nov 26, 2026
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.
Public API
Adds
subsurface.multphaseflow.jutul_darcy.JutulDarcy.run_vjp(state, weights)for PET LowRankGN. Each column of the labelled weights defines one objective. The wrapper simulates the centre once per call, reuses its saved states and adjoint storage across columns, and returns one gradient row per objective and state variable.run_fwd_simand the standaloneadjointsinterface retain their signatures and output formats.Scope
Supports metric producer oil, water and gas surface rates at exact report steps, and direct porosity or permeability fields (mD or natural log of mD). Uses the existing copied-axis and well-index chain rules. The README covers the Mako deck requirements and the distinction between weighted PET requests and standalone per-observation adjoints.
Verification
tests/test_jutul_vjp.pypassed locally on the bundled TINY model. Two weighted objectives combining oil and water rates at different wells and report dates matched central directional differences at a perforated cell in log-permeability coordinates.