mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
dc86d972d2
commit
01b25f27ed
@ -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_);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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() );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user