added: StandardWellEquations::residual()

this returns a const reference to the residual vector.
use this in StandardWellEval::getWellConvergence
This commit is contained in:
Arne Morten Kvarving 2022-11-18 12:59:16 +01:00
parent 5bab68cb1f
commit 5eac7cae4e
2 changed files with 8 additions and 2 deletions

View File

@ -117,6 +117,12 @@ public:
//! \brief Sum with off-process contribution.
void sumDistributed(Parallel::Communication comm);
//! \brief Returns a const reference to the residual.
const BVectorWell& residual() const
{
return resWell_;
}
// two off-diagonal matrices
OffDiagMatWell duneB_;
OffDiagMatWell duneC_;

View File

@ -679,7 +679,7 @@ getWellConvergence(const WellState& well_state,
res.resize(numWellEq_);
for (int eq_idx = 0; eq_idx < numWellEq_; ++eq_idx) {
// magnitude of the residual matters
res[eq_idx] = std::abs(this->linSys_.resWell_[0][eq_idx]);
res[eq_idx] = std::abs(this->linSys_.residual()[0][eq_idx]);
}
std::vector<double> well_flux_residual(baseif_.numComponents());
@ -716,7 +716,7 @@ getWellConvergence(const WellState& well_state,
WellConvergence(baseif_).
checkConvergenceControlEq(well_state,
{1.e3, 1.e4, 1.e-4, 1.e-6, maxResidualAllowed},
std::abs(this->linSys_.resWell_[0][Bhp]),
std::abs(this->linSys_.residual()[0][Bhp]),
report,
deferred_logger);