My Project
VFPInjProperties.hpp
1 /*
2  Copyright 2015 SINTEF ICT, Applied Mathematics.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef OPM_AUTODIFF_VFPINJPROPERTIES_HPP_
21 #define OPM_AUTODIFF_VFPINJPROPERTIES_HPP_
22 
23 
24 #include <functional>
25 #include <map>
26 #include <vector>
27 
28 
29 namespace Opm {
30 
31 class VFPInjTable;
32 
34 public:
35  VFPInjProperties() = default;
39  void addTable(const VFPInjTable& new_table);
40 
57  template <class EvalWell>
58  EvalWell bhp(const int table_id,
59  const EvalWell& aqua,
60  const EvalWell& liquid,
61  const EvalWell& vapour,
62  const double& thp) const;
63 
68  const VFPInjTable& getTable(const int table_id) const;
69 
73  bool hasTable(const int table_id) const;
74 
78  bool empty() const {
79  return m_tables.empty();
80  }
81 
93  double bhp(int table_id,
94  const double& aqua,
95  const double& liquid,
96  const double& vapour,
97  const double& thp) const;
98 
110  double thp(int table_id,
111  const double& aqua,
112  const double& liquid,
113  const double& vapour,
114  const double& bhp) const;
115 
116 protected:
117  // Map which connects the table number with the table itself
118  std::map<int, std::reference_wrapper<const VFPInjTable>> m_tables;
119 };
120 
121 
122 
123 } //namespace
124 
125 
126 
127 #endif /* OPM_AUTODIFF_VFPINJPROPERTIES_HPP_ */
Definition: VFPInjProperties.hpp:33
const VFPInjTable & getTable(const int table_id) const
Returns the table associated with the ID, or throws an exception if the table does not exist.
Definition: VFPInjProperties.cpp:76
EvalWell bhp(const int table_id, const EvalWell &aqua, const EvalWell &liquid, const EvalWell &vapour, const double &thp) const
Linear interpolation of bhp as a function of the input parameters given as Evaluation Each entry corr...
Definition: VFPInjProperties.cpp:89
bool hasTable(const int table_id) const
Check whether there is table associated with ID.
Definition: VFPInjProperties.cpp:80
bool empty() const
Returns true if no vfp tables are in the current map.
Definition: VFPInjProperties.hpp:78
void addTable(const VFPInjTable &new_table)
Takes no ownership of data.
Definition: VFPInjProperties.cpp:84
double thp(int table_id, const double &aqua, const double &liquid, const double &vapour, const double &bhp) const
Linear interpolation of thp as a function of the input parameters.
Definition: VFPInjProperties.cpp:47
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:26