Active Well Control Output: Place Duplicate Implementation in Well
Will become shared backend for output to restart and summary files. Add unit tests to exercise the new functions.
This commit is contained in:
@@ -656,7 +656,15 @@ private:
|
||||
std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );
|
||||
std::ostream& operator<<( std::ostream&, const WellProductionProperties& );
|
||||
|
||||
int eclipseControlMode(const Well::InjectorCMode imode,
|
||||
const InjectorType itype,
|
||||
const Well::Status wellStatus);
|
||||
|
||||
int eclipseControlMode(const Well::ProducerCMode pmode,
|
||||
const Well::Status wellStatus);
|
||||
|
||||
int eclipseControlMode(const Well& well,
|
||||
const SummaryState& st);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/io/eclipse/rst/well.hpp>
|
||||
#include <opm/output/eclipse/VectorItems/well.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/W.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
@@ -1371,3 +1372,77 @@ bool Well::operator==(const Well& data) const {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int Opm::eclipseControlMode(const Opm::Well::InjectorCMode imode,
|
||||
const Opm::InjectorType itype,
|
||||
const Opm::Well::Status wellStatus)
|
||||
{
|
||||
using IMode = ::Opm::Well::InjectorCMode;
|
||||
using Val = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellCtrlMode;
|
||||
|
||||
using IType = ::Opm::InjectorType;
|
||||
|
||||
switch (imode) {
|
||||
case IMode::RATE: {
|
||||
switch (itype) {
|
||||
case IType::OIL: return Val::OilRate;
|
||||
case IType::WATER: return Val::WatRate;
|
||||
case IType::GAS: return Val::GasRate;
|
||||
case IType::MULTI: return Val::WMCtlUnk;
|
||||
}}
|
||||
break;
|
||||
|
||||
case IMode::RESV: return Val::ResVRate;
|
||||
case IMode::THP: return Val::THP;
|
||||
case IMode::BHP: return Val::BHP;
|
||||
case IMode::GRUP: return Val::Group;
|
||||
|
||||
default:
|
||||
if (wellStatus == ::Opm::Well::Status::SHUT) {
|
||||
return Val::Shut;
|
||||
}
|
||||
}
|
||||
|
||||
return Val::WMCtlUnk;
|
||||
}
|
||||
|
||||
int Opm::eclipseControlMode(const Opm::Well::ProducerCMode pmode,
|
||||
const Opm::Well::Status wellStatus)
|
||||
{
|
||||
using PMode = ::Opm::Well::ProducerCMode;
|
||||
using Val = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellCtrlMode;
|
||||
|
||||
switch (pmode) {
|
||||
case PMode::ORAT: return Val::OilRate;
|
||||
case PMode::WRAT: return Val::WatRate;
|
||||
case PMode::GRAT: return Val::GasRate;
|
||||
case PMode::LRAT: return Val::LiqRate;
|
||||
case PMode::RESV: return Val::ResVRate;
|
||||
case PMode::THP: return Val::THP;
|
||||
case PMode::BHP: return Val::BHP;
|
||||
case PMode::CRAT: return Val::CombRate;
|
||||
case PMode::GRUP: return Val::Group;
|
||||
|
||||
default:
|
||||
if (wellStatus == ::Opm::Well::Status::SHUT) {
|
||||
return Val::Shut;
|
||||
}
|
||||
}
|
||||
|
||||
return Val::WMCtlUnk;
|
||||
}
|
||||
|
||||
int Opm::eclipseControlMode(const Well& well,
|
||||
const SummaryState& st)
|
||||
{
|
||||
if (well.isProducer()) {
|
||||
const auto& ctrl = well.productionControls(st);
|
||||
|
||||
return eclipseControlMode(ctrl.cmode, well.getStatus());
|
||||
}
|
||||
else { // Injector
|
||||
const auto& ctrl = well.injectionControls(st);
|
||||
|
||||
return eclipseControlMode(ctrl.cmode, well.injectorType(), well.getStatus());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3615,3 +3615,148 @@ DATES -- 4
|
||||
|
||||
gr.compute("XYZ",1, 1.0, oil_pot, gas_pot, wat_pot);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Injection_Control_Mode_From_Well) {
|
||||
const auto deck = ::Opm::Parser{}.parseString(R"(RUNSPEC
|
||||
DIMENS
|
||||
10 10 10
|
||||
/
|
||||
|
||||
START -- 0
|
||||
20 MAR 2020 /
|
||||
|
||||
GRID
|
||||
|
||||
DXV
|
||||
10*100 /
|
||||
DYV
|
||||
10*100 /
|
||||
DZV
|
||||
10*1 /
|
||||
|
||||
TOPS
|
||||
100*2000 /
|
||||
|
||||
PERMX
|
||||
1000*300 /
|
||||
PERMY
|
||||
1000*300 /
|
||||
PERMZ
|
||||
1000*3 /
|
||||
|
||||
PORO
|
||||
1000*0.25 /
|
||||
|
||||
SCHEDULE
|
||||
WELSPECS
|
||||
'W1' 'G1' 1 2 3.33 'OIL' 7*/
|
||||
'W2' 'G2' 1 3 3.33 'OIL' 3* YES /
|
||||
'W3' 'G3' 1 4 3.92 'OIL' 3* NO /
|
||||
'W4' 'G3' 2 2 3.92 'OIL' 3* NO /
|
||||
'W5' 'G3' 2 3 3.92 'OIL' 3* NO /
|
||||
'W6' 'G3' 2 4 3.92 'OIL' 3* NO /
|
||||
'W7' 'G3' 3 2 3.92 'OIL' 3* NO /
|
||||
/
|
||||
|
||||
WCONINJE
|
||||
'W1' 'WATER' 'OPEN' 'GRUP' /
|
||||
'W2' 'GAS' 'OPEN' 'RATE' 200 1* 450.0 /
|
||||
'W3' 'OIL' 'OPEN' 'RATE' 200 1* 450.0 /
|
||||
'W4' 'WATER' 'OPEN' 'RATE' 200 1* 450.0 /
|
||||
'W5' 'WATER' 'OPEN' 'RESV' 200 175 450.0 /
|
||||
'W6' 'GAS' 'OPEN' 'BHP' 200 1* 450.0 /
|
||||
'W7' 'GAS' 'OPEN' 'THP' 200 1* 450.0 150 /
|
||||
/
|
||||
|
||||
TSTEP
|
||||
30*30 /
|
||||
|
||||
END
|
||||
)");
|
||||
|
||||
const auto st = ::Opm::SummaryState{ std::chrono::system_clock::now() };
|
||||
const auto es = ::Opm::EclipseState{ deck };
|
||||
const auto sched = ::Opm::Schedule{ deck, es };
|
||||
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W1", 10), st), -1);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W2", 10), st), 3);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W3", 10), st), 1);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W4", 10), st), 2);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W5", 10), st), 5);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W6", 10), st), 7);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W7", 10), st), 6);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Production_Control_Mode_From_Well) {
|
||||
const auto deck = ::Opm::Parser{}.parseString(R"(RUNSPEC
|
||||
DIMENS
|
||||
10 10 10
|
||||
/
|
||||
|
||||
START -- 0
|
||||
20 MAR 2020 /
|
||||
|
||||
GRID
|
||||
|
||||
DXV
|
||||
10*100 /
|
||||
DYV
|
||||
10*100 /
|
||||
DZV
|
||||
10*1 /
|
||||
|
||||
TOPS
|
||||
100*2000 /
|
||||
|
||||
PERMX
|
||||
1000*300 /
|
||||
PERMY
|
||||
1000*300 /
|
||||
PERMZ
|
||||
1000*3 /
|
||||
|
||||
PORO
|
||||
1000*0.25 /
|
||||
|
||||
SCHEDULE
|
||||
WELSPECS
|
||||
'W1' 'G1' 1 2 3.33 'OIL' 7*/
|
||||
'W2' 'G2' 1 3 3.33 'OIL' 3* YES /
|
||||
'W3' 'G3' 1 4 3.92 'OIL' 3* NO /
|
||||
'W4' 'G3' 2 2 3.92 'OIL' 3* NO /
|
||||
'W5' 'G3' 2 3 3.92 'OIL' 3* NO /
|
||||
'W6' 'G3' 2 4 3.92 'OIL' 3* NO /
|
||||
'W7' 'G3' 3 2 3.92 'OIL' 3* NO /
|
||||
'W8' 'G3' 3 3 3.92 'OIL' 3* NO /
|
||||
/
|
||||
|
||||
WCONPROD
|
||||
'W1' 'OPEN' 'GRUP' /
|
||||
'W2' 'OPEN' 'ORAT' 1000.0 /
|
||||
'W3' 'OPEN' 'WRAT' 1000.0 250.0 /
|
||||
'W4' 'OPEN' 'GRAT' 1000.0 250.0 30.0e3 /
|
||||
'W5' 'OPEN' 'LRAT' 1000.0 250.0 30.0e3 1500.0 /
|
||||
'W6' 'OPEN' 'RESV' 1000.0 250.0 30.0e3 1500.0 314.15 /
|
||||
'W7' 'OPEN' 'BHP' 1000.0 250.0 30.0e3 1500.0 314.15 27.1828 /
|
||||
'W8' 'OPEN' 'THP' 1000.0 250.0 30.0e3 1500.0 314.15 27.1828 31.415 /
|
||||
/
|
||||
|
||||
TSTEP
|
||||
30*30 /
|
||||
|
||||
END
|
||||
)");
|
||||
|
||||
const auto st = ::Opm::SummaryState{ std::chrono::system_clock::now() };
|
||||
const auto es = ::Opm::EclipseState{ deck };
|
||||
const auto sched = ::Opm::Schedule{ deck, es };
|
||||
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W1", 10), st), -1);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W2", 10), st), 1);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W3", 10), st), 2);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W4", 10), st), 3);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W5", 10), st), 4);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W6", 10), st), 5);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W7", 10), st), 7);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(sched.getWell("W8", 10), st), 6);
|
||||
}
|
||||
|
||||
@@ -908,3 +908,179 @@ BOOST_AUTO_TEST_CASE(WellTypeTest) {
|
||||
BOOST_CHECK(wtp.preferred_phase() == Phase::WATER);
|
||||
BOOST_CHECK(wtp.injector_type() == InjectorType::GAS);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Injector_Control_Mode) {
|
||||
using IMode = ::Opm::Well::InjectorCMode;
|
||||
using IType = ::Opm::InjectorType;
|
||||
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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::STOP), 7);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::BHP, IType::OIL, WStat::AUTO), 7);
|
||||
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(IMode::CMODE_UNDEFINED, IType::WATER, WStat::SHUT), 0);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(static_cast<IMode>(1729), IType::WATER, WStat::SHUT), 0);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(static_cast<IMode>(1729), IType::WATER, WStat::STOP), -10); // Unknown combination
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(static_cast<IMode>(1729), IType::WATER, WStat::OPEN), -10); // Unknown combination
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Producer_Control_Mode) {
|
||||
using PMode = ::Opm::Well::ProducerCMode;
|
||||
using WStat = ::Opm::Well::Status;
|
||||
|
||||
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::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::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::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::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::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::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::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::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::AUTO), 9);
|
||||
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::NONE, WStat::OPEN), -10);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::NONE, WStat::STOP), -10);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::NONE, WStat::SHUT), 0);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::NONE, WStat::AUTO), -10);
|
||||
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CMODE_UNDEFINED, WStat::OPEN), -10);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CMODE_UNDEFINED, WStat::STOP), -10);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CMODE_UNDEFINED, WStat::SHUT), 0);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(PMode::CMODE_UNDEFINED, WStat::AUTO), -10);
|
||||
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(static_cast<PMode>(271828), WStat::OPEN), -10);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(static_cast<PMode>(271828), WStat::STOP), -10);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(static_cast<PMode>(271828), WStat::SHUT), 0);
|
||||
BOOST_CHECK_EQUAL(eclipseControlMode(static_cast<PMode>(271828), WStat::AUTO), -10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user