20 #ifndef GUIDE_RATE_HPP
21 #define GUIDE_RATE_HPP
23 #include <opm/input/eclipse/Schedule/Group/Group.hpp>
24 #include <opm/input/eclipse/Schedule/Group/GuideRateModel.hpp>
25 #include <opm/input/eclipse/Schedule/Well/Well.hpp>
32 #include <unordered_map>
49 RateVector(
const double orat,
const double grat,
const double wrat)
55 double eval(
const Well::GuideRateTarget target)
const;
56 double eval(
const Group::GuideRateProdTarget target)
const;
57 double eval(
const GuideRateModel::Target target)
const;
66 GuideRateValue(
const double t,
const double v,
const GuideRateModel::Target tg)
74 return (this->sim_time == other.sim_time)
75 && (this->value == other.value);
80 return !(*
this == other);
83 double sim_time { std::numeric_limits<double>::lowest() };
84 double value { std::numeric_limits<double>::lowest() };
85 GuideRateModel::Target target { GuideRateModel::Target::NONE };
90 void compute(
const std::string& wgname,
91 const std::size_t report_step,
92 const double sim_time,
95 const double wat_pot);
97 void compute(
const std::string& wgname,
99 const std::size_t report_step,
100 const double guide_rate);
102 bool has(
const std::string& name)
const;
103 bool hasPotentials(
const std::string& name)
const;
104 bool has(
const std::string& name,
const Phase& phase)
const;
106 double get(
const std::string& well,
const Well::GuideRateTarget target,
const RateVector& rates)
const;
107 double get(
const std::string& group,
const Group::GuideRateProdTarget target,
const RateVector& rates)
const;
108 double get(
const std::string& name,
const GuideRateModel::Target model_target,
const RateVector& rates)
const;
109 double get(
const std::string& group,
const Phase& phase)
const;
111 double getSI(
const std::string& well,
const Well::GuideRateTarget target,
const RateVector& rates)
const;
112 double getSI(
const std::string& group,
const Group::GuideRateProdTarget target,
const RateVector& rates)
const;
113 double getSI(
const std::string& wgname,
const GuideRateModel::Target target,
const RateVector& rates)
const;
114 double getSI(
const std::string& group,
const Phase& phase)
const;
116 void init_grvalue(
const std::size_t report_step,
const std::string& wgname,
GuideRateValue value);
117 void init_grvalue_SI(
const std::size_t report_step,
const std::string& wgname,
GuideRateValue value);
119 void updateGuideRateExpiration(
const double sim_time,
120 const std::size_t report_step);
126 GuideRateValue prev{};
131 template <
class T1,
class T2>
132 std::size_t operator()(
const std::pair<T1, T2>& pair)
const
134 return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
138 using GRValPtr = std::unique_ptr<GRValState>;
139 using pair = std::pair<Phase, std::string>;
141 void well_compute(
const std::string& wgname,
142 const std::size_t report_step,
143 const double sim_time,
144 const double oil_pot,
145 const double gas_pot,
146 const double wat_pot);
148 void group_compute(
const std::string& wgname,
149 const std::size_t report_step,
150 const double sim_time,
151 const double oil_pot,
152 const double gas_pot,
153 const double wat_pot);
155 double eval_form(
const GuideRateModel& model,
156 const double oil_pot,
157 const double gas_pot,
158 const double wat_pot)
const;
159 double eval_group_pot()
const;
160 double eval_group_resvinj()
const;
162 void assign_grvalue(
const std::string& wgname,
163 const GuideRateModel& model,
164 GuideRateValue&& value);
165 double get_grvalue_result(
const GRValState& gr)
const;
167 const Schedule& schedule;
169 std::unordered_map<std::string, GRValPtr> values{};
170 std::unordered_map<pair, double, pair_hash> injection_group_values{};
171 std::unordered_map<std::string, RateVector> potentials{};
172 bool guide_rates_expired {
false};
Definition: GuideRate.hpp:44
Definition: Schedule.hpp:138
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: GuideRate.hpp:64
Definition: GuideRate.hpp:47