86 RestartWell(
const std::string& wname,
double ti,
int num,
double st,
int r1,
int r2)
98 WTest::Reason reason{WTest::Reason::NONE};
103 std::optional<int> wtest_report_step{};
106 WTestWell(
const std::string& wname, WTest::Reason reason_,
double last_test);
108 int int_reason()
const;
109 static WTest::Reason inverse_ecl_reason(
int ecl_reason);
111 bool operator==(
const WTestWell& other)
const {
112 return this->name == other.name &&
113 this->reason == other.reason &&
114 this->last_test == other.last_test &&
115 this->num_attempt == other.num_attempt &&
116 this->closed == other.closed &&
117 this->wtest_report_step == other.wtest_report_step;
120 static WTestWell serializationTestObject();
122 template<
class Serializer>
125 serializer(this->name);
126 serializer(this->reason);
127 serializer(this->last_test);
128 serializer(this->num_attempt);
129 serializer(this->closed);
130 serializer(this->wtest_report_step);
133 template<
class BufferType>
134 void pack(BufferType& buffer)
const {
135 buffer.write(this->name);
136 buffer.write(this->reason);
137 buffer.write(this->last_test);
138 buffer.write(this->num_attempt);
139 buffer.write(this->closed);
140 buffer.write(this->wtest_report_step);
143 template<
class BufferType>
144 void unpack(BufferType& buffer) {
145 buffer.read(this->name);
146 buffer.read(this->reason);
147 buffer.read(this->last_test);
148 buffer.read(this->num_attempt);
149 buffer.read(this->closed);
150 buffer.read(this->wtest_report_step);
156 std::string wellName{};
162 return this->wellName == other.wellName &&
163 this->complnum == other.complnum &&
164 this->last_test == other.last_test &&
165 this->num_attempt == other.num_attempt;
170 template<
class Serializer>
173 serializer(this->wellName);
174 serializer(this->complnum);
175 serializer(this->last_test);
176 serializer(this->num_attempt);
179 template<
class BufferType>
180 void pack(BufferType& buffer)
const {
181 buffer.write(this->wellName);
182 buffer.write(this->complnum);
183 buffer.write(this->last_test);
184 buffer.write(this->num_attempt);
187 template<
class BufferType>
188 void unpack(BufferType& buffer) {
189 buffer.read(this->wellName);
190 buffer.read(this->complnum);
191 buffer.read(this->last_test);
192 buffer.read(this->num_attempt);
200 std::vector<std::string> test_wells(
const WellTestConfig& config,
double sim_time);
201 void filter_wells(
const std::vector<std::string>& existing_wells);
218 void close_well(
const std::string& well_name, WTest::Reason reason,
double sim_time);
219 bool well_is_closed(
const std::string& well_name)
const;
220 void open_well(
const std::string& well_name);
221 std::size_t num_closed_wells()
const;
222 double lastTestTime(
const std::string& well_name)
const;
224 void close_completion(
const std::string& well_name,
int complnum,
double sim_time);
225 void open_completion(
const std::string& well_name,
int complnum);
226 void open_completions(
const std::string& well_name);
227 bool completion_is_closed(
const std::string& well_name,
const int complnum)
const;
228 std::size_t num_closed_completions()
const;
233 template<
class BufferType>
234 void pack(BufferType& buffer)
const {
235 pack_map(buffer, this->wells);
237 buffer.write(this->completions.size());
238 for (
const auto& [well, cmap] : this->completions) {
240 pack_map(buffer, cmap);
244 template<
class BufferType>
245 void unpack(BufferType& buffer) {
246 unpack_map(buffer, this->wells);
249 for (std::size_t i = 0; i < size; i++) {
251 std::unordered_map<int, ClosedCompletion> cmap;
254 unpack_map(buffer, cmap);
255 this->completions.emplace(std::move(well), std::move(cmap));
259 template<
class Serializer>
260 void serializeOp(Serializer& serializer)
262 serializer(this->wells);
263 if (serializer.isSerializing()) {
264 std::size_t size = this->completions.size();
266 for (
auto& [well, comp_map] : this->completions) {
268 serializer(comp_map);
271 std::size_t size = 0;
273 for (std::size_t i=0; i < size; i++) {
275 std::unordered_map<int, ClosedCompletion> comp_map;
278 serializer(comp_map);
279 this->completions.emplace(well, std::move(comp_map));
285 static WellTestState serializationTestObject();
286 bool operator==(
const WellTestState& other)
const;
288 std::optional<WellTestState::RestartWell> restart_well(
const Opm::WellTestConfig& config,
const std::string& wname)
const;
291 std::unordered_map<std::string, WTestWell> wells;
292 std::unordered_map<std::string, std::unordered_map<int, ClosedCompletion>> completions;
294 std::vector<std::pair<std::string, int>> updateCompletion(
const WellTestConfig& config,
double sim_time);
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30