Expose hardcoded well/Newton tuning constants; remove the dead tolerance-well-control knob - #7300
Open
hnil wants to merge 4 commits into
Open
Expose hardcoded well/Newton tuning constants; remove the dead tolerance-well-control knob#7300hnil wants to merge 4 commits into
hnil wants to merge 4 commits into
Conversation
hnil
marked this pull request as ready for review
August 10, 2026 09:03
Member
|
jenkins build this failure_report please |
Contributor
There was a problem hiding this comment.
Pull request overview
Exposes well-convergence and Newton-tuning constants as runtime parameters while removing an unused well-control tolerance option.
Changes:
- Adds configurable standard/MSW well tolerances and switch intervals.
- Exposes Newton damping schedule parameters.
- Clarifies CNV behavior and the
-1sentinel documentation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
opm/simulators/wells/StandardWellEval.hpp |
Extends convergence API with control tolerances. |
opm/simulators/wells/StandardWellEval.cpp |
Applies configurable control tolerances. |
opm/simulators/wells/StandardWell_impl.hpp |
Uses configurable factors and switch intervals. |
opm/simulators/wells/MultisegmentWell_impl.hpp |
Configures MSW switch intervals. |
opm/simulators/flow/NonlinearSystemBlackOilReservoir_impl.hpp |
Clarifies CNV override behavior. |
opm/simulators/flow/NonlinearSolver.hpp |
Defines Newton tuning parameters. |
opm/simulators/flow/NonlinearSolver.cpp |
Registers and loads Newton parameters. |
opm/simulators/flow/BlackoilModelParameters.hpp |
Defines new well parameters and removes the dead option. |
opm/simulators/flow/BlackoilModelParameters.cpp |
Registers and loads well parameters. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hnil
force-pushed
the
expose-well-newton-constants
branch
from
August 11, 2026 08:26
5019e8a to
a26f539
Compare
Member
Author
|
The build break was real: |
Member
|
jenkins build this failure_report please |
The tolerances for the standard-well control equation residual were
hardcoded as a brace-initialised literal at the call site,
{1e3, 1e4, 1e-4, 1e-6}, i.e. BHP 0.01 bar, THP 0.1 bar, rates 1e-4 m3/s
and group 1e-6 m3/s. Multisegment wells have had the equivalent values as
parameters all along (and use a 10x stricter pressure tolerance), so the
two well types could not be configured or studied consistently.
Add --tolerance-well-{bhp,thp,grup}-eq with defaults equal to the previous
literals, and reuse the existing --tolerance-wells for the rate entry
(its default already matched the literal). Purely a plumbing change: runs
are numerically identical at default settings.
Five values that steer the nonlinear and well solves were written at the call
site and could not be studied without a rebuild:
--min-iter-after-switch-wells (4) / --min-iter-after-switch-ms-wells (3)
Iterations forced between two control switches in the inner well solve.
The existing comment notes that values <= 1 make the solve cycle, i.e.
a tuning constant with a known failure mode. Standard and multi-segment
wells used different values with no stated reason.
--newton-relax-increment (0.1) / --newton-relax-rel-tol (0.2)
The Newton oscillation-damping schedule. Set in reset() only, so
--newton-max-relax could be tuned but the schedule reaching it could not.
--tolerance-wells-stopped-factor (1e-4) / --tolerance-wells-dynamic-thp-factor (1e-1)
Multipliers on the well tolerance for stopped/zero-rate wells and for
wells on a dynamic THP limit.
Defaults reproduce the previous values; INFOSTEP is unchanged on
SPE1CASE2_RADIAL, STONE2_MOD1, 3B_WSEGVALV_MODEL3, 2_GCONINJE_NETV and
GASLIFT-06.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tinel
--tolerance-well-control ("Tolerance for the well control equations") is
registered and read into tolerance_well_control_, but that member is never
used anywhere. It is precisely the knob a user reaches for to tighten the
well control equations, and it silently does nothing; the real values live in
--tolerance-well-{bhp,thp,grup}-eq.
Also:
- --min-strict-cnv-iter now documents that the default -1 is a mode switch
(relax only at the iteration cap), matching the text --min-strict-mb-iter
already carries for the same sentinel. Read plainly, "minimum number of
iterations before relaxed tolerances can be used ... -1" suggests the
opposite of what it does.
- Correct the comment on the solution-change branch of the CNV test: 1e20
disables CNV rather than relaxing it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The knob is dead as a tolerance, but flowexp still registered a Hide for it, so dropping the parameter broke that build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hnil
force-pushed
the
expose-well-newton-constants
branch
from
August 11, 2026 12:05
a26f539 to
7209421
Compare
Member
|
jenkins build this failure_report please |
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.
Makes parameters of values that could previously only be studied by rebuilding: the standard-well control-equation tolerances (defaults = the hardcoded values; note StandardWell THP was 10x looser than MSW with no stated reason), the forced iterations between control switches in the inner well solve, the Newton damping schedule, and the stopped/dynamic-THP well tolerance factors.
Also removes --tolerance-well-control, which was registered and read but never used anywhere, and documents the -1 sentinel on --min-strict-cnv-iter the way the MB twin already does. Byte-identical at defaults on the decks tested.
🤖 Generated with Claude Code