From 592450777e111c83bf07849695f957003a39edc4 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 12 May 2016 10:32:39 +0200 Subject: [PATCH] Add member hydroCarbonState to the BlackoilState The hydroCarbonState is used to store the hydroCarbonState State 1: Gas only State 2: Gas and Oil State 3: Oil only An empty vector is return at initialization as no default values are provided by the blackoilstate. --- opm/core/simulator/BlackoilState.cpp | 2 ++ opm/core/simulator/BlackoilState.hpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/opm/core/simulator/BlackoilState.cpp b/opm/core/simulator/BlackoilState.cpp index 1f51dabba..c274136a9 100644 --- a/opm/core/simulator/BlackoilState.cpp +++ b/opm/core/simulator/BlackoilState.cpp @@ -24,12 +24,14 @@ BlackoilState::BlackoilState( const BlackoilState& other ) : SimulationDataContainer(other) { setBlackoilStateReferencePointers(); + hydrocarbonstate_ = other.hydroCarbonState(); } BlackoilState& BlackoilState::operator=( const BlackoilState& other ) { SimulationDataContainer::operator=(other); setBlackoilStateReferencePointers(); + hydrocarbonstate_ = other.hydroCarbonState(); return *this; } diff --git a/opm/core/simulator/BlackoilState.hpp b/opm/core/simulator/BlackoilState.hpp index 7f45e029f..51c6c21cb 100644 --- a/opm/core/simulator/BlackoilState.hpp +++ b/opm/core/simulator/BlackoilState.hpp @@ -62,10 +62,12 @@ namespace Opm std::vector& surfacevol () { return *surfacevol_ref_; } std::vector& gasoilratio () { return *gasoilratio_ref_; } std::vector& rv () { return *rv_ref_; } + std::vector& hydroCarbonState() { return hydrocarbonstate_; } const std::vector& surfacevol () const { return *surfacevol_ref_; } const std::vector& gasoilratio () const { return *gasoilratio_ref_; } const std::vector& rv () const { return *rv_ref_; } + const std::vector& hydroCarbonState() const { return hydrocarbonstate_; } private: void setBlackoilStateReferencePointers(); @@ -73,6 +75,9 @@ namespace Opm std::vector* gasoilratio_ref_; std::vector* rv_ref_; + // A vector storing the hydro carbon state. + std::vector hydrocarbonstate_; + }; } // namespace Opm