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
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 Scalar thp,
68 const Scalar alq,
69 const Scalar explicit_wfr,
70 const Scalar explicit_gfr,
71 const bool use_expvfp) const;
72
85 Scalar bhp(const int table_id,
86 const Scalar aqua,
87 const Scalar liquid,
88 const Scalar vapour,
89 const Scalar thp,
90 const Scalar alq,
91 const Scalar explicit_wfr,
92 const Scalar explicit_gfr,
93 const bool use_expvfp) const;
94
107 Scalar thp(const int table_id,
108 const Scalar aqua,
109 const Scalar liquid,
110 const Scalar vapour,
111 const Scalar bhp,
112 const Scalar alq,
113 const Scalar explicit_wrf,
114 const Scalar explicit_gfr,
115 const bool use_expvfp) const;
116
121 const VFPProdTable& getTable(const int table_id) const;
122
126 bool hasTable(const int table_id) const;
127
131 bool empty() const
132 {
133 return m_tables.empty();
134 }
135
139 Scalar minimumBHP(const int table_id, const Scalar thp,
140 const Scalar wfr, const Scalar gfr, const Scalar alq) const;
141
142protected:
143 // calculate a group bhp values with a group of flo rate values
144 std::vector<Scalar> bhpwithflo(const std::vector<Scalar>& flos,
145 const int table_id,
146 const Scalar wfr,
147 const Scalar gfr,
148 const Scalar thp,
149 const Scalar alq,
150 const Scalar dp) const;
151
152 // Map which connects the table number with the table itself
153 std::map<int, std::reference_wrapper<const VFPProdTable>> m_tables;
154};
155
156} // namespace Opm
157
158#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:153
bool empty() const
Definition: VFPProdProperties.hpp:131
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)
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
Scalar thp(const int table_id, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar bhp, const Scalar alq, const Scalar explicit_wrf, 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:37