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,
69  const double& explicit_wfr,
70  const double& explicit_gfr,
71  const bool use_expvfp) const;
72 
85  double bhp(int table_id,
86  const double& aqua,
87  const double& liquid,
88  const double& vapour,
89  const double& thp,
90  const double& alq,
91  const double& explicit_wfr,
92  const double& explicit_gfr,
93  const bool use_expvfp) const;
94 
107  double thp(int table_id,
108  const double& aqua,
109  const double& liquid,
110  const double& vapour,
111  const double& bhp,
112  const double& alq) const;
113 
118  const VFPProdTable& getTable(const int table_id) const;
119 
123  bool hasTable(const int table_id) const;
124 
128  bool empty() const {
129  return m_tables.empty();
130  }
131 
132 
133 protected:
134  // calculate a group bhp values with a group of flo rate values
135  std::vector<double> bhpwithflo(const std::vector<double>& flos,
136  const int table_id,
137  const double wfr,
138  const double gfr,
139  const double thp,
140  const double alq,
141  const double dp) const;
142 
143  // Map which connects the table number with the table itself
144  std::map<int, std::reference_wrapper<const VFPProdTable>> m_tables;
145 };
146 
147 
148 
149 
150 } //namespace
151 
152 
153 #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:101
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:141
bool hasTable(const int table_id) const
Check whether there is table associated with ID.
Definition: VFPProdProperties.cpp:105
EvalWell bhp(const int table_id, const EvalWell &aqua, const EvalWell &liquid, const EvalWell &vapour, const double &thp, const double &alq, const double &explicit_wfr, const double &explicit_gfr, const bool use_expvfp) const
Linear interpolation of bhp as a function of the input parameters given as Evalutions Each entry corr...
Definition: VFPProdProperties.cpp:146
bool empty() const
Returns true if no vfp tables are in the current map.
Definition: VFPProdProperties.hpp:128
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27