mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
revising the computeWellPotentials in StandardWells
so it compute the potentials for each well instead of each perforation.
This commit is contained in:
@@ -820,12 +820,6 @@ typedef Eigen::Array<double,
|
||||
asImpl().addWellContributionToMassBalanceEq(cq_s, state, well_state);
|
||||
asImpl().wellModel().addWellControlEq(state, well_state, aliveWells, residual_);
|
||||
|
||||
if (param_.compute_well_potentials_) {
|
||||
SolutionState state0 = state;
|
||||
asImpl().makeConstantState(state0);
|
||||
asImpl().wellModel().computeWellPotentials(mob_perfcells, b_perfcells, state0, well_state);
|
||||
}
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,12 +149,6 @@ namespace Opm {
|
||||
asImpl().addWellContributionToMassBalanceEq(cq_s, state, well_state);
|
||||
asImpl().wellModel().addWellControlEq(state, well_state, aliveWells, residual_);
|
||||
|
||||
if (param_.compute_well_potentials_) {
|
||||
SolutionState state0 = state;
|
||||
asImpl().makeConstantState(state0);
|
||||
asImpl().wellModel().computeWellPotentials(mob_perfcells, b_perfcells, state0, well_state);
|
||||
}
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,8 +152,9 @@ namespace Opm {
|
||||
void
|
||||
computeWellPotentials(const std::vector<ADB>& mob_perfcells,
|
||||
const std::vector<ADB>& b_perfcells,
|
||||
const WellState& well_state,
|
||||
SolutionState& state0,
|
||||
WellState& well_state);
|
||||
std::vector<double>& well_potentials) const;
|
||||
|
||||
template <class SolutionState>
|
||||
void
|
||||
|
||||
@@ -1002,8 +1002,9 @@ namespace Opm
|
||||
void
|
||||
StandardWells::computeWellPotentials(const std::vector<ADB>& mob_perfcells,
|
||||
const std::vector<ADB>& b_perfcells,
|
||||
const WellState& well_state,
|
||||
SolutionState& state0,
|
||||
WellState& well_state)
|
||||
std::vector<double>& well_potentials) const
|
||||
{
|
||||
const int nw = wells().number_of_wells;
|
||||
const int np = wells().number_of_phases;
|
||||
@@ -1079,17 +1080,18 @@ namespace Opm
|
||||
|
||||
// compute well potentials
|
||||
Vector aliveWells;
|
||||
std::vector<ADB> well_potentials;
|
||||
computeWellFlux(state0, mob_perfcells, b_perfcells, aliveWells, well_potentials);
|
||||
std::vector<ADB> perf_potentials;
|
||||
computeWellFlux(state0, mob_perfcells, b_perfcells, aliveWells, perf_potentials);
|
||||
|
||||
// store well potentials in the well state
|
||||
// transform to a single vector instead of separate vectors pr phase
|
||||
const int nperf = wells().well_connpos[nw];
|
||||
Vector cq = superset(well_potentials[0].value(), Span(nperf, np, 0), nperf*np);
|
||||
for (int phase = 1; phase < np; ++phase) {
|
||||
cq += superset(well_potentials[phase].value(), Span(nperf, np, phase), nperf*np);
|
||||
well_potentials.resize(nw * np, 0.0);
|
||||
|
||||
for (int p = 0; p < np; ++p) {
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
for (int perf = wells().well_connpos[w]; perf < wells().well_connpos[w + 1]; ++perf) {
|
||||
well_potentials[w * np + p] += perf_potentials[p].value()[perf];
|
||||
}
|
||||
}
|
||||
}
|
||||
well_state.wellPotentials().assign(cq.data(), cq.data() + nperf*np);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user