20 #ifndef OPM_AUTODIFF_VFPINJPROPERTIES_HPP_
21 #define OPM_AUTODIFF_VFPINJPROPERTIES_HPP_
23 #include <opm/parser/eclipse/EclipseState/Tables/VFPInjTable.hpp>
24 #include <opm/core/wells.h>
25 #include <opm/material/densead/Math.hpp>
26 #include <opm/material/densead/Evaluation.hpp>
27 #include <opm/autodiff/VFPHelpers.hpp>
36 template <
class Scalar>
72 ADB bhp(
const std::vector<int>& table_id,
92 ADB bhp(
const std::vector<int>& table_id,
96 const ADB& thp)
const;
114 template <
class EvalWell>
115 EvalWell
bhp(
const int table_id,
116 const EvalWell& aqua,
117 const EvalWell& liquid,
118 const EvalWell& vapour,
119 const double& thp)
const {
122 const VFPInjTable* table = detail::getTable(m_tables, table_id);
126 EvalWell flo = detail::getFlo(aqua, liquid, vapour, table->getFloType());
129 if (table !=
nullptr) {
132 auto flo_i = detail::findInterpData(flo.value(), table->getFloAxis());
133 auto thp_i = detail::findInterpData( thp, table->getTHPAxis());
137 bhp = bhp_val.dflo * flo;
138 bhp.setValue(bhp_val.value);
141 bhp.setValue(-1e100);
157 double bhp(
int table_id,
159 const double& liquid,
160 const double& vapour,
161 const double& thp)
const;
175 double thp(
int table_id,
177 const double& liquid,
178 const double& vapour,
179 const double& bhp)
const;
185 const VFPInjTable*
getTable(
const int table_id)
const;
191 return m_tables.empty();
196 std::map<int, const VFPInjTable*> m_tables;
An "ADB-like" structure with a single value and a set of derivatives.
Definition: VFPHelpers.hpp:272
ADB bhp(const std::vector< int > &table_id, const Wells &wells, const ADB &qs, const ADB &thp) const
Linear interpolation of bhp as function of the input parameters.
Definition: VFPInjProperties.cpp:71
Definition: VFPInjProperties.hpp:39
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:218
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:183
bool empty() const
Returns true if no vfp tables are in the current map.
Definition: VFPInjProperties.hpp:190
VFPInjProperties()
Empty constructor.
Definition: VFPInjProperties.cpp:52
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.hpp:115