Merge pull request #2078 from joakim-hove/gliftopt-has
Add methods GasLiftOpt::has_well() and GasLiftOpt::has_group()
This commit is contained in:
@@ -225,6 +225,8 @@ public:
|
|||||||
void add_group(const Group& group);
|
void add_group(const Group& group);
|
||||||
void add_well(const Well& well);
|
void add_well(const Well& well);
|
||||||
bool active() const;
|
bool active() const;
|
||||||
|
bool has_well(const std::string& well) const;
|
||||||
|
bool has_group(const std::string& group) const;
|
||||||
|
|
||||||
static GasLiftOpt serializeObject();
|
static GasLiftOpt serializeObject();
|
||||||
bool operator==(const GasLiftOpt& other) const;
|
bool operator==(const GasLiftOpt& other) const;
|
||||||
|
|||||||
@@ -63,6 +63,16 @@ const GasLiftOpt::Group& GasLiftOpt::group(const std::string& gname) const {
|
|||||||
return iter->second;
|
return iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GasLiftOpt::has_well(const std::string& wname) const {
|
||||||
|
const auto iter = this->m_wells.find(wname);
|
||||||
|
return (iter != this->m_wells.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GasLiftOpt::has_group(const std::string& gname) const {
|
||||||
|
const auto iter = this->m_groups.find(gname);
|
||||||
|
return (iter != this->m_groups.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GasLiftOpt::add_group(const Group& group) {
|
void GasLiftOpt::add_group(const Group& group) {
|
||||||
auto iter = this->m_groups.find(group.name());
|
auto iter = this->m_groups.find(group.name());
|
||||||
|
|||||||
@@ -3753,6 +3753,8 @@ WLIFTOPT
|
|||||||
const auto& plat_group = glo.group("PLAT-A");
|
const auto& plat_group = glo.group("PLAT-A");
|
||||||
BOOST_CHECK_EQUAL( *plat_group.max_lift_gas(), siFactorG * 200000);
|
BOOST_CHECK_EQUAL( *plat_group.max_lift_gas(), siFactorG * 200000);
|
||||||
BOOST_CHECK(!plat_group.max_total_gas().has_value());
|
BOOST_CHECK(!plat_group.max_total_gas().has_value());
|
||||||
|
BOOST_CHECK(glo.has_group("PLAT-A"));
|
||||||
|
BOOST_CHECK(!glo.has_well("NO-GROUP"));
|
||||||
|
|
||||||
|
|
||||||
const auto& w1 = glo.well("B-1H");
|
const auto& w1 = glo.well("B-1H");
|
||||||
@@ -3770,6 +3772,8 @@ WLIFTOPT
|
|||||||
BOOST_CHECK_EQUAL(w3.min_rate(), -1.00 * siFactorG);
|
BOOST_CHECK_EQUAL(w3.min_rate(), -1.00 * siFactorG);
|
||||||
BOOST_CHECK_EQUAL(w3.inc_weight_factor(), 1.00);
|
BOOST_CHECK_EQUAL(w3.inc_weight_factor(), 1.00);
|
||||||
BOOST_CHECK(w3.alloc_extra_gas());
|
BOOST_CHECK(w3.alloc_extra_gas());
|
||||||
|
BOOST_CHECK(glo.has_well("C-1H"));
|
||||||
|
BOOST_CHECK(!glo.has_well("NO-WELL"));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(WellPI) {
|
BOOST_AUTO_TEST_CASE(WellPI) {
|
||||||
|
|||||||
Reference in New Issue
Block a user