20 #ifndef GUIDE_RATE_HPP
21 #define GUIDE_RATE_HPP
23 #include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
24 #include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp>
25 #include <opm/parser/eclipse/EclipseState/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 has(
const std::string& name,
const Phase& phase)
const;
105 double get(
const std::string& well,
const Well::GuideRateTarget target,
const RateVector& rates)
const;
106 double get(
const std::string& group,
const Group::GuideRateProdTarget target,
const RateVector& rates)
const;
107 double get(
const std::string& name,
const GuideRateModel::Target model_target,
const RateVector& rates)
const;
108 double get(
const std::string& group,
const Phase& phase)
const;
110 double getSI(
const std::string& well,
const Well::GuideRateTarget target,
const RateVector& rates)
const;
111 double getSI(
const std::string& group,
const Group::GuideRateProdTarget target,
const RateVector& rates)
const;
112 double getSI(
const std::string& wgname,
const GuideRateModel::Target target,
const RateVector& rates)
const;
113 double getSI(
const std::string& group,
const Phase& phase)
const;
115 void init_grvalue(
const std::size_t report_step,
const std::string& wgname,
GuideRateValue value);
116 void init_grvalue_SI(
const std::size_t report_step,
const std::string& wgname,
GuideRateValue value);
118 void updateGuideRateExpiration(
const double sim_time,
119 const std::size_t report_step);
125 GuideRateValue prev{};
130 template <
class T1,
class T2>
131 std::size_t operator()(
const std::pair<T1, T2>& pair)
const
133 return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
137 using GRValPtr = std::unique_ptr<GRValState>;
138 using pair = std::pair<Phase, std::string>;
140 void well_compute(
const std::string& wgname,
141 const std::size_t report_step,
142 const double sim_time,
143 const double oil_pot,
144 const double gas_pot,
145 const double wat_pot);
147 void group_compute(
const std::string& wgname,
148 const std::size_t report_step,
149 const double sim_time,
150 const double oil_pot,
151 const double gas_pot,
152 const double wat_pot);
154 double eval_form(
const GuideRateModel& model,
155 const double oil_pot,
156 const double gas_pot,
157 const double wat_pot)
const;
158 double eval_group_pot()
const;
159 double eval_group_resvinj()
const;
161 void assign_grvalue(
const std::string& wgname,
162 const GuideRateModel& model,
163 GuideRateValue&& value);
164 double get_grvalue_result(
const GRValState& gr)
const;
166 const Schedule& schedule;
168 std::unordered_map<std::string, GRValPtr> values{};
169 std::unordered_map<pair, double, pair_hash> injection_group_values{};
170 std::unordered_map<std::string, RateVector> potentials{};
171 bool guide_rates_expired {
false};
Definition: GuideRate.hpp:44
Definition: Schedule.hpp:135
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