Allow to add well contributions to both matrix and preconditioner matrix.

matrix_add_well_contributions=true will add to both the preconditioner matrix
and the matrix of the linear operator. preconditioner_add_well_contributions=true
will only add the contributions to the preconditioner matrix.
This commit is contained in:
Markus Blatt 2018-03-05 16:40:17 +01:00
parent dc86d972d2
commit 01b25f27ed
4 changed files with 15 additions and 1 deletions

View File

@ -376,6 +376,10 @@ namespace Opm {
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_);
}

View File

@ -66,6 +66,7 @@ namespace Opm
use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_);
deck_file_name_ = param.template get<std::string>("deck_filename");
matrix_add_well_contributions_ = param.getDefault("matrix_add_well_contributions", matrix_add_well_contributions_);
preconditioner_add_well_contributions_ = param.getDefault("preconditioner_add_well_contributions", preconditioner_add_well_contributions_);
}
@ -95,6 +96,7 @@ namespace Opm
use_update_stabilization_ = true;
use_multisegment_well_ = false;
matrix_add_well_contributions_ = false;
preconditioner_add_well_contributions_ = false;
}

View File

@ -91,9 +91,12 @@ namespace Opm
/// The file name of the deck
std::string deck_file_name_;
// Whether to add influences of wells between cells to the matrix
// Whether to add influences of wells between cells to the matrix and preconditioner matrix
bool matrix_add_well_contributions_;
// Whether to add influences of wells between cells to the preconditioner matrix only
bool preconditioner_add_well_contributions_;
/// Construct from user parameters or defaults.
explicit BlackoilModelParameters( const ParameterGroup& param );

View File

@ -1599,6 +1599,11 @@ namespace Opm
StandardWell<TypeTag>::
apply(const BVector& x, BVector& Ax) const
{
if ( param_.matrix_add_well_contributions_ )
{
// Contributions are already in the matrix itself
return;
}
assert( Bx_.size() == duneB_.N() );
assert( invDrw_.size() == invDuneD_.N() );