diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index 3feae3d46..0765a0f0e 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -604,8 +604,7 @@ namespace detail { if (active_[Gas]) { indices[Xvar] = next++; } - indices[Qs] = next++; - indices[Bhp] = next++; + asImpl().stdWells().variableStateWellIndices(indices, next); assert(next == fluid_.numPhases() + 2); return indices; } diff --git a/opm/autodiff/StandardWells.hpp b/opm/autodiff/StandardWells.hpp index d094cb138..0f894a242 100644 --- a/opm/autodiff/StandardWells.hpp +++ b/opm/autodiff/StandardWells.hpp @@ -180,6 +180,11 @@ namespace Opm { WellState& well_state); + void + variableStateWellIndices(std::vector& indices, + int& next) const; + + protected: bool wells_active_; diff --git a/opm/autodiff/StandardWells_impl.hpp b/opm/autodiff/StandardWells_impl.hpp index 7ca1cbc61..44a2afb73 100644 --- a/opm/autodiff/StandardWells_impl.hpp +++ b/opm/autodiff/StandardWells_impl.hpp @@ -1118,4 +1118,16 @@ namespace Opm } + + + + + void + StandardWells::variableStateWellIndices(std::vector& indices, + int& next) const + { + indices[Qs] = next++; + indices[Bhp] = next++; + } + }