adding extractWellPerfProperties to StandardWells

It causes problem for the flow_multisegment. So the version in
BlackoilModelBase is kept for now.

On the other hand, it is few of functions that will be both required by
the standard wells and multisegment wells.

Some decision will be made later on how to put this function.
This commit is contained in:
Kai Bao 2016-04-08 16:48:31 +02:00
parent c8b66821d5
commit e9e1b9fda8
3 changed files with 40 additions and 1 deletions

View File

@ -851,7 +851,7 @@ namespace detail {
std::vector<ADB> mob_perfcells; std::vector<ADB> mob_perfcells;
std::vector<ADB> b_perfcells; std::vector<ADB> b_perfcells;
asImpl().extractWellPerfProperties(state, mob_perfcells, b_perfcells); asImpl().stdWells().extractWellPerfProperties(rq_, fluid_.numPhases(), mob_perfcells, b_perfcells);
if (param_.solve_welleq_initially_ && initial_assembly) { if (param_.solve_welleq_initially_ && initial_assembly) {
// solve the well equations as a pre-processing step // solve the well equations as a pre-processing step
asImpl().solveWellEq(mob_perfcells, b_perfcells, state, well_state); asImpl().solveWellEq(mob_perfcells, b_perfcells, state, well_state);

View File

@ -101,6 +101,12 @@ namespace Opm {
const std::vector<double>& depth_perf, const std::vector<double>& depth_perf,
const double grav); const double grav);
template <class ReservoirResidualQuant>
void extractWellPerfProperties(const std::vector<ReservoirResidualQuant>& rq,
const int np,
std::vector<ADB>& mob_perfcells,
std::vector<ADB>& b_perfcells) const;
protected: protected:
bool wells_active_; bool wells_active_;

View File

@ -247,6 +247,10 @@ namespace Opm
} }
template <class WellState> template <class WellState>
void void
StandardWells:: StandardWells::
@ -277,4 +281,33 @@ namespace Opm
well_perforation_pressure_diffs_ = Eigen::Map<const Vector>(cdp.data(), nperf); well_perforation_pressure_diffs_ = Eigen::Map<const Vector>(cdp.data(), nperf);
} }
template <class ReservoirResidualQuant>
void
StandardWells::
extractWellPerfProperties(const std::vector<ReservoirResidualQuant>& rq,
const int np,
std::vector<ADB>& mob_perfcells,
std::vector<ADB>& b_perfcells) const
{
// If we have wells, extract the mobilities and b-factors for
// the well-perforated cells.
if ( !localWellsActive() ) {
mob_perfcells.clear();
b_perfcells.clear();
return;
} else {
const std::vector<int>& well_cells = wellOps().well_cells;
mob_perfcells.resize(np, ADB::null());
b_perfcells.resize(np, ADB::null());
for (int phase = 0; phase < np; ++phase) {
mob_perfcells[phase] = subset(rq[phase].mob, well_cells);
b_perfcells[phase] = subset(rq[phase].b, well_cells);
}
}
}
} }