added: MultisegmentWellEquations::solve()

this applies the inverted D matrix to the residual vector.
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 a7cb444328
commit bc312d1117
3 changed files with 12 additions and 4 deletions

View File

@ -161,6 +161,13 @@ void MultisegmentWellEquations<Scalar,numWellEq,numEq>::createSolver()
#endif #endif
} }
template<class Scalar, int numWellEq, int numEq>
typename MultisegmentWellEquations<Scalar,numWellEq,numEq>::BVectorWell
MultisegmentWellEquations<Scalar,numWellEq,numEq>::solve() const
{
return mswellhelpers::applyUMFPack(*duneDSolver_, resWell_);
}
#define INSTANCE(numWellEq, numEq) \ #define INSTANCE(numWellEq, numEq) \
template class MultisegmentWellEquations<double,numWellEq,numEq>; template class MultisegmentWellEquations<double,numWellEq,numEq>;

View File

@ -83,6 +83,9 @@ public:
//! \brief Compute the LU-decomposition of D matrix. //! \brief Compute the LU-decomposition of D matrix.
void createSolver(); void createSolver();
//! \brief Apply inverted D matrix to residual and return result.
BVectorWell solve() const;
// two off-diagonal matrices // two off-diagonal matrices
OffDiagMatWell duneB_; OffDiagMatWell duneB_;
OffDiagMatWell duneC_; OffDiagMatWell duneC_;

View File

@ -519,8 +519,7 @@ namespace Opm
// We assemble the well equations, then we check the convergence, // We assemble the well equations, then we check the convergence,
// which is why we do not put the assembleWellEq here. // which is why we do not put the assembleWellEq here.
const BVectorWell dx_well = mswellhelpers::applyUMFPack(*this->linSys_.duneDSolver_, const BVectorWell dx_well = this->linSys_.solve();
this->linSys_.resWell_);
updateWellState(dx_well, well_state, deferred_logger); updateWellState(dx_well, well_state, deferred_logger);
} }
@ -1495,8 +1494,7 @@ namespace Opm
assembleWellEqWithoutIteration(ebosSimulator, dt, inj_controls, prod_controls, well_state, group_state, deferred_logger); assembleWellEqWithoutIteration(ebosSimulator, dt, inj_controls, prod_controls, well_state, group_state, deferred_logger);
const BVectorWell dx_well = mswellhelpers::applyUMFPack(*this->linSys_.duneDSolver_, const BVectorWell dx_well = this->linSys_.solve();
this->linSys_.resWell_);
if (it > this->param_.strict_inner_iter_wells_) { if (it > this->param_.strict_inner_iter_wells_) {
relax_convergence = true; relax_convergence = true;