mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added: StandardWellEquations::recoverSolutionWell()
this recovers the well solution from a solution vector. use the new method in the well implementation.
This commit is contained in:
parent
daf0f90fe5
commit
40640e9da6
@ -253,9 +253,6 @@ namespace Opm
|
||||
protected:
|
||||
bool regularize_;
|
||||
|
||||
// xw = inv(D)*(rw - C*x)
|
||||
void recoverSolutionWell(const BVector& x, BVectorWell& xw) const;
|
||||
|
||||
// updating the well_state based on well solution dwells
|
||||
void updateWellState(const BVectorWell& dwells,
|
||||
WellState& well_state,
|
||||
|
@ -166,6 +166,18 @@ void StandardWellEquations<Scalar,numEq>::solve(BVectorWell& dx_well) const
|
||||
invDuneD_.mv(resWell_, dx_well);
|
||||
}
|
||||
|
||||
|
||||
template<class Scalar, int numEq>
|
||||
void StandardWellEquations<Scalar,numEq>::
|
||||
recoverSolutionWell(const BVector& x, BVectorWell& xw) const
|
||||
{
|
||||
BVectorWell resWell = resWell_;
|
||||
// resWell = resWell - B * x
|
||||
parallelB_.mmv(x, resWell);
|
||||
// xw = D^-1 * resWell
|
||||
invDuneD_.mv(resWell, xw);
|
||||
}
|
||||
|
||||
#define INSTANCE(N) \
|
||||
template class StandardWellEquations<double,N>;
|
||||
|
||||
|
@ -85,6 +85,10 @@ public:
|
||||
//! \brief Invert D matrix.
|
||||
void invert();
|
||||
|
||||
//! \brief Recover well solution.
|
||||
//! \details xw = inv(D)*(rw - C*x)
|
||||
void recoverSolutionWell(const BVector& x, BVectorWell& xw) const;
|
||||
|
||||
// two off-diagonal matrices
|
||||
OffDiagMatWell duneB_;
|
||||
OffDiagMatWell duneC_;
|
||||
|
@ -1732,21 +1732,6 @@ namespace Opm
|
||||
this->linSys_.apply(r);
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
StandardWell<TypeTag>::
|
||||
recoverSolutionWell(const BVector& x, BVectorWell& xw) const
|
||||
{
|
||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
|
||||
|
||||
BVectorWell resWell = this->linSys_.resWell_;
|
||||
// resWell = resWell - B * x
|
||||
this->linSys_.parallelB_.mmv(x, resWell);
|
||||
// xw = D^-1 * resWell
|
||||
this->linSys_.invDuneD_.mv(resWell, xw);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1762,7 +1747,7 @@ namespace Opm
|
||||
BVectorWell xw(1);
|
||||
xw[0].resize(this->numWellEq_);
|
||||
|
||||
recoverSolutionWell(x, xw);
|
||||
this->linSys_.recoverSolutionWell(x, xw);
|
||||
updateWellState(xw, well_state, deferred_logger);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user