mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-27 09:40:59 -06:00
Rename method and move to impl file.
This commit is contained in:
parent
0da2b68e0b
commit
5042b02138
@ -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);
|
||||
|
@ -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>::
|
||||
|
Loading…
Reference in New Issue
Block a user