24#ifndef OPM_WELL_BPH_THP_CALCULATOR_HEADER_INCLUDED
25#define OPM_WELL_BPH_THP_CALCULATOR_HEADER_INCLUDED
38class WellInterfaceGeneric;
67 const double maxPerfPress,
87 const std::array<unsigned,3>&
active,
91 template<
class EvalWell>
92 EvalWell calculateBhpFromThp(
const WellState& well_state,
93 const std::vector<EvalWell>& rates,
101 template<
class ErrorPolicy>
102 std::optional<double>
103 computeBhpAtThpLimitInjImpl(
const std::function<std::vector<double>(
const double)>&
frates,
111 std::optional<double>
112 bhpMax(
const std::function<
double(
const double)>&
fflo,
114 const double maxPerfPress,
119 std::optional<double>
120 computeBhpAtThpLimit(
const std::function<std::vector<double>(
const double)>&
frates,
121 const std::function<
double(
const std::vector<double>)>&
fbhp,
122 const std::array<double, 2>&
range,
126 bool bisectBracket(
const std::function<
double(
const double)>&
eq,
127 const std::array<double, 2>&
range,
133 static bool bruteForceBracket(
const std::function<
double(
const double)>&
eq,
134 const std::array<double, 2>&
range,
Definition AquiferInterface.hpp:35
Definition DeferredLogger.hpp:57
Class for computing BHP limits.
Definition WellBhpThpCalculator.hpp:42
void updateThp(const double rho, const bool stop_or_zero_rate_target, const std::function< double()> &alq_value, const std::array< unsigned, 3 > &active, WellState &well_state, DeferredLogger &deferred_logger) const
Update THP.
Definition WellBhpThpCalculator.cpp:226
std::optional< double > computeBhpAtThpLimitProd(const std::function< std::vector< double >(const double)> &frates, const SummaryState &summary_state, const double maxPerfPress, const double rho, const double alq_value, const double thp_limit, DeferredLogger &deferred_logger) const
Compute BHP from THP limit for a producer.
Definition WellBhpThpCalculator.cpp:142
double mostStrictBhpFromBhpLimits(const SummaryState &summaryState) const
Obtain the most strict BHP from BHP limits.
Definition WellBhpThpCalculator.cpp:85
bool wellHasTHPConstraints(const SummaryState &summaryState) const
Checks if well has THP constraints.
Definition WellBhpThpCalculator.cpp:51
double calculateThpFromBhp(const std::vector< double > &rates, const double bhp, const double rho, const double alq, DeferredLogger &deferred_logger) const
Calculates THP from BHP.
Definition WellBhpThpCalculator.cpp:101
double getTHPConstraint(const SummaryState &summaryState) const
Get THP constraint for well.
Definition WellBhpThpCalculator.cpp:69
std::optional< double > computeBhpAtThpLimitInj(const std::function< std::vector< double >(const double)> &frates, const SummaryState &summary_state, const double rho, const double flo_rel_tol, const int max_iteration, const bool throwOnError, DeferredLogger &deferred_logger) const
Compute BHP from THP limit for an injector.
Definition WellBhpThpCalculator.cpp:207
WellBhpThpCalculator(const WellInterfaceGeneric &well)
Constructor sets reference to well.
Definition WellBhpThpCalculator.hpp:45
Definition WellInterfaceGeneric.hpp:51
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:60
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27