BlackoilState.hpp
1 /*
2  Copyright 2012 SINTEF ICT, Applied Mathematics.
3  Copyright 2015 IRIS AS
4 
5  This file is part of the Open Porous Media project (OPM).
6 
7  OPM is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  OPM is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with OPM. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef OPM_BLACKOILSTATE_HEADER_INCLUDED
22 #define OPM_BLACKOILSTATE_HEADER_INCLUDED
23 
24 #include <opm/common/data/SimulationDataContainer.hpp>
25 
26 #include <opm/core/grid.h>
27 #include <opm/core/props/BlackoilPropertiesInterface.hpp>
28 #include <vector>
29 
30 namespace Opm
31 {
32 
33  enum HydroCarbonState {
34  GasOnly = 0,
35  GasAndOil = 1,
36  OilOnly = 2
37  };
38 
40  class BlackoilState : public SimulationDataContainer
41  {
42  public:
43  static const std::string GASOILRATIO;
44  static const std::string RV;
45  static const std::string SURFACEVOL;
46  static const std::string SSOL;
47  static const std::string POLYMER;
48 
56  BlackoilState(size_t num_cells, size_t num_faces, size_t num_phases);
57 
62  BlackoilState(const BlackoilState& other);
63 
68  BlackoilState& operator=(const BlackoilState& other);
69 
70  std::vector<double>& surfacevol () { return *surfacevol_ref_; }
71  std::vector<double>& gasoilratio () { return *gasoilratio_ref_; }
72  std::vector<double>& rv () { return *rv_ref_; }
73  std::vector<HydroCarbonState>& hydroCarbonState() { return hydrocarbonstate_; }
74 
75  const std::vector<double>& surfacevol () const { return *surfacevol_ref_; }
76  const std::vector<double>& gasoilratio () const { return *gasoilratio_ref_; }
77  const std::vector<double>& rv () const { return *rv_ref_; }
78  const std::vector<HydroCarbonState>& hydroCarbonState() const { return hydrocarbonstate_; }
79 
80  private:
81  void setBlackoilStateReferencePointers();
82  std::vector<double>* surfacevol_ref_;
83  std::vector<double>* gasoilratio_ref_;
84  std::vector<double>* rv_ref_;
85 
86  // A vector storing the hydro carbon state.
87  std::vector<HydroCarbonState> hydrocarbonstate_;
88 
89 
90  };
91 } // namespace Opm
92 
93 
94 #endif // OPM_BLACKOILSTATE_HEADER_INCLUDED
BlackoilState & operator=(const BlackoilState &other)
Copy assignment operator.
Definition: BlackoilState.cpp:37
Definition: AnisotropicEikonal.cpp:446
Simulator state for a blackoil simulator.
Definition: BlackoilState.hpp:40
BlackoilState(size_t num_cells, size_t num_faces, size_t num_phases)
Main constructor setting the sizes for the contained data types.
Definition: BlackoilState.cpp:18