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:
@@ -376,6 +376,10 @@ namespace Opm {
|
|||||||
|
|
||||||
auto& ebosJac = ebosSimulator_.model().linearizer().matrix();
|
auto& ebosJac = ebosSimulator_.model().linearizer().matrix();
|
||||||
if (param_.matrix_add_well_contributions_) {
|
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));
|
matrix_for_preconditioner_ .reset(new Mat(ebosJac));
|
||||||
wellModel().addWellContributions(*matrix_for_preconditioner_);
|
wellModel().addWellContributions(*matrix_for_preconditioner_);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ namespace Opm
|
|||||||
use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_);
|
use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_);
|
||||||
deck_file_name_ = param.template get<std::string>("deck_filename");
|
deck_file_name_ = param.template get<std::string>("deck_filename");
|
||||||
matrix_add_well_contributions_ = param.getDefault("matrix_add_well_contributions", matrix_add_well_contributions_);
|
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_update_stabilization_ = true;
|
||||||
use_multisegment_well_ = false;
|
use_multisegment_well_ = false;
|
||||||
matrix_add_well_contributions_ = false;
|
matrix_add_well_contributions_ = false;
|
||||||
|
preconditioner_add_well_contributions_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -91,9 +91,12 @@ namespace Opm
|
|||||||
/// The file name of the deck
|
/// The file name of the deck
|
||||||
std::string deck_file_name_;
|
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_;
|
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.
|
/// Construct from user parameters or defaults.
|
||||||
explicit BlackoilModelParameters( const ParameterGroup& param );
|
explicit BlackoilModelParameters( const ParameterGroup& param );
|
||||||
|
|
||||||
|
|||||||
@@ -1599,6 +1599,11 @@ namespace Opm
|
|||||||
StandardWell<TypeTag>::
|
StandardWell<TypeTag>::
|
||||||
apply(const BVector& x, BVector& Ax) const
|
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( Bx_.size() == duneB_.N() );
|
||||||
assert( invDrw_.size() == invDuneD_.N() );
|
assert( invDrw_.size() == invDuneD_.N() );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user