Implement BlackoilWellModel::hasWell() method

This commit is contained in:
Joakim Hove 2021-02-12 11:26:14 +01:00
parent 591826ea4e
commit 99a61e120b
2 changed files with 10 additions and 0 deletions

View File

@ -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_;

View File

@ -1726,6 +1726,15 @@ namespace Opm {
}
template<typename TypeTag>
bool
BlackoilWellModel<TypeTag>::
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<typename TypeTag>
void