From a15513e546cc0e9f9192f1798bea47aa9f5f68d3 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 19 Oct 2016 16:18:41 +0200 Subject: [PATCH] adding a rate converter to the BlackoilModelBase --- opm/autodiff/BlackoilModelBase.hpp | 9 +++++++++ opm/autodiff/BlackoilModelBase_impl.hpp | 1 + 2 files changed, 10 insertions(+) diff --git a/opm/autodiff/BlackoilModelBase.hpp b/opm/autodiff/BlackoilModelBase.hpp index 5fa46ff25..24ba46ded 100644 --- a/opm/autodiff/BlackoilModelBase.hpp +++ b/opm/autodiff/BlackoilModelBase.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -152,6 +153,11 @@ namespace Opm { typedef typename ModelTraits::ModelParameters ModelParameters; typedef typename ModelTraits::SolutionState SolutionState; + // for the conversion between the surface volume rate and resrevoir voidage rate + // Due to the requirement of the grid information, put the converter in the model. + using RateConverterType = RateConverter:: + SurfaceToReservoirVoidage >; + // --------- Public methods --------- /// Construct the model. It will retain references to the @@ -360,6 +366,9 @@ namespace Opm { double current_relaxation_; V dx_old_; + // rate converter between the surface volume rates and reservoir voidage rates + RateConverterType rate_converter_; + // --------- Protected methods --------- /// Access the most-derived class used for diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index 1f2c068c6..f950dd36e 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -203,6 +203,7 @@ namespace detail { , terminal_output_ (terminal_output) , material_name_(0) , current_relaxation_(1.0) + , rate_converter_(fluid_, std::vector(std::vector(AutoDiffGrid::numCells(grid_),0))) { if (active_[Water]) { material_name_.push_back("Water");