81 RestartWell(
const std::string& wname,
double ti,
int num,
double st,
int r1,
int r2)
98 std::optional<int> wtest_report_step;
101 WTestWell(
const std::string& wname, WTest::Reason reason_,
double last_test);
103 int int_reason()
const;
104 static WTest::Reason inverse_ecl_reason(
int ecl_reason);
106 bool operator==(
const WTestWell& other)
const {
107 return this->name == other.name &&
108 this->reason == other.reason &&
109 this->last_test == other.last_test &&
110 this->num_attempt == other.num_attempt &&
111 this->closed == other.closed &&
112 this->wtest_report_step == other.wtest_report_step;
115 static WTestWell serializationTestObject();
117 template<
class Serializer>
120 serializer(this->name);
121 serializer(this->reason);
122 serializer(this->last_test);
123 serializer(this->num_attempt);
124 serializer(this->closed);
125 serializer(this->wtest_report_step);
128 template<
class BufferType>
129 void pack(BufferType& buffer)
const {
130 buffer.write(this->name);
131 buffer.write(this->reason);
132 buffer.write(this->last_test);
133 buffer.write(this->num_attempt);
134 buffer.write(this->closed);
135 buffer.write(this->wtest_report_step);
138 template<
class BufferType>
139 void unpack(BufferType& buffer) {
140 buffer.read(this->name);
141 buffer.read(this->reason);
142 buffer.read(this->last_test);
143 buffer.read(this->num_attempt);
144 buffer.read(this->closed);
145 buffer.read(this->wtest_report_step);
151 std::string wellName;
157 return this->wellName == other.wellName &&
158 this->complnum == other.complnum &&
159 this->last_test == other.last_test &&
160 this->num_attempt == other.num_attempt;
165 template<
class Serializer>
168 serializer(this->wellName);
169 serializer(this->complnum);
170 serializer(this->last_test);
171 serializer(this->num_attempt);
174 template<
class BufferType>
175 void pack(BufferType& buffer)
const {
176 buffer.write(this->wellName);
177 buffer.write(this->complnum);
178 buffer.write(this->last_test);
179 buffer.write(this->num_attempt);
182 template<
class BufferType>
183 void unpack(BufferType& buffer) {
184 buffer.read(this->wellName);
185 buffer.read(this->complnum);
186 buffer.read(this->last_test);
187 buffer.read(this->num_attempt);
195 std::vector<std::string> test_wells(
const WellTestConfig& config,
double sim_time);
196 void filter_wells(
const std::vector<std::string>& existing_wells);
213 void close_well(
const std::string& well_name, WTest::Reason reason,
double sim_time);
214 bool well_is_closed(
const std::string& well_name)
const;
215 void open_well(
const std::string& well_name);
216 std::size_t num_closed_wells()
const;
217 double lastTestTime(
const std::string& well_name)
const;
219 void close_completion(
const std::string& well_name,
int complnum,
double sim_time);
220 void open_completion(
const std::string& well_name,
int complnum);
221 void open_completions(
const std::string& well_name);
222 bool completion_is_closed(
const std::string& well_name,
const int complnum)
const;
223 std::size_t num_closed_completions()
const;
228 template<
class BufferType>
229 void pack(BufferType& buffer)
const {
230 pack_map(buffer, this->wells);
232 buffer.write(this->completions.size());
233 for (
const auto& [well, cmap] : this->completions) {
235 pack_map(buffer, cmap);
239 template<
class BufferType>
240 void unpack(BufferType& buffer) {
241 unpack_map(buffer, this->wells);
244 for (std::size_t i = 0; i < size; i++) {
246 std::unordered_map<int, ClosedCompletion> cmap;
249 unpack_map(buffer, cmap);
250 this->completions.emplace(std::move(well), std::move(cmap));
254 template<
class Serializer>
255 void serializeOp(Serializer& serializer)
257 serializer(this->wells);
258 if (serializer.isSerializing()) {
259 std::size_t size = this->completions.size();
261 for (
auto& [well, comp_map] : this->completions) {
263 serializer(comp_map);
266 std::size_t size = 0;
268 for (std::size_t i=0; i < size; i++) {
270 std::unordered_map<int, ClosedCompletion> comp_map;
273 serializer(comp_map);
274 this->completions.emplace(well, std::move(comp_map));
280 static WellTestState serializationTestObject();
281 bool operator==(
const WellTestState& other)
const;
283 std::optional<WellTestState::RestartWell> restart_well(
const Opm::WellTestConfig& config,
const std::string& wname)
const;
286 std::unordered_map<std::string, WTestWell> wells;
287 std::unordered_map<std::string, std::unordered_map<int, ClosedCompletion>> completions;
289 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