My Project
VFPProdProperties.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_VFPPRODPROPERTIES_HPP_
21 #define OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_
22 
23 #include <functional>
24 #include <map>
25 #include <vector>
26 
27 
28 namespace Opm {
29 
30 class VFPProdTable;
31 
38 public:
39  VFPProdProperties() = default;
43  void addTable(const VFPProdTable& new_table);
44 
62  template <class EvalWell>
63  EvalWell bhp(const int table_id,
64  const EvalWell& aqua,
65  const EvalWell& liquid,
66  const EvalWell& vapour,
67  const double& thp,
68  const double& alq) const;
69 
82  double bhp(int table_id,
83  const double& aqua,
84  const double& liquid,
85  const double& vapour,
86  const double& thp,
87  const double& alq) const;
88 
101  double thp(int table_id,
102  const double& aqua,
103  const double& liquid,
104  const double& vapour,
105  const double& bhp,
106  const double& alq) const;
107 
112  const VFPProdTable& getTable(const int table_id) const;
113 
117  bool hasTable(const int table_id) const;
118 
122  bool empty() const {
123  return m_tables.empty();
124  }
125 
126 
127 protected:
128  // calculate a group bhp values with a group of flo rate values
129  std::vector<double> bhpwithflo(const std::vector<double>& flos,
130  const int table_id,
131  const double wfr,
132  const double gfr,
133  const double thp,
134  const double alq,
135  const double dp) const;
136 
137  // Map which connects the table number with the table itself
138  std::map<int, std::reference_wrapper<const VFPProdTable>> m_tables;
139 };
140 
141 
142 
143 
144 } //namespace
145 
146 
147 #endif /* OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_ */
Class which linearly interpolates BHP as a function of rate, tubing head pressure,...
Definition: VFPProdProperties.hpp:37
const VFPProdTable & getTable(const int table_id) const
Returns the table associated with the ID, or throws an exception if the table does not exist.
Definition: VFPProdProperties.cpp:98
double thp(int table_id, const double &aqua, const double &liquid, const double &vapour, const double &bhp, const double &alq) const
Linear interpolation of thp as a function of the input parameters.
Definition: VFPProdProperties.cpp:37
void addTable(const VFPProdTable &new_table)
Takes no ownership of data.
Definition: VFPProdProperties.cpp:138
bool hasTable(const int table_id) const
Check whether there is table associated with ID.
Definition: VFPProdProperties.cpp:102
EvalWell bhp(const int table_id, const EvalWell &aqua, const EvalWell &liquid, const EvalWell &vapour, const double &thp, const double &alq) const
Linear interpolation of bhp as a function of the input parameters given as Evalutions Each entry corr...
Definition: VFPProdProperties.cpp:143
bool empty() const
Returns true if no vfp tables are in the current map.
Definition: VFPProdProperties.hpp:122
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27