mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add well contribution to preconditioner matrix and always use old operator approach for wells.
It turned out that applying the well part of the full matrix has to be done after the application of the non-well interactions. Otherwise we screw up the ordering so much that convergence suffers a lot. Kudos got Atgeirr for inspiration based on his testing.
This commit is contained in:
parent
f07874cf42
commit
12d2114bd7
@ -375,9 +375,9 @@ namespace Opm {
|
||||
}
|
||||
|
||||
auto& ebosJac = ebosSimulator_.model().linearizer().matrix();
|
||||
matrix_for_preconditioner_ = ebosJac;
|
||||
if (param_.matrix_add_well_contributions_) {
|
||||
wellModel().addWellContributions(ebosJac);
|
||||
matrix_for_preconditioner_ .reset(new Mat(ebosJac));
|
||||
wellModel().addWellContributions(*matrix_for_preconditioner_);
|
||||
}
|
||||
|
||||
return wellModel().lastReport();
|
||||
@ -495,7 +495,7 @@ namespace Opm {
|
||||
if( isParallel() )
|
||||
{
|
||||
typedef WellModelMatrixAdapter< Mat, BVector, BVector, BlackoilWellModel<TypeTag>, true > Operator;
|
||||
Operator opA(ebosJac, matrix_for_preconditioner_, wellModel(),
|
||||
Operator opA(ebosJac, actual_mat_for_prec, wellModel(),
|
||||
istlSolver().parallelInformation() );
|
||||
assert( opA.comm() );
|
||||
istlSolver().solve( opA, x, ebosResid, *(opA.comm()) );
|
||||
@ -503,7 +503,7 @@ namespace Opm {
|
||||
else
|
||||
{
|
||||
typedef WellModelMatrixAdapter< Mat, BVector, BVector, BlackoilWellModel<TypeTag>, false > Operator;
|
||||
Operator opA(ebosJac, matrix_for_preconditioner_, wellModel(),
|
||||
Operator opA(ebosJac, actual_mat_for_prec, wellModel());
|
||||
istlSolver().solve( opA, x, ebosResid );
|
||||
}
|
||||
}
|
||||
@ -1062,7 +1062,7 @@ namespace Opm {
|
||||
double current_relaxation_;
|
||||
BVector dx_old_;
|
||||
|
||||
Mat matrix_for_preconditioner_;
|
||||
std::unique_ptr<Mat> matrix_for_preconditioner_;
|
||||
|
||||
public:
|
||||
/// return the StandardWells object
|
||||
|
@ -326,10 +326,7 @@ namespace Opm {
|
||||
}
|
||||
|
||||
for (auto& well : well_container_) {
|
||||
if ( ! well->jacobianContainsWellContributions() )
|
||||
{
|
||||
well->apply(x, Ax);
|
||||
}
|
||||
well->apply(x, Ax);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user