mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added: MultisegmentWellEquations::recoverSolutionWell()
this recovers the well solution from a solution vector. use the new method in the well implementation.
This commit is contained in:
parent
bc312d1117
commit
d50aaf8ed4
@ -168,6 +168,17 @@ MultisegmentWellEquations<Scalar,numWellEq,numEq>::solve() const
|
||||
return mswellhelpers::applyUMFPack(*duneDSolver_, resWell_);
|
||||
}
|
||||
|
||||
template<class Scalar, int numWellEq, int numEq>
|
||||
void MultisegmentWellEquations<Scalar,numWellEq,numEq>::
|
||||
recoverSolutionWell(const BVector& x, BVectorWell& xw) const
|
||||
{
|
||||
BVectorWell resWell = resWell_;
|
||||
// resWell = resWell - B * x
|
||||
duneB_.mmv(x, resWell);
|
||||
// xw = D^-1 * resWell
|
||||
xw = mswellhelpers::applyUMFPack(*duneDSolver_, resWell);
|
||||
}
|
||||
|
||||
#define INSTANCE(numWellEq, numEq) \
|
||||
template class MultisegmentWellEquations<double,numWellEq,numEq>;
|
||||
|
||||
|
@ -86,6 +86,10 @@ public:
|
||||
//! \brief Apply inverted D matrix to residual and return result.
|
||||
BVectorWell solve() const;
|
||||
|
||||
//! \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_;
|
||||
|
@ -389,20 +389,6 @@ updatePrimaryVariables(const WellState& well_state) const
|
||||
}
|
||||
}
|
||||
|
||||
template<typename FluidSystem, typename Indices, typename Scalar>
|
||||
void
|
||||
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
|
||||
recoverSolutionWell(const BVector& x, BVectorWell& xw) const
|
||||
{
|
||||
if (!baseif_.isOperableAndSolvable() && !baseif_.wellIsStopped()) return;
|
||||
|
||||
BVectorWell resWell = linSys_.resWell_;
|
||||
// resWell = resWell - B * x
|
||||
linSys_.duneB_.mmv(x, resWell);
|
||||
// xw = D^-1 * resWell
|
||||
xw = mswellhelpers::applyUMFPack(*linSys_.duneDSolver_, resWell);
|
||||
}
|
||||
|
||||
template<typename FluidSystem, typename Indices, typename Scalar>
|
||||
typename MultisegmentWellEval<FluidSystem,Indices,Scalar>::EvalWell
|
||||
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
|
||||
|
@ -142,10 +142,6 @@ protected:
|
||||
// handling the overshooting and undershooting of the fractions
|
||||
void processFractions(const int seg) const;
|
||||
|
||||
// xw = inv(D)*(rw - C*x)
|
||||
void recoverSolutionWell(const BVector& x,
|
||||
BVectorWell& xw) const;
|
||||
|
||||
void updatePrimaryVariables(const WellState& well_state) const;
|
||||
|
||||
void updateUpwindingSegments();
|
||||
|
@ -233,10 +233,12 @@ namespace Opm
|
||||
WellState& well_state,
|
||||
DeferredLogger& deferred_logger)
|
||||
{
|
||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
|
||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BVectorWell xw(1);
|
||||
this->recoverSolutionWell(x, xw);
|
||||
this->linSys_.recoverSolutionWell(x, xw);
|
||||
updateWellState(xw, well_state, deferred_logger);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user