mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -140,7 +140,7 @@ namespace Opm {
|
||||
|
||||
MultisegmentWells ms_wells_;
|
||||
|
||||
using Base::stdWells;
|
||||
// using Base::stdWells;
|
||||
using Base::wells;
|
||||
using Base::wellsActive;
|
||||
using Base::updatePrimalVariableFromState;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user