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:
Markus Blatt
2018-02-26 12:23:20 +01:00
parent afb806bc3e
commit 96a636f25b
6 changed files with 20 additions and 39 deletions

View File

@@ -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;
}