adding variableWellStateIndices to MultisegmentWells

to remove the using of stdWells() in BlackoilMultiSegmentModel
The code is copied from StandardWells, better solution need to be
exploited.
This commit is contained in:
Kai Bao
2016-04-29 15:00:03 +02:00
parent a8742a9348
commit 89a8f133fd
4 changed files with 42 additions and 2 deletions

View File

@@ -140,7 +140,7 @@ namespace Opm {
MultisegmentWells ms_wells_;
using Base::stdWells;
// using Base::stdWells;
using Base::wells;
using Base::wellsActive;
using Base::updatePrimalVariableFromState;

View File

@@ -630,7 +630,7 @@ namespace Opm {
V aliveWells;
const int np = wells().number_of_phases;
std::vector<ADB> cq_s(np, ADB::null());
std::vector<int> indices = stdWells().variableWellStateIndices();
std::vector<int> indices = msWells().variableWellStateIndices();
SolutionState state0 = state;
WellState well_state0 = well_state;
makeConstantState(state0);

View File

@@ -234,6 +234,38 @@ namespace Opm {
well_segment_perforation_pressure_diffs_ = grav * well_segment_perforation_depth_diffs_ * well_segment_perforation_densities;
}
void
MultisegmentWells::
variableStateWellIndices(std::vector<int>& indices,
int& next) const
{
indices[Qs] = next++;
indices[Bhp] = next++;
}
std::vector<int>
MultisegmentWells::
variableWellStateIndices() const
{
// Black oil model standard is 5 equation.
// For the pure well solve, only the well equations are picked.
std::vector<int> indices(5, -1);
int next = 0;
variableStateWellIndices(indices, next);
assert(next == 2);
return indices;
}
} // end of namespace Opm

View File

@@ -163,6 +163,14 @@ namespace Opm {
updateWellControls(const bool terminal_output,
WellState& xw) const;
// TODO: these code are same with the StandardWells
// to find a better solution later.
void
variableStateWellIndices(std::vector<int>& indices,
int& next) const;
std::vector<int>
variableWellStateIndices() const;
protected:
// TODO: probably a wells_active_ will be required here.
const std::vector<WellMultiSegmentConstPtr> wells_multisegment_;