Merge pull request #1659 from joakim-hove/rst-well-shut2

Rst well shut2
This commit is contained in:
Bård Skaflestad
2020-04-01 12:32:54 +02:00
committed by GitHub
4 changed files with 116 additions and 86 deletions

View File

@@ -72,7 +72,7 @@ RstWell::RstWell(const ::Opm::UnitSystem& unit_system,
grat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::GasRateTarget]))),
lrat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::LiqRateTarget]))),
resv_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::ResVRateTarget]))),
thp_target( unit_system.to_si(M::identity, swel[VI::SWell::THPTarget])),
thp_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::THPTarget]))),
bhp_target_float( unit_system.to_si(M::identity, swel[VI::SWell::BHPTarget])),
hist_lrat_target( unit_system.to_si(M::liquid_surface_rate, swel[VI::SWell::HistLiqRateTarget])),
hist_grat_target( unit_system.to_si(M::gas_surface_rate, swel[VI::SWell::HistGasRateTarget])),

View File

@@ -179,36 +179,44 @@ Well::Well(const RestartIO::RstWell& rst_well,
if (rst_well.resv_target != 0)
p->addProductionControl( Well::ProducerCMode::RESV );
switch (rst_well.active_control) {
case 1:
p->controlMode = Well::ProducerCMode::ORAT;
break;
case 2:
p->controlMode = Well::ProducerCMode::WRAT;
p->addProductionControl( Well::ProducerCMode::WRAT );
break;
case 3:
p->controlMode = Well::ProducerCMode::GRAT;
p->addProductionControl( Well::ProducerCMode::GRAT );
break;
case 4:
p->controlMode = Well::ProducerCMode::LRAT;
p->addProductionControl( Well::ProducerCMode::LRAT );
break;
case 5:
p->controlMode = Well::ProducerCMode::RESV;
p->addProductionControl( Well::ProducerCMode::RESV );
break;
case 6:
p->controlMode = Well::ProducerCMode::THP;
if (rst_well.thp_target != 0) {
p->THPTarget = rst_well.thp_target;
p->addProductionControl( Well::ProducerCMode::THP );
break;
case 7:
p->controlMode = Well::ProducerCMode::BHP;
p->addProductionControl( Well::ProducerCMode::BHP );
break;
default:
throw std::invalid_argument("Can convert integer value: " + std::to_string(rst_well.active_control) + " to control type");
}
if (this->status == Well::Status::OPEN) {
switch (rst_well.active_control) {
case 1:
p->controlMode = Well::ProducerCMode::ORAT;
break;
case 2:
p->controlMode = Well::ProducerCMode::WRAT;
p->addProductionControl(Well::ProducerCMode::WRAT);
break;
case 3:
p->controlMode = Well::ProducerCMode::GRAT;
p->addProductionControl(Well::ProducerCMode::GRAT);
break;
case 4:
p->controlMode = Well::ProducerCMode::LRAT;
p->addProductionControl(Well::ProducerCMode::LRAT);
break;
case 5:
p->controlMode = Well::ProducerCMode::RESV;
p->addProductionControl(Well::ProducerCMode::RESV);
break;
case 6:
p->controlMode = Well::ProducerCMode::THP;
p->addProductionControl(Well::ProducerCMode::THP);
break;
case 7:
p->controlMode = Well::ProducerCMode::BHP;
p->addProductionControl(Well::ProducerCMode::BHP);
break;
default:
throw std::invalid_argument("Can not convert integer value: " + std::to_string(rst_well.active_control)
+ " to control type");
}
}
p->addProductionControl(Well::ProducerCMode::BHP);
@@ -219,30 +227,33 @@ Well::Well(const RestartIO::RstWell& rst_well,
auto i = std::make_shared<WellInjectionProperties>(this->unit_system, wname);
// Reverse of function ctrlMode() in AggregateWellData.cpp
switch (rst_well.active_control) {
case 1:
case 2:
case 3:
case 4:
i->controlMode = Well::InjectorCMode::RATE;
i->addInjectionControl(Well::InjectorCMode::RATE);
break;
case 5:
i->controlMode = Well::InjectorCMode::RESV;
i->addInjectionControl(Well::InjectorCMode::RESV);
break;
case 6:
i->controlMode = Well::InjectorCMode::THP;
i->addInjectionControl(Well::InjectorCMode::THP);
break;
case 7:
i->controlMode = Well::InjectorCMode::BHP;
break;
case -1:
i->controlMode = Well::InjectorCMode::GRUP;
break;
default:
throw std::invalid_argument("Could not convert integer value: " + std::to_string(rst_well.active_control) + " to control type");
if (this->status == Well::Status::OPEN) {
switch (rst_well.active_control) {
case 1:
case 2:
case 3:
case 4:
i->controlMode = Well::InjectorCMode::RATE;
i->addInjectionControl(Well::InjectorCMode::RATE);
break;
case 5:
i->controlMode = Well::InjectorCMode::RESV;
i->addInjectionControl(Well::InjectorCMode::RESV);
break;
case 6:
i->controlMode = Well::InjectorCMode::THP;
i->addInjectionControl(Well::InjectorCMode::THP);
break;
case 7:
i->controlMode = Well::InjectorCMode::BHP;
break;
case -1:
i->controlMode = Well::InjectorCMode::GRUP;
break;
default:
throw std::invalid_argument(
"Could not convert integer value: " + std::to_string(rst_well.active_control) + " to control type");
}
}
i->injectorType = rst_well.wtype.injector_type();
@@ -271,7 +282,7 @@ Well::Well(const RestartIO::RstWell& rst_well,
if (this->isAvailableForGroupControl())
i->addInjectionControl(Well::InjectorCMode::GRUP);
if (std::abs(rst_well.thp_target) < 1.0e+20f) {
if (rst_well.thp_target != 0) {
i->THPTarget = rst_well.thp_target;
i->addInjectionControl(Well::InjectorCMode::THP);
}
@@ -1373,9 +1384,11 @@ int Opm::eclipseControlMode(const Opm::Well::InjectorCMode imode,
{
using IMode = ::Opm::Well::InjectorCMode;
using Val = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellCtrlMode;
using IType = ::Opm::InjectorType;
if (wellStatus == ::Opm::Well::Status::SHUT) {
return Val::Shut;
}
switch (imode) {
case IMode::RATE: {
switch (itype) {
@@ -1406,6 +1419,9 @@ int Opm::eclipseControlMode(const Opm::Well::ProducerCMode pmode,
using PMode = ::Opm::Well::ProducerCMode;
using Val = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellCtrlMode;
if (wellStatus == ::Opm::Well::Status::SHUT) {
return Val::Shut;
}
switch (pmode) {
case PMode::ORAT: return Val::OilRate;
case PMode::WRAT: return Val::WatRate;
@@ -1426,6 +1442,19 @@ int Opm::eclipseControlMode(const Opm::Well::ProducerCMode pmode,
return Val::WMCtlUnk;
}
/*
The purpose of this function is to convert OPM well status to an integer value
suitable for output in the eclipse restart file. In OPM we have different
variables for the wells status and the active control, when this is written to
a restart file they are combined to one integer. In OPM a well can have an
active control while still being shut, when this is converted to an integer
value suitable for the eclipse formatted restart file the value 0 will be used
to signal a SHUT well and the active control will be lost.
In the case of a well which is in state 'STOP' or 'AUTO' an integer
corresponding to the currently active control is writte to the restart file.
*/
int Opm::eclipseControlMode(const Well& well,
const SummaryState& st)
{

View File

@@ -53,13 +53,14 @@ namespace {
struct test_data {
Deck deck;
EclipseState state;
std::shared_ptr<Python> python;
Schedule schedule;
SummaryConfig summary_config;
std::shared_ptr<Python> python = std::make_shared<Python>();
test_data(const std::string& deck_string) :
deck( Parser().parseString(deck_string)),
state( this->deck ),
python( std::make_shared<Python>() ),
schedule( this->deck, this->state, this->python),
summary_config( this->deck, this->schedule, this->state.getTableManager())
{

View File

@@ -924,102 +924,102 @@ BOOST_AUTO_TEST_CASE(Injector_Control_Mode) {
using WStat = ::Opm::Well::Status;
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::GAS, WStat::OPEN), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::GAS, WStat::SHUT), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::GAS, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::GAS, WStat::STOP), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::GAS, WStat::AUTO), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::WATER, WStat::OPEN), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::WATER, WStat::SHUT), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::WATER, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::WATER, WStat::STOP), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::WATER, WStat::AUTO), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::MULTI, WStat::OPEN), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::MULTI, WStat::SHUT), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::MULTI, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::MULTI, WStat::STOP), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::MULTI, WStat::AUTO), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::OIL, WStat::OPEN), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::OIL, WStat::SHUT), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::OIL, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::OIL, WStat::STOP), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::GRUP, IType::OIL, WStat::AUTO), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::OIL, WStat::OPEN), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::OIL, WStat::SHUT), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::OIL, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::OIL, WStat::STOP), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::OIL, WStat::AUTO), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::WATER, WStat::OPEN), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::WATER, WStat::SHUT), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::WATER, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::WATER, WStat::STOP), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::WATER, WStat::AUTO), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::GAS, WStat::OPEN), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::GAS, WStat::SHUT), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::GAS, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::GAS, WStat::STOP), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::GAS, WStat::AUTO), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::MULTI, WStat::OPEN), -10);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::MULTI, WStat::SHUT), -10);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::MULTI, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::MULTI, WStat::STOP), -10);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RATE, IType::MULTI, WStat::AUTO), -10);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::GAS, WStat::OPEN), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::GAS, WStat::SHUT), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::GAS, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::GAS, WStat::STOP), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::GAS, WStat::AUTO), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::WATER, WStat::OPEN), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::WATER, WStat::SHUT), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::WATER, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::WATER, WStat::STOP), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::WATER, WStat::AUTO), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::MULTI, WStat::OPEN), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::MULTI, WStat::SHUT), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::MULTI, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::MULTI, WStat::STOP), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::MULTI, WStat::AUTO), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::OIL, WStat::OPEN), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::OIL, WStat::SHUT), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::OIL, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::OIL, WStat::STOP), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::RESV, IType::OIL, WStat::AUTO), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::GAS, WStat::OPEN), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::GAS, WStat::SHUT), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::GAS, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::GAS, WStat::STOP), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::GAS, WStat::AUTO), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::WATER, WStat::OPEN), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::WATER, WStat::SHUT), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::WATER, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::WATER, WStat::STOP), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::WATER, WStat::AUTO), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::MULTI, WStat::OPEN), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::MULTI, WStat::SHUT), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::MULTI, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::MULTI, WStat::STOP), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::MULTI, WStat::AUTO), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::OIL, WStat::OPEN), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::OIL, WStat::SHUT), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::OIL, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::OIL, WStat::STOP), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::THP, IType::OIL, WStat::AUTO), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::GAS, WStat::OPEN), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::GAS, WStat::SHUT), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::GAS, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::GAS, WStat::STOP), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::GAS, WStat::AUTO), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::WATER, WStat::OPEN), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::WATER, WStat::SHUT), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::WATER, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::WATER, WStat::STOP), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::WATER, WStat::AUTO), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::MULTI, WStat::OPEN), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::MULTI, WStat::SHUT), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::MULTI, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::MULTI, WStat::STOP), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::MULTI, WStat::AUTO), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::OIL, WStat::OPEN), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::OIL, WStat::SHUT), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::OIL, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::OIL, WStat::STOP), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::OIL, WStat::AUTO), 7);
@@ -1035,47 +1035,47 @@ BOOST_AUTO_TEST_CASE(Producer_Control_Mode) {
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRUP, WStat::OPEN), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRUP, WStat::STOP), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRUP, WStat::SHUT), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRUP, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRUP, WStat::AUTO), -1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::ORAT, WStat::OPEN), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::ORAT, WStat::STOP), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::ORAT, WStat::SHUT), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::ORAT, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::ORAT, WStat::AUTO), 1);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::WRAT, WStat::OPEN), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::WRAT, WStat::STOP), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::WRAT, WStat::SHUT), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::WRAT, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::WRAT, WStat::AUTO), 2);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRAT, WStat::OPEN), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRAT, WStat::STOP), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRAT, WStat::SHUT), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRAT, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::GRAT, WStat::AUTO), 3);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::LRAT, WStat::OPEN), 4);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::LRAT, WStat::STOP), 4);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::LRAT, WStat::SHUT), 4);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::LRAT, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::LRAT, WStat::AUTO), 4);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::RESV, WStat::OPEN), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::RESV, WStat::STOP), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::RESV, WStat::SHUT), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::RESV, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::RESV, WStat::AUTO), 5);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::THP, WStat::OPEN), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::THP, WStat::STOP), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::THP, WStat::SHUT), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::THP, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::THP, WStat::AUTO), 6);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::BHP, WStat::OPEN), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::BHP, WStat::STOP), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::BHP, WStat::SHUT), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::BHP, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::BHP, WStat::AUTO), 7);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CRAT, WStat::OPEN), 9);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CRAT, WStat::STOP), 9);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CRAT, WStat::SHUT), 9);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CRAT, WStat::SHUT), 0);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CRAT, WStat::AUTO), 9);
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::NONE, WStat::OPEN), -10);