diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index f58fcd50e..2a903ffb7 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -268,6 +268,7 @@ namespace Opm { bool forceShutWellByNameIfPredictionMode(const std::string& wellname, const double simulation_time); double wellPI(int well_index) const; + bool hasWell(const std::string& wname); protected: Simulator& ebosSimulator_; diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 12b98d9b3..bb7b0f069 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -1726,6 +1726,15 @@ namespace Opm { } + template + bool + BlackoilWellModel:: + hasWell(const std::string& wname) { + auto iter = std::find_if( this->wells_ecl_.begin(), this->wells_ecl_.end(), [&wname](const Well& well) { return well.name() == wname; }); + return (iter != this->wells_ecl_.end()); + } + + // convert well data from opm-common to well state from opm-core template void