mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add function sumDistributed to MultisegmentWellEquations
This functions sums all contributions of a multisegment well for the diagonal of D and the residual.
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
#include <opm/simulators/linalg/matrixblock.hh>
|
#include <opm/simulators/linalg/matrixblock.hh>
|
||||||
#include <opm/simulators/linalg/SmallDenseMatrixUtils.hpp>
|
#include <opm/simulators/linalg/SmallDenseMatrixUtils.hpp>
|
||||||
|
|
||||||
|
#include <opm/simulators/wells/WellHelpers.hpp>
|
||||||
#include <opm/simulators/wells/MSWellHelpers.hpp>
|
#include <opm/simulators/wells/MSWellHelpers.hpp>
|
||||||
#include <opm/simulators/wells/MultisegmentWellGeneric.hpp>
|
#include <opm/simulators/wells/MultisegmentWellGeneric.hpp>
|
||||||
#include <opm/simulators/wells/WellInterfaceGeneric.hpp>
|
#include <opm/simulators/wells/WellInterfaceGeneric.hpp>
|
||||||
@@ -409,6 +410,16 @@ extractCPRPressureMatrix(PressureMatrix& jacobian,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Scalar, int numWellEq, int numEq>
|
||||||
|
void MultisegmentWellEquations<Scalar,numWellEq,numEq>::
|
||||||
|
sumDistributed(Parallel::Communication comm)
|
||||||
|
{
|
||||||
|
// accumulate resWell_ and duneD_ in parallel to get effects of all perforations (might be distributed)
|
||||||
|
// we need to do this for all segments in the residual and on the diagonal of D
|
||||||
|
for (int seg = 0; seg < well_.numberOfSegments(); ++seg)
|
||||||
|
Opm::wellhelpers::sumDistributedWellEntries(duneD_[seg][seg], resWell_[seg], comm);
|
||||||
|
}
|
||||||
|
|
||||||
#define INSTANTIATE(T, numWellEq, numEq) \
|
#define INSTANTIATE(T, numWellEq, numEq) \
|
||||||
template class MultisegmentWellEquations<T,numWellEq,numEq>; \
|
template class MultisegmentWellEquations<T,numWellEq,numEq>; \
|
||||||
template void MultisegmentWellEquations<T,numWellEq,numEq>:: \
|
template void MultisegmentWellEquations<T,numWellEq,numEq>:: \
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#ifndef OPM_MULTISEGMENTWELL_EQUATIONS_HEADER_INCLUDED
|
#ifndef OPM_MULTISEGMENTWELL_EQUATIONS_HEADER_INCLUDED
|
||||||
#define OPM_MULTISEGMENTWELL_EQUATIONS_HEADER_INCLUDED
|
#define OPM_MULTISEGMENTWELL_EQUATIONS_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#include <opm/simulators/utils/ParallelCommunication.hpp>
|
||||||
#include <opm/simulators/wells/ParallelWellInfo.hpp>
|
#include <opm/simulators/wells/ParallelWellInfo.hpp>
|
||||||
#include <dune/common/fmatrix.hh>
|
#include <dune/common/fmatrix.hh>
|
||||||
#include <dune/common/fvector.hh>
|
#include <dune/common/fvector.hh>
|
||||||
@@ -121,6 +122,9 @@ public:
|
|||||||
const int seg_pressure_var_ind,
|
const int seg_pressure_var_ind,
|
||||||
const WellState<Scalar>& well_state) const;
|
const WellState<Scalar>& well_state) const;
|
||||||
|
|
||||||
|
//! \brief Sum with off-process contribution.
|
||||||
|
void sumDistributed(Parallel::Communication comm);
|
||||||
|
|
||||||
//! \brief Returns a const reference to the residual.
|
//! \brief Returns a const reference to the residual.
|
||||||
const BVectorWell& residual() const
|
const BVectorWell& residual() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user