Skip to content

Solving thermal equations for MSW#6816

Open
GitPaean wants to merge 21 commits into
OPM:masterfrom
GitPaean:thermal_msw
Open

Solving thermal equations for MSW#6816
GitPaean wants to merge 21 commits into
OPM:masterfrom
GitPaean:thermal_msw

Conversation

@GitPaean

@GitPaean GitPaean commented Feb 11, 2026

Copy link
Copy Markdown
Member

We add the energy equation for multisegment wells. To calculate the enthalpy for each segment, we create a SegmentFluidState for each segment.

It is possible that we can use more properties from SegmentFluidState as the fluid properties, while I will keep that as a refactoring PR, since it will potentially change the simulation results.

This PR should not change any simulation results when thermal is not activated.

@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Feb 11, 2026
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this please

@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this please

@GitPaean GitPaean force-pushed the thermal_msw branch 2 times, most recently from e1b9b6b to f676874 Compare February 12, 2026 14:47
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this please

@GitPaean GitPaean force-pushed the thermal_msw branch 3 times, most recently from 3960982 to 215d308 Compare February 13, 2026 14:05
@GitPaean GitPaean force-pushed the thermal_msw branch 3 times, most recently from febf6e4 to 75b0fa7 Compare February 24, 2026 11:53
@GitPaean GitPaean force-pushed the thermal_msw branch 8 times, most recently from 1f92b64 to 14530ff Compare March 2, 2026 12:38
@GitPaean GitPaean force-pushed the thermal_msw branch 3 times, most recently from 48b127b to cf33559 Compare March 3, 2026 13:08
@GitPaean

GitPaean commented Mar 3, 2026

Copy link
Copy Markdown
Member Author

jenkins build this failure_report please

3 similar comments
@GitPaean

GitPaean commented Mar 3, 2026

Copy link
Copy Markdown
Member Author

jenkins build this failure_report please

@GitPaean

GitPaean commented Mar 3, 2026

Copy link
Copy Markdown
Member Author

jenkins build this failure_report please

@GitPaean

GitPaean commented Mar 3, 2026

Copy link
Copy Markdown
Member Author

jenkins build this failure_report please

GitPaean added 17 commits June 24, 2026 14:01
including adding tempearture as the primary variable for the MSW.

to calculate the enthalpy, for each segment, we generate a
SegmentFluidState.
to test the thermal equation solving for MSW
Multiply the MSW energy accumulation/flow/perforation terms by
energy_scaling_factor_ (the reservoir's BlackOilEnergyScalingFactor) so the
energy residual matches the mass-equation scale, improving well-system
conditioning and convergence; the connectionRates_ source term stays raw
since the reservoir scales the coupling centrally. The energy convergence
check now reuses the standard well tolerances instead of hand-tuned constants.
…ture

Fall back to first-perforation reservoir temperature when WINJTEMP is unset
instead of calling Well::inj_temperature() unconditionally.
Reuse surfaceToReservoirRate for the producing energy connection (now a
template over the fluid-state type, extending reservoir Eval on the fly),
hoist the segment volume and PVT parameter cache out of their phase loops.
and only applying the pressure and temperature derivative to energy
flux.
@GitPaean

Copy link
Copy Markdown
Member Author

After some extensive efforts, it looks like to re-use the segment fluid for other non-thermal cases might bring in small impact in performance. It is not easy to resolve perfectly for now. After discussion, it is suggested that we can get this PR in, so the thermal running for MSW can be used. At the same time, the refactoring to re-use segment fluid state to reduce duplicated property calculation can be a continuing efforts to address in the following up PRs.

@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this failure_report please

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

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Comment thread opm/simulators/wells/MultisegmentWellEval.cpp
Comment thread opm/simulators/wells/MultisegmentWell_impl.hpp
Comment thread opm/simulators/wells/MultisegmentWell.hpp Outdated
- include the energy residual in getResidualMeasureValue
- use the first-perforation salt concentration into createFluidState
- correct the surfaceToReservoirRate doc comment for the d<=0 fallback
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this failure_report please

@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this please

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

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

Comment thread opm/simulators/wells/PerfData.cpp
@@ -173,6 +199,16 @@ namespace Opm {

// the intial amount of fluids in each segment under surface condition
@GitPaean

Copy link
Copy Markdown
Member Author

jenkins build this 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.

5 participants