24#ifndef OPM_WELL_TEST_HEADER_INCLUDED
25#define OPM_WELL_TEST_HEADER_INCLUDED
27#include <opm/input/eclipse/Units/UnitSystem.hpp>
33#include <unordered_set>
40template<
typename Scalar,
typename IndexTraits>
class SingleWellState;
41class WellEconProductionLimits;
42template<
typename Scalar,
typename IndexTraits>
class WellInterfaceGeneric;
46template<
typename Scalar,
typename IndexTraits>
60 const double simulation_time,
61 const bool write_message_to_opmlog,
62 const bool during_well_test,
63 WellTestState& well_test_state,
64 bool zero_group_target,
65 const UnitSystem& unit_system,
66 const std::time_t start_time,
70 const bool write_message_to_opmlog,
71 WellTestState& well_test_state,
75 struct RatioLimitCheckReport {
76 static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
81 static constexpr Scalar INFINITE_RATIO = 1.0e30;
82 bool ratio_limit_violated =
false;
83 int worst_offending_completion = INVALIDCOMPLETION;
84 Scalar violation_extent = 0.0;
87 std::string ratio_name{};
88 UnitSystem::measure ratio_measure = UnitSystem::measure::identity;
89 Scalar ratio_value = 0.0;
90 Scalar ratio_limit = 0.0;
97 template<
class RatioFunc>
98 void checkMaxRatioLimit(
const SingleWellState<Scalar, IndexTraits>& ws,
99 const Scalar max_ratio_limit,
100 const RatioFunc& ratioFunc,
101 const std::unordered_set<int>& excluded_completions,
102 const std::string& ratio_name,
103 const UnitSystem::measure ratio_measure,
104 RatioLimitCheckReport& report)
const;
123 template<
class RatioFunc>
124 bool checkMaxRatioLimitWell(
const SingleWellState<Scalar, IndexTraits>& ws,
125 const Scalar max_ratio_limit,
126 const RatioFunc& ratioFunc,
127 const std::unordered_set<int>& excluded_completions,
128 Scalar& well_ratio_value)
const;
130 template<
class RatioFunc>
131 void checkMaxRatioLimitCompletions(
const SingleWellState<Scalar, IndexTraits>& ws,
132 const Scalar max_ratio_limit,
133 const Scalar well_ratio_value,
134 const RatioFunc& ratioFunc,
135 const std::unordered_set<int>& excluded_completions,
136 const std::string& ratio_name,
137 const UnitSystem::measure ratio_measure,
138 RatioLimitCheckReport& report)
const;
140 bool checkRateEconLimits(
const WellEconProductionLimits& econ_production_limits,
141 const std::vector<Scalar>& rates_or_potentials,
142 DeferredLogger& deferred_logger)
const;
146 RatioLimitCheckReport
147 checkRatioEconLimits(
const WellEconProductionLimits& econ_production_limits,
148 const SingleWellState<Scalar, IndexTraits>& ws,
149 const std::unordered_set<int>& excluded_completions,
150 DeferredLogger& deferred_logger)
const;
155 std::string completionDescriptor(
int complnum)
const;
164 bool closeOffendingCompletion(
int offending_completion,
165 bool close_connections_below,
166 double simulation_time,
167 bool write_message_to_opmlog,
168 WellTestState& well_test_state,
169 const std::string& when,
170 const std::string& reason,
171 std::unordered_set<int>& closed_this_event,
172 DeferredLogger& deferred_logger)
const;
174 const WellInterfaceGeneric<Scalar, IndexTraits>& well_;
Definition: DeferredLogger.hpp:57
Definition: SingleWellState.hpp:44
Definition: WellInterfaceGeneric.hpp:55
Class for performing well tests.
Definition: WellTest.hpp:47
void updateWellTestStateEconomic(const SingleWellState< Scalar, IndexTraits > &ws, const double simulation_time, const bool write_message_to_opmlog, const bool during_well_test, WellTestState &well_test_state, bool zero_group_target, const UnitSystem &unit_system, const std::time_t start_time, DeferredLogger &deferred_logger) const
WellTest(const WellInterfaceGeneric< Scalar, IndexTraits > &well)
Constructor sets reference to well.
Definition: WellTest.hpp:50
void updateWellTestStatePhysical(const double simulation_time, const bool write_message_to_opmlog, WellTestState &well_test_state, DeferredLogger &deferred_logger) const
Definition: blackoilbioeffectsmodules.hh:45