add method that open all completions

This commit is contained in:
Tor Harald Sandve 2021-09-30 11:46:19 +02:00
parent 05bac5f59a
commit cc24920ff9
2 changed files with 8 additions and 0 deletions

View File

@ -113,6 +113,7 @@ public:
* it is used when WELOPEN or WCON* keyword request to open the well */
void openWell(const std::string& well_name);
void openAllCompletions(const std::string& well_name);
bool hasCompletion(const std::string& well_name, const int complnum) const;

View File

@ -66,6 +66,13 @@ namespace Opm {
well.closed = false;
}
void WellTestState::openAllCompletions(const std::string& well_name) {
completions.erase(std::remove_if(completions.begin(),
completions.end(),
[&well_name](const ClosedCompletion& completion) { return (completion.wellName == well_name); }),
completions.end());
}
bool WellTestState::hasWellClosed(const std::string& well_name) const {
for (const auto& well : wells)
if (well.name == well_name && well.closed)