mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Let WellModel decide whether to apply well contributions.
It queries the Well whether the jacobian also contains well contributions. If not then it applies them in the operator in addition. Thus the well knows whether that is needed or not.
This commit is contained in:
@@ -294,18 +294,6 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
addWellContributions(Mat& mat) const
|
||||
{
|
||||
for(const auto& well: well_container_)
|
||||
{
|
||||
well->addWellContributions(mat);
|
||||
}
|
||||
}
|
||||
|
||||
// applying the well residual to reservoir residuals
|
||||
// r = r - duneC_^T * invDuneD_ * resWell_
|
||||
template<typename TypeTag>
|
||||
@@ -333,7 +321,8 @@ namespace Opm {
|
||||
apply(const BVector& x, BVector& Ax) const
|
||||
{
|
||||
// TODO: do we still need localWellsActive()?
|
||||
if ( ! localWellsActive() ) {
|
||||
if ( ! localWellsActive() ||
|
||||
well_container_[0]->jacobianContainsWellContributions() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -352,7 +341,8 @@ namespace Opm {
|
||||
BlackoilWellModel<TypeTag>::
|
||||
applyScaleAdd(const Scalar alpha, const BVector& x, BVector& Ax) const
|
||||
{
|
||||
if ( ! localWellsActive() ) {
|
||||
if ( ! localWellsActive() ||
|
||||
well_container_[0]->jacobianContainsWellContributions() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user