20#ifndef OPM_AUTODIFF_VFPPROPERTIES_HPP_
21#define OPM_AUTODIFF_VFPPROPERTIES_HPP_
23#include <opm/simulators/wells/VFPInjProperties.hpp>
24#include <opm/simulators/wells/VFPProdProperties.hpp>
25#include <opm/simulators/wells/WellState.hpp>
26#include <opm/simulators/wells/VFPHelpers.hpp>
39template<
typename Scalar,
typename IndexTraits>
51 const std::vector<std::reference_wrapper<const VFPProdTable>>&
prod_tables,
53 : well_state_(well_state)
56 this->m_inj.addTable(
vfpinj );
59 this->m_prod.addTable(
vfpprod );
78 Scalar getExplicitWFR(
const int table_id,
const std::size_t well_index)
const
80 const auto& pu = well_state_.phaseUsageInfo();
81 const bool has_water = pu.phaseIsActive(IndexTraits::waterPhaseIdx);
82 const bool has_oil = pu.phaseIsActive(IndexTraits::oilPhaseIdx);
83 const bool has_gas = pu.phaseIsActive(IndexTraits::gasPhaseIdx);
84 const auto& rates = well_state_.well(well_index).prev_surface_rates;
85 const auto&
aqua =
has_water ? rates[pu.canonicalToActivePhaseIdx(IndexTraits::waterPhaseIdx)] : 0.0;
86 const auto& liquid =
has_oil ? rates[pu.canonicalToActivePhaseIdx(IndexTraits::oilPhaseIdx)] : 0.0;
87 const auto&
vapour =
has_gas ? rates[pu.canonicalToActivePhaseIdx(IndexTraits::gasPhaseIdx)] : 0.0;
92 Scalar getExplicitGFR(
const int table_id,
const std::size_t well_index)
const
94 const auto& pu = well_state_.phaseUsageInfo();
95 const auto& rates = well_state_.well(well_index).prev_surface_rates;
96 const bool has_water = pu.phaseIsActive(IndexTraits::waterPhaseIdx);
97 const bool has_oil = pu.phaseIsActive(IndexTraits::oilPhaseIdx);
98 const bool has_gas = pu.phaseIsActive(IndexTraits::gasPhaseIdx);
99 const auto&
aqua =
has_water ? rates[pu.canonicalToActivePhaseIdx(IndexTraits::waterPhaseIdx)] : 0.0;
100 const auto& liquid =
has_oil ? rates[pu.canonicalToActivePhaseIdx(IndexTraits::oilPhaseIdx)] : 0.0;
101 const auto&
vapour =
has_gas ? rates[pu.canonicalToActivePhaseIdx(IndexTraits::gasPhaseIdx)] : 0.0;
Definition VFPInjProperties.hpp:34
Class which linearly interpolates BHP as a function of rate, tubing head pressure,...
Definition VFPProdProperties.hpp:38
A thin wrapper class that holds one VFPProdProperties and one VFPInjProperties object.
Definition VFPProperties.hpp:40
const VFPInjProperties< Scalar > * getInj() const
Returns the VFP properties for injection wells.
Definition VFPProperties.hpp:65
VFPProperties(const std::vector< std::reference_wrapper< const VFPInjTable > > &inj_tables, const std::vector< std::reference_wrapper< const VFPProdTable > > &prod_tables, const WellState< Scalar, IndexTraits > &well_state)
Constructor Takes no ownership of data.
Definition VFPProperties.hpp:50
const VFPProdProperties< Scalar > * getProd() const
Returns the VFP properties for production wells.
Definition VFPProperties.hpp:73
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:66
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240