Limit temperature Newton update for multisegment wells#6876
Closed
Copilot wants to merge 2 commits into
Closed
Conversation
…wells Add enable_energy flag and Temperature index to MultisegmentWellPrimaryVariables. Limit temperature Newton update using max_temperature_change (default 5K), matching the reservoir model approach. Add temperature to SegmentState. Add necessary template instantiations for energy-enabled configurations. Co-authored-by: GitPaean <6847941+GitPaean@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix large temperature Newton update value
Limit temperature Newton update for multisegment wells
Feb 24, 2026
Member
|
It does not look successful experiment and it should not happen in the main repository. Sorry for the noise. |
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.
PR #6816 adds thermal equation solving for MSW but applies the raw Newton update to temperature without any limiting, causing divergence. Pressure already uses sign-preserving clamping to
max_pressure_change; temperature needs the same treatment.Temperature limiting in
updateNewtonBefore (PR #6816):
After:
Changes
MultisegmentWellPrimaryVariables.hpp/cpp— Addenable_energy,Temperatureindex, updatenumWellEq = numPhases + 1 + enable_energy. Temperature handled inupdate(),updateNewton(),copyToWellState(), newgetSegmentTemperature()accessor.BlackoilModelParameters.hpp/cpp— NewMaxTemperatureChangeMsWellsparameter (default 5 K, matching the reservoir model'sMaxTemperatureChange).MultisegmentWellAssemble.hpp— DerivenumWellEqfromPrimaryVariablesinstead of duplicating the formula.MultisegmentWell_impl.hpp— Passmax_temperature_changethrough toupdateNewton.SegmentState.hpp/cpp— Addtemperaturevector (constructor, serialization, equality).MSWellHelpers.cpp,MultisegmentWellEquations.cpp,WellHelpers.cpp,WellAssemble.cpp) — Add dimensions fornumWellEq=5when energy is enabled.When
enable_energy = false(all non-thermal configurations),numWellEqand all template dimensions are unchanged — zero behavioral difference.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.