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.
This commit is contained in:
Tor Harald Sandve 2016-05-12 10:32:39 +02:00
parent 9f99484347
commit 592450777e
2 changed files with 7 additions and 0 deletions

View File

@ -24,12 +24,14 @@ BlackoilState::BlackoilState( const BlackoilState& other )
: SimulationDataContainer(other) : SimulationDataContainer(other)
{ {
setBlackoilStateReferencePointers(); setBlackoilStateReferencePointers();
hydrocarbonstate_ = other.hydroCarbonState();
} }
BlackoilState& BlackoilState::operator=( const BlackoilState& other ) BlackoilState& BlackoilState::operator=( const BlackoilState& other )
{ {
SimulationDataContainer::operator=(other); SimulationDataContainer::operator=(other);
setBlackoilStateReferencePointers(); setBlackoilStateReferencePointers();
hydrocarbonstate_ = other.hydroCarbonState();
return *this; return *this;
} }

View File

@ -62,10 +62,12 @@ namespace Opm
std::vector<double>& surfacevol () { return *surfacevol_ref_; } std::vector<double>& surfacevol () { return *surfacevol_ref_; }
std::vector<double>& gasoilratio () { return *gasoilratio_ref_; } std::vector<double>& gasoilratio () { return *gasoilratio_ref_; }
std::vector<double>& rv () { return *rv_ref_; } std::vector<double>& rv () { return *rv_ref_; }
std::vector<int>& hydroCarbonState() { return hydrocarbonstate_; }
const std::vector<double>& surfacevol () const { return *surfacevol_ref_; } const std::vector<double>& surfacevol () const { return *surfacevol_ref_; }
const std::vector<double>& gasoilratio () const { return *gasoilratio_ref_; } const std::vector<double>& gasoilratio () const { return *gasoilratio_ref_; }
const std::vector<double>& rv () const { return *rv_ref_; } const std::vector<double>& rv () const { return *rv_ref_; }
const std::vector<int>& hydroCarbonState() const { return hydrocarbonstate_; }
private: private:
void setBlackoilStateReferencePointers(); void setBlackoilStateReferencePointers();
@ -73,6 +75,9 @@ namespace Opm
std::vector<double>* gasoilratio_ref_; std::vector<double>* gasoilratio_ref_;
std::vector<double>* rv_ref_; std::vector<double>* rv_ref_;
// A vector storing the hydro carbon state.
std::vector<int> hydrocarbonstate_;
}; };
} // namespace Opm } // namespace Opm