mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-30 11:06:55 -06:00
well model: fix application of Schur complements
using the eWoms API for wells, the Schur compliment was not applied at all. If `BlackOilWellModel::linearize()` was made non-trivial, the Schur complement was applied twice in `flow`. With this patch, we only apply this using the eWoms API (in `BlackOilWellModel::linearize()`). I could not observe a signficant effect on the convergence behaviour of `flow` for the cases which I tested (Norne and realization 5 of Model 2).
This commit is contained in:
parent
935642ba88
commit
f5e7ca9bb3
@ -463,19 +463,6 @@ namespace Opm {
|
||||
|
||||
auto& ebosJac = ebosSimulator_.model().linearizer().jacobian();
|
||||
auto& ebosResid = ebosSimulator_.model().linearizer().residual();
|
||||
// J = [A, B; C, D], where A is the reservoir equations, B and C the interaction of well
|
||||
// with the reservoir and D is the wells itself.
|
||||
// The full system is reduced to a number of cells X number of cells system via Schur complement
|
||||
// A -= B^T D^-1 C
|
||||
// If matrix_add_well_contribution is false, the Ax operator is modified. i.e Ax -= B^T D^-1 C x in the WellModelMatrixAdapter
|
||||
// instead of A.
|
||||
// The residual is modified similarly.
|
||||
// r = [r, r_well], where r is the residual and r_well the well residual.
|
||||
// r -= B^T * D^-1 r_well
|
||||
wellModel().apply(ebosResid);
|
||||
if (param_.matrix_add_well_contributions_) {
|
||||
wellModel().addWellContributions(ebosJac.istlMatrix());
|
||||
}
|
||||
|
||||
// set initial guess
|
||||
x = 0.0;
|
||||
|
@ -101,18 +101,23 @@ namespace Opm {
|
||||
if (!localWellsActive())
|
||||
return;
|
||||
|
||||
// we don't what to add the schur complement
|
||||
// here since it affects the getConvergence method
|
||||
/*
|
||||
if (!param_.matrix_add_well_contributions_) {
|
||||
// if the well contributions are not supposed to be included explicitly in
|
||||
// the matrix, we only apply the vector part of the Schur complement here.
|
||||
for (const auto& well: well_container_) {
|
||||
// r = r - duneC_^T * invDuneD_ * resWell_
|
||||
well->apply(res);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& well: well_container_) {
|
||||
if (param_.matrix_add_well_contributions_)
|
||||
well->addWellContributions(mat);
|
||||
well->addWellContributions(mat.istlMatrix());
|
||||
|
||||
// applying the well residual to reservoir residuals
|
||||
// r = r - duneC_^T * invDuneD_ * resWell_
|
||||
well->apply(res);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user