added: StandardWellEquations::sumDistributed

this sums up the global equation system for distributed wells
This commit is contained in:
Arne Morten Kvarving 2022-11-11 21:41:24 +01:00
parent e9ed80d644
commit 4b4898d6ec
3 changed files with 14 additions and 2 deletions

View File

@ -385,6 +385,14 @@ extractCPRPressureMatrix(PressureMatrix& jacobian,
}
}
template<class Scalar, int numEq>
void StandardWellEquations<Scalar,numEq>::
sumDistributed(Parallel::Communication comm)
{
// accumulate resWell_ and duneD_ in parallel to get effects of all perforations (might be distributed)
wellhelpers::sumDistributedWellEntries(duneD_[0][0], resWell_[0], comm);
}
#define INSTANCE(N) \
template class StandardWellEquations<double,N>; \
template void StandardWellEquations<double,N>:: \

View File

@ -23,6 +23,7 @@
#ifndef OPM_STANDARDWELL_EQUATIONS_HEADER_INCLUDED
#define OPM_STANDARDWELL_EQUATIONS_HEADER_INCLUDED
#include <opm/simulators/utils/ParallelCommunication.hpp>
#include <opm/simulators/wells/WellHelpers.hpp>
#include <dune/common/dynmatrix.hh>
@ -113,6 +114,9 @@ public:
//! \brief Get the number of blocks of the C and B matrices.
unsigned int getNumBlocks() const;
//! \brief Sum with off-process contribution.
void sumDistributed(Parallel::Communication comm);
// two off-diagonal matrices
OffDiagMatWell duneB_;
OffDiagMatWell duneC_;

View File

@ -526,8 +526,8 @@ namespace Opm
}
// accumulate resWell_ and duneD_ in parallel to get effects of all perforations (might be distributed)
wellhelpers::sumDistributedWellEntries(this->linSys_.duneD_[0][0], this->linSys_.resWell_[0],
this->parallel_well_info_.communication());
this->linSys_.sumDistributed(this->parallel_well_info_.communication());
// add vol * dF/dt + Q to the well equations;
for (int componentIdx = 0; componentIdx < numWellConservationEq; ++componentIdx) {
// TODO: following the development in MSW, we need to convert the volume of the wellbore to be surface volume