VFPProdProperties.hpp
Go to the documentation of this file.
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
28namespace Opm {
29
30class VFPProdTable;
31
37template<class Scalar>
39public:
43 void addTable(const VFPProdTable& new_table);
44
65 template <class EvalWell>
66 EvalWell bhp(const int table_id,
67 const EvalWell& aqua,
68 const EvalWell& liquid,
69 const EvalWell& vapour,
70 const Scalar thp,
71 const Scalar alq,
72 const Scalar explicit_wfr,
73 const Scalar explicit_gfr,
74 const bool use_expvfp) const;
75
91 Scalar bhp(const int table_id,
92 const Scalar aqua,
93 const Scalar liquid,
94 const Scalar vapour,
95 const Scalar thp,
96 const Scalar alq,
97 const Scalar explicit_wfr,
98 const Scalar explicit_gfr,
99 const bool use_expvfp) const;
100
116 Scalar thp(const int table_id,
117 const Scalar aqua,
118 const Scalar liquid,
119 const Scalar vapour,
120 const Scalar bhp,
121 const Scalar alq,
122 const Scalar explicit_wfr,
123 const Scalar explicit_gfr,
124 const bool use_expvfp) const;
125
130 const VFPProdTable& getTable(const int table_id) const;
131
135 bool hasTable(const int table_id) const;
136
140 bool empty() const
141 {
142 return m_tables.empty();
143 }
144
148 Scalar minimumBHP(const int table_id, const Scalar thp,
149 const Scalar wfr, const Scalar gfr, const Scalar alq) const;
150
151protected:
152 // calculate a group bhp values with a group of flo rate values
153 std::vector<Scalar> bhpwithflo(const std::vector<Scalar>& flos,
154 const int table_id,
155 const Scalar wfr,
156 const Scalar gfr,
157 const Scalar thp,
158 const Scalar alq,
159 const Scalar dp) const;
160
161 // Map which connects the table number with the table itself
162 std::map<int, std::reference_wrapper<const VFPProdTable>> m_tables;
163};
164
165} // namespace Opm
166
167#endif /* OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_ */
Definition: VFPProdProperties.hpp:38
Scalar bhp(const int table_id, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar thp, const Scalar alq, const Scalar explicit_wfr, const Scalar explicit_gfr, const bool use_expvfp) const
std::map< int, std::reference_wrapper< const VFPProdTable > > m_tables
Definition: VFPProdProperties.hpp:162
bool empty() const
Definition: VFPProdProperties.hpp:140
Scalar minimumBHP(const int table_id, const Scalar thp, const Scalar wfr, const Scalar gfr, const Scalar alq) const
void addTable(const VFPProdTable &new_table)
Scalar thp(const int table_id, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar bhp, const Scalar alq, const Scalar explicit_wfr, const Scalar explicit_gfr, const bool use_expvfp) const
bool hasTable(const int table_id) const
EvalWell bhp(const int table_id, const EvalWell &aqua, const EvalWell &liquid, const EvalWell &vapour, const Scalar thp, const Scalar alq, const Scalar explicit_wfr, const Scalar explicit_gfr, const bool use_expvfp) const
const VFPProdTable & getTable(const int table_id) const
std::vector< Scalar > bhpwithflo(const std::vector< Scalar > &flos, const int table_id, const Scalar wfr, const Scalar gfr, const Scalar thp, const Scalar alq, const Scalar dp) const
Definition: blackoilboundaryratevector.hh:39