From e7d00f4f99470306e23aba555aad9b10ab5833a4 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Thu, 21 Apr 2016 17:42:50 +0200 Subject: [PATCH] adding variableStateWellIndices to StandardWells to handle different types of variables later for different types of wells. --- opm/autodiff/BlackoilModelBase_impl.hpp | 3 +-- opm/autodiff/StandardWells.hpp | 5 +++++ opm/autodiff/StandardWells_impl.hpp | 12 ++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) 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++; + } + }