Well testing: only count actually closed wells. Change in opm-common

This commit is contained in:
Joakim Hove
2021-10-06 14:00:23 +02:00
parent eb2ca4798c
commit 4816762b66

View File

@@ -256,7 +256,7 @@ namespace Opm
// individually. We first open all completions, then we close one by one by calling updateWellTestState // individually. We first open all completions, then we close one by one by calling updateWellTestState
// untill the number of closed completions do not increase anymore. // untill the number of closed completions do not increase anymore.
while (testWell) { while (testWell) {
const size_t original_number_closed_completions = welltest_state_temp.sizeCompletions(); const size_t original_number_closed_completions = welltest_state_temp.num_closed_completions();
bool converged = solveWellForTesting(simulator, well_state_copy, group_state, deferred_logger); bool converged = solveWellForTesting(simulator, well_state_copy, group_state, deferred_logger);
if (!converged) { if (!converged) {
const auto msg = fmt::format("WTEST: Well {} is not solvable (physical)", this->name()); const auto msg = fmt::format("WTEST: Well {} is not solvable (physical)", this->name());
@@ -290,8 +290,8 @@ namespace Opm
// Also check if number of completions has increased. If the number of closed completions do not increased // Also check if number of completions has increased. If the number of closed completions do not increased
// we stop the testing. // we stop the testing.
// TODO: it can be tricky here, if the well is shut/closed due to other reasons // TODO: it can be tricky here, if the well is shut/closed due to other reasons
if ( welltest_state_temp.sizeWells() > 0 || if ( welltest_state_temp.num_closed_wells() > 0 ||
(original_number_closed_completions == welltest_state_temp.sizeCompletions()) ) { (original_number_closed_completions == welltest_state_temp.num_closed_completions()) ) {
testWell = false; // this terminates the while loop testWell = false; // this terminates the while loop
} }
} }