Linear solver for the full (reservoir, well) system#7111
Conversation
b1fc160 to
9b2c3ed
Compare
5db1cde to
557bc7d
Compare
557bc7d to
7f16316
Compare
|
jenkins build this please |
atgeirr
left a comment
There was a problem hiding this comment.
Just started reviewing this, but noticed some surface-level stuff that can be fixed easily while I look at the more important parts.
7f16316 to
0c438ae
Compare
atgeirr
left a comment
There was a problem hiding this comment.
I have now looked at all the new code in the system/ subdirectory. Overall there is a lot of good work, I look forward to merging it!
I have identified some issues that can be worked on while I look at the rest of the code.
atgeirr
left a comment
There was a problem hiding this comment.
Done with the rest of the code, only minor things except possibly for the addition of direct_solver_needs_update_ as noted below, I do not fully understand yet if it makes a difference.
bska
left a comment
There was a problem hiding this comment.
Many (all?) of the new headers use #pragma once instead of traditional include guards. Is there a reason for this? Did we decide that #pragma once is accepted now? If not, I would really prefer that we use traditional include guards instead.
|
jenkins build this serial please |
2 similar comments
|
jenkins build this serial please |
|
jenkins build this serial please |
|
All looks good now, I will check out and run some extra tests before merging. |
|
jenkins build this serial please |
2 similar comments
|
jenkins build this serial please |
|
jenkins build this serial please |
bska
left a comment
There was a problem hiding this comment.
Before we even consider merging this, we need to fix the new warnings introduced here, not to mention the unit test failures. I would also really prefer if we made sure that all files end in a newline character. I believe all code editors have a setting to enforce this.
Other than that, I see a number of minor niggles but those should be addressed at the code base level–e.g., using C++20's s.ends_with(".json") instead of
s.substr(s.size() - 5) == ".json"and consistently using std::size_t instead of "bare" size_t.
|
jenkins build this serial please |
Introduce a prototype for solving the reservoir and well degrees of freedom as a single coupled linear system. This complements the existing approach of handling wells separately through Schur complement elimination. Key design choices: - The linear solve operates on the full coupled system (reservoir + well DOFs) to simplify the solver architecture and reduce special-case well handling - The underlying solver uses standard sparse matrices with no well-aware operators, improving modularity and reducing code complexity - The included preconditioner is configurable to reproduce standard CPR behavior, providing a baseline for validation before further performance tuning - An approximate well-block solve is supported for potential performance gains Important changes: - Add linear solver implementation with coupled system support - Configure preconditioner to match existing CPR behavior for correctness - Remove need for separate well-block elimination in the linear solve path - Update solver selection to allow --linear-solver=system_cpr option This implementation serves as a prototype to validate the coupled system approach before further optimization and benchmarking.
3f61324 to
e48ea4a
Compare
|
jenkins build this serial please |
|
Great work everyone, good to see this go in! |
We will close #6751 and make a new PR from @jakobtorben and @hnil
Draft PR: Coupled Reservoir–Well Linear Solver (system_cpr)
This PR introduces a prototype for solving the reservoir and well degrees of freedom as a single coupled linear system, rather than handling wells separately through Schur complement elimination.
The preconditioner is functionally equivalent to the existing cpr (not cprw) and serves as a baseline to validate correctness before further tuning.
Features