49 RateVector(
const double orat,
const double grat,
const double wrat)
60 double eval(
const WellGuideRateTarget target)
const;
61 double eval(
const Group::GuideRateProdTarget target)
const;
62 double eval(
const GuideRateModel::Target target)
const;
64 template<
class Serializer>
79 GuideRateValue(
const double t,
const double v,
const GuideRateModel::Target tg)
92 return (this->sim_time == other.sim_time)
93 && (this->value == other.value);
98 return !(*
this == other);
101 template<
class Serializer>
104 serializer(sim_time);
109 double sim_time { std::numeric_limits<double>::lowest() };
110 double value { std::numeric_limits<double>::lowest() };
111 GuideRateModel::Target target { GuideRateModel::Target::NONE };
116 void setSerializationTestData();
118 void compute(
const std::string& wgname,
119 const std::size_t report_step,
120 const double sim_time,
121 const double oil_pot,
122 const double gas_pot,
123 const double wat_pot);
125 void compute(
const std::string& wgname,
127 const std::size_t report_step,
128 const double guide_rate);
130 bool has(
const std::string& name)
const;
131 bool hasPotentials(
const std::string& name)
const;
132 bool has(
const std::string& name,
const Phase& phase)
const;
134 double get(
const std::string& well,
const WellGuideRateTarget target,
const RateVector& rates)
const;
135 double get(
const std::string& group,
const Group::GuideRateProdTarget target,
const RateVector& rates)
const;
136 double get(
const std::string& name,
const GuideRateModel::Target model_target,
const RateVector& rates)
const;
137 double get(
const std::string& group,
const Phase& phase)
const;
139 double getSI(
const std::string& well,
const WellGuideRateTarget target,
const RateVector& rates)
const;
140 double getSI(
const std::string& group,
const Group::GuideRateProdTarget target,
const RateVector& rates)
const;
141 double getSI(
const std::string& wgname,
const GuideRateModel::Target target,
const RateVector& rates)
const;
142 double getSI(
const std::string& group,
const Phase& phase)
const;
144 void init_grvalue(
const std::size_t report_step,
const std::string& wgname,
GuideRateValue value);
145 void init_grvalue_SI(
const std::size_t report_step,
const std::string& wgname,
GuideRateValue value);
147 void updateGuideRateExpiration(
const double sim_time,
148 const std::size_t report_step);
150 template<
class Serializer>
154 serializer(values.size());
155 for (
const auto& [key, value] : values) {
160 std::size_t size = 0;
162 for (
size_t i = 0; i < size; ++i) {
165 auto val = values.emplace(key, std::make_unique<GRValState>());
166 if (val.first != values.end())
167 serializer(*val.first->second);
170 serializer(injection_group_values);
171 serializer(potentials);
172 serializer(guide_rates_expired);
178 GuideRateValue curr{};
179 GuideRateValue prev{};
181 static GRValState serializationTestObject()
183 return GRValState{GuideRateValue::serializationTestObject(),
184 GuideRateValue::serializationTestObject()};
187 template<
class Serializer>
188 void serializeOp(Serializer& serializer)
197 template <
class T1,
class T2>
198 std::size_t operator()(
const std::pair<T1, T2>& pair)
const
200 return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
204 using GRValPtr = std::unique_ptr<GRValState>;
205 using pair = std::pair<Phase, std::string>;
207 void well_compute(
const std::string& wgname,
208 const std::size_t report_step,
209 const double sim_time,
210 const double oil_pot,
211 const double gas_pot,
212 const double wat_pot);
214 void group_compute(
const std::string& wgname,
215 const std::size_t report_step,
216 const double sim_time,
217 const double oil_pot,
218 const double gas_pot,
219 const double wat_pot);
221 double eval_form(
const GuideRateModel& model,
222 const double oil_pot,
223 const double gas_pot,
224 const double wat_pot)
const;
225 double eval_group_pot()
const;
226 double eval_group_resvinj()
const;
228 void assign_grvalue(
const std::string& wgname,
229 const GuideRateModel& model,
230 GuideRateValue&& value);
231 double get_grvalue_result(
const GRValState& gr)
const;
233 const Schedule& schedule;
235 std::unordered_map<std::string, GRValPtr> values{};
236 std::unordered_map<pair, double, pair_hash> injection_group_values{};
237 std::unordered_map<std::string, RateVector> potentials{};
238 bool guide_rates_expired {
false};
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30