mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-13 09:51:57 -06:00
added functions for direct setting of well rates contribution to reservoir
This commit is contained in:
parent
c5d547efff
commit
5a39724606
@ -128,7 +128,7 @@ namespace Opm {
|
||||
typedef Dune::FieldVector<Scalar, numEq > VectorBlockType;
|
||||
typedef Dune::BlockVector<VectorBlockType> BVector;
|
||||
|
||||
// typedef Dune::FieldMatrix<Scalar, numEq, numEq > MatrixBlockType;
|
||||
typedef Opm::MatrixBlock<Scalar, numEq, numEq > MatrixBlockType;
|
||||
|
||||
typedef BlackOilPolymerModule<TypeTag> PolymerModule;
|
||||
typedef BlackOilMICPModule<TypeTag> MICPModule;
|
||||
@ -273,6 +273,29 @@ namespace Opm {
|
||||
|
||||
void addWellContributions(SparseMatrixAdapter& jacobian) const;
|
||||
|
||||
void addReseroirSourceTerms(GlobalEqVector& residual,
|
||||
SparseMatrixAdapter& jacobian) const
|
||||
{
|
||||
for ( const auto& well: well_container_ ) {
|
||||
if(!well->isOperableAndSolvable() && !well->wellIsStopped())
|
||||
return;
|
||||
|
||||
const auto& cells = well->cells();
|
||||
const auto& rates = well->connectionRates();
|
||||
for (unsigned perfIdx = 0; perfIdx < rates.size(); ++perfIdx) {
|
||||
unsigned cellIdx = cells[perfIdx];
|
||||
auto rate = rates[perfIdx];
|
||||
Scalar volume = ebosSimulator_.problem().volume(cellIdx,0);
|
||||
rate *= -1.0;
|
||||
VectorBlockType res(0.0);
|
||||
MatrixBlockType bMat(0.0);
|
||||
ebosSimulator_.model().linearizer().setResAndJacobi(res,bMat,rate);
|
||||
residual[cellIdx] += res;
|
||||
jacobian.addToBlock(cellIdx,cellIdx,bMat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// called at the beginning of a report step
|
||||
void beginReportStep(const int time_step);
|
||||
|
||||
|
@ -288,6 +288,7 @@ public:
|
||||
const GroupState& group_state,
|
||||
DeferredLogger& deferred_logger);
|
||||
|
||||
const std::vector<RateVector>& connectionRates() const {return connectionRates_;}
|
||||
protected:
|
||||
|
||||
// simulation parameters
|
||||
|
Loading…
Reference in New Issue
Block a user