added: StandardWellEquations::clear

this zeros the equation system.
use the new method in the well implementation.
This commit is contained in:
Arne Morten Kvarving 2022-11-11 21:41:24 +01:00
parent a8c912ccfa
commit d05081417e
3 changed files with 14 additions and 4 deletions

View File

@ -35,6 +35,16 @@ StandardWellEquations(const ParallelWellInfo& parallel_well_info)
invDuneD_.setBuildMode(DiagMatWell::row_wise);
}
template<class Scalar, int numEq>
void StandardWellEquations<Scalar,numEq>::clear()
{
duneB_ = 0.0;
duneC_ = 0.0;
duneD_ = 0.0;
resWell_ = 0.0;
}
#define INSTANCE(N) \
template class StandardWellEquations<double,N>;

View File

@ -60,6 +60,9 @@ public:
StandardWellEquations(const ParallelWellInfo& parallel_well_info);
//! \brief Set all coefficients to 0.
void clear();
// two off-diagonal matrices
OffDiagMatWell duneB_;
OffDiagMatWell duneC_;

View File

@ -432,10 +432,7 @@ namespace Opm
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
// clear all entries
this->linSys_.duneB_ = 0.0;
this->linSys_.duneC_ = 0.0;
this->linSys_.duneD_ = 0.0;
this->linSys_.resWell_ = 0.0;
this->linSys_.clear();
assembleWellEqWithoutIterationImpl(ebosSimulator, dt, well_state, group_state, deferred_logger);
}