21#ifndef OPM_AUTODIFF_VFPHELPERS_HPP_
22#define OPM_AUTODIFF_VFPHELPERS_HPP_
45 VFPEvaluation() : value(0.0), dthp(0.0), dwfr(0.0), dgfr(0.0), dalq(0.0), dflo(0.0) {};
67 InterpData() : ind_{0, 0}, inv_dist_(0.0), factor_(0.0) {}
119const T& getTable(
const std::map<
int, std::reference_wrapper<const T>>&
tables,
int table_id);
125bool hasTable(
const std::map<
int, std::reference_wrapper<const T>>&
tables,
int table_id) {
133template <
typename TYPE,
typename TABLE>
138template<
class Scalar>
148 const std::vector<double>& values);
176 const bool use_vfpexplicit);
198 static std::pair<Scalar, Scalar>
209 static std::optional<std::pair<Scalar, Scalar>>
217 const std::function<Scalar(
const Scalar)>&
adjust_bhp);
Definition VFPHelpers.hpp:139
static std::pair< Scalar, Scalar > getMinimumBHPCoordinate(const VFPProdTable &table, const Scalar thp, const Scalar wfr, const Scalar gfr, const Scalar alq)
Get (flo, bhp) at minimum bhp for given thp,wfr,gfr,alq.
Definition VFPHelpers.cpp:511
static Scalar findTHP(const std::vector< Scalar > &bhp_array, const std::vector< double > &thp_array, Scalar bhp, const bool find_largest=true)
This function finds the value of THP given a specific BHP.
Definition VFPHelpers.cpp:364
static std::optional< std::pair< Scalar, Scalar > > intersectWithIPR(const VFPProdTable &table, const Scalar thp, const Scalar wfr, const Scalar gfr, const Scalar alq, const Scalar ipr_a, const Scalar ipr_b, const std::function< Scalar(const Scalar)> &adjust_bhp)
Get (flo, bhp) at largest occuring stable vfp/ipr-intersection if it exists.
Definition VFPHelpers.cpp:544
static detail::InterpData< Scalar > findInterpData(const Scalar value_in, const std::vector< double > &values)
Helper function to find indices etc.
Definition VFPHelpers.cpp:83
static detail::VFPEvaluation< Scalar > interpolate(const VFPProdTable &table, const detail::InterpData< Scalar > &flo_i, const detail::InterpData< Scalar > &thp_i, const detail::InterpData< Scalar > &wfr_i, const detail::InterpData< Scalar > &gfr_i, const detail::InterpData< Scalar > &alq_i)
Helper function which interpolates data using the indices etc.
Definition VFPHelpers.cpp:145
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
Helper struct for linear interpolation.
Definition VFPHelpers.hpp:66
An "ADB-like" structure with a single value and a set of derivatives.
Definition VFPHelpers.hpp:44