Rename method and move to impl file.

This commit is contained in:
Atgeirr Flø Rasmussen 2022-07-07 13:16:29 +02:00
parent 0da2b68e0b
commit 5042b02138
2 changed files with 32 additions and 27 deletions

View File

@ -273,33 +273,8 @@ namespace Opm {
void addWellContributions(SparseMatrixAdapter& jacobian) const;
void addReseroirSourceTerms(GlobalEqVector& residual,
SparseMatrixAdapter& jacobian) const
{
// NB this loop may write to same element if a cell has more than one perforation
#ifdef _OPENMP
#pragma omp parallel for
#endif
for(size_t i = 0; i < well_container_.size(); i++){// to be sure open understand
const auto& well = well_container_[i];
if(!well->isOperableAndSolvable() && !well->wellIsStopped())
continue;
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);
}
}
}
void addReservoirSourceTerms(GlobalEqVector& residual,
SparseMatrixAdapter& jacobian) const;
// called at the beginning of a report step
void beginReportStep(const int time_step);

View File

@ -1202,6 +1202,36 @@ namespace Opm {
}
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::
addReservoirSourceTerms(GlobalEqVector& residual,
SparseMatrixAdapter& jacobian) const
{
// NB this loop may write to same element if a cell has more than one perforation
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (size_t i = 0; i < well_container_.size(); i++) {
const auto& well = well_container_[i];
if (!well->isOperableAndSolvable() && !well->wellIsStopped())
continue;
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_.model().dofTotalVolume(cellIdx);
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);
}
}
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::