mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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 addWellContributions(SparseMatrixAdapter& jacobian) const;
|
||||||
|
|
||||||
void addReseroirSourceTerms(GlobalEqVector& residual,
|
void addReservoirSourceTerms(GlobalEqVector& residual,
|
||||||
SparseMatrixAdapter& jacobian) const
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// called at the beginning of a report step
|
// called at the beginning of a report step
|
||||||
void beginReportStep(const int time_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>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
BlackoilWellModel<TypeTag>::
|
BlackoilWellModel<TypeTag>::
|
||||||
|
Loading…
Reference in New Issue
Block a user