mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Do the schur complement after calling the getConvergence method
This commit is contained in:
parent
5edd63c554
commit
7ccce99e1c
@ -358,6 +358,16 @@ namespace Opm {
|
||||
ebosSimulator_.model().linearizer().linearize();
|
||||
ebosSimulator_.problem().endIteration();
|
||||
|
||||
auto& ebosJac = ebosSimulator_.model().linearizer().matrix();
|
||||
if (param_.matrix_add_well_contributions_) {
|
||||
wellModel().addWellContributions(ebosJac);
|
||||
}
|
||||
if ( param_.preconditioner_add_well_contributions_ &&
|
||||
! param_.matrix_add_well_contributions_ ) {
|
||||
matrix_for_preconditioner_ .reset(new Mat(ebosJac));
|
||||
wellModel().addWellContributions(*matrix_for_preconditioner_);
|
||||
}
|
||||
|
||||
return wellModel().lastReport();
|
||||
}
|
||||
|
||||
@ -487,6 +497,8 @@ namespace Opm {
|
||||
auto& ebosJac = ebosSimulator_.model().linearizer().matrix();
|
||||
auto& ebosResid = ebosSimulator_.model().linearizer().residual();
|
||||
|
||||
wellModel().apply(ebosResid);
|
||||
|
||||
// set initial guess
|
||||
x = 0.0;
|
||||
|
||||
|
@ -202,6 +202,9 @@ namespace Opm {
|
||||
Opm::data::Wells wellData() const
|
||||
{ return well_state_.report(phase_usage_, Opm::UgGridHelpers::globalCell(grid())); }
|
||||
|
||||
// substract Binv(D)rw from r;
|
||||
void apply( BVector& r) const;
|
||||
|
||||
// subtract B*inv(D)*C * x from A*x
|
||||
void apply(const BVector& x, BVector& Ax) const;
|
||||
|
||||
@ -225,6 +228,13 @@ namespace Opm {
|
||||
|
||||
const SimulatorReport& lastReport() const;
|
||||
|
||||
void addWellContributions(Mat& mat)
|
||||
{
|
||||
for ( const auto& well: well_container_ ) {
|
||||
well->addWellContributions(mat);
|
||||
}
|
||||
}
|
||||
|
||||
// called at the beginning of a report step
|
||||
void beginReportStep(const int time_step);
|
||||
|
||||
|
@ -99,6 +99,9 @@ namespace Opm {
|
||||
if (!localWellsActive())
|
||||
return;
|
||||
|
||||
// we don't what to add the schur complement
|
||||
// here since it affects the getConvergence method
|
||||
/*
|
||||
for (const auto& well: well_container_) {
|
||||
if (param_.matrix_add_well_contributions_)
|
||||
well->addWellContributions(mat);
|
||||
@ -107,6 +110,7 @@ namespace Opm {
|
||||
// r = r - duneC_^T * invDuneD_ * resWell_
|
||||
well->apply(res);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@ -549,6 +553,19 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
apply( BVector& r) const
|
||||
{
|
||||
if ( ! localWellsActive() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto& well : well_container_) {
|
||||
well->apply(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Ax = A x - C D^-1 B x
|
||||
|
Loading…
Reference in New Issue
Block a user