Implement number of abondoned injectors: FMWIA

This commit is contained in:
Joakim Hove 2020-10-14 00:40:12 +02:00
parent dd34f2d831
commit e3959c5fa1
4 changed files with 45 additions and 3 deletions

View File

@ -738,6 +738,23 @@ inline quantity injection_history( const fn_args& args ) {
return { sum, rate_unit< phase >() }; return { sum, rate_unit< phase >() };
} }
inline quantity abondoned_injectors( const fn_args& args ) {
std::size_t count = 0;
for (const auto& sched_well : args.schedule_wells) {
if (sched_well.hasInjected()) {
const auto& well_name = sched_well.name();
auto well_iter = args.wells.find( well_name );
if (well_iter == args.wells.end())
continue;
count += !well_iter->second.flowing();
}
}
return { 1.0 * count, measure::identity };
}
inline quantity abondoned_producers( const fn_args& args ) { inline quantity abondoned_producers( const fn_args& args ) {
std::size_t count = 0; std::size_t count = 0;
@ -1363,6 +1380,7 @@ static const std::unordered_map< std::string, ofun > funs = {
{ "FMWPR", flowing< producer > }, { "FMWPR", flowing< producer > },
{ "FVPRT", res_vol_production_target }, { "FVPRT", res_vol_production_target },
{ "FMWPA", abondoned_producers }, { "FMWPA", abondoned_producers },
{ "FMWIA", abondoned_injectors },
//Field control mode //Field control mode
{ "FMCTP", group_control< false, true, false, false >}, { "FMCTP", group_control< false, true, false, false >},

View File

@ -1528,6 +1528,7 @@ bool Well::operator==(const Well& data) const {
this->guide_rate == data.guide_rate && this->guide_rate == data.guide_rate &&
this->solvent_fraction == data.solvent_fraction && this->solvent_fraction == data.solvent_fraction &&
this->hasProduced() == data.hasProduced() && this->hasProduced() == data.hasProduced() &&
this->hasInjected() == data.hasInjected() &&
this->predictionMode() == data.predictionMode() && this->predictionMode() == data.predictionMode() &&
this->productivity_index == data.productivity_index && this->productivity_index == data.productivity_index &&
this->getTracerProperties() == data.getTracerProperties() && this->getTracerProperties() == data.getTracerProperties() &&

View File

@ -288,6 +288,7 @@ RPR__NUM
RUNSUM RUNSUM
FMWPA FMWPA
FMWIA
-- 1a) Oil rate vs time -- 1a) Oil rate vs time
FOPR FOPR
@ -393,7 +394,9 @@ WELSPECS
'PROD' 'G1' 10 10 8400 'OIL' / 'PROD' 'G1' 10 10 8400 'OIL' /
'INJ' 'G1' 1 1 8335 'GAS' / 'INJ' 'G1' 1 1 8335 'GAS' /
'RFTP' 'G1' 10 10 8400 'OIL' / 'RFTP' 'G1' 10 10 8400 'OIL' /
'RFTI' 'G1' 9 9 8400 'WATER' /
/ /
-- Coordinates in item 3-4 are retrieved from Odeh's figure 1 and 2 -- Coordinates in item 3-4 are retrieved from Odeh's figure 1 and 2
-- Note that the depth at the midpoint of the well grid blocks -- Note that the depth at the midpoint of the well grid blocks
-- has been used as reference depth for bottom hole pressure in item 5 -- has been used as reference depth for bottom hole pressure in item 5
@ -402,6 +405,7 @@ COMPDAT
-- Item #: 1 2 3 4 5 6 7 8 9 -- Item #: 1 2 3 4 5 6 7 8 9
'PROD' 10 10 3 3 'OPEN' 1* 1* 0.5 / 'PROD' 10 10 3 3 'OPEN' 1* 1* 0.5 /
'RFTP' 10 10 3 3 'OPEN' 1* 1* 0.5 / 'RFTP' 10 10 3 3 'OPEN' 1* 1* 0.5 /
'RFTI' 9 9 3 3 'OPEN' 1* 1* 0.5 /
'INJ' 1 1 1 1 'OPEN' 1* 1* 0.5 / 'INJ' 1 1 1 1 'OPEN' 1* 1* 0.5 /
/ /
-- Coordinates in item 2-5 are retreived from Odeh's figure 1 and 2 -- Coordinates in item 2-5 are retreived from Odeh's figure 1 and 2
@ -422,7 +426,9 @@ WCONPROD
WCONINJE WCONINJE
-- Item #:1 2 3 4 5 6 7 -- Item #:1 2 3 4 5 6 7
'INJ' 'GAS' 'OPEN' 'RATE' 100000 1* 9014 / 'INJ' 'GAS' 'OPEN' 'RATE' 100000 1* 9014 /
'RFTI' 'GAS' 'SHUT' 'RATE' 0 /
/ /
-- Stated in Odeh that gas inj. rate (item 5) is 100MMscf per day -- Stated in Odeh that gas inj. rate (item 5) is 100MMscf per day
-- BHP upper limit (item 7) should not be exceeding the highest -- BHP upper limit (item 7) should not be exceeding the highest
-- pressure in the PVT table=9014.7psia (default is 100 000psia) -- pressure in the PVT table=9014.7psia (default is 100 000psia)
@ -433,17 +439,23 @@ TSTEP
WELOPEN WELOPEN
'RFTP' OPEN / 'RFTP' OPEN /
'RFTI' OPEN /
/ /
WCONHIST WCONHIST
'RFTP' 'OPEN' 'RESV' 0 / 'RFTP' 'OPEN' 'RESV' 0 /
/ /
WCONINJE
'RFTI' 'GAS' 'OPEN' 'RATE' 0 /
/
TSTEP TSTEP
31 / 31 /
WELOPEN WELOPEN
'RFTP' 'SHUT' / 'RFTP' 'SHUT' /
'RFTI' 'SHUT' /
/ /
TSTEP TSTEP

View File

@ -56,6 +56,11 @@ double prod_rft(const EclipseState& es, const Schedule& /* sched */, const Summ
return -units.to_si(UnitSystem::measure::rate, 0.0); return -units.to_si(UnitSystem::measure::rate, 0.0);
} }
double inj_rft(const EclipseState& es, const Schedule& /* sched */, const SummaryState&, const data::Solution& /* sol */, size_t /* report_step */, double /* seconds_elapsed */) {
const auto& units = es.getUnits();
return units.to_si(UnitSystem::measure::rate, 0.0);
}
void pressure(const EclipseState& es, const Schedule& /* sched */, data::Solution& sol, size_t /* report_step */, double seconds_elapsed) { void pressure(const EclipseState& es, const Schedule& /* sched */, data::Solution& sol, size_t /* report_step */, double seconds_elapsed) {
const auto& grid = es.getInputGrid(); const auto& grid = es.getInputGrid();
const auto& units = es.getUnits(); const auto& units = es.getUnits();
@ -85,6 +90,7 @@ BOOST_AUTO_TEST_CASE(RUN) {
msim.well_rate("PROD", data::Rates::opt::oil, prod_opr); msim.well_rate("PROD", data::Rates::opt::oil, prod_opr);
msim.well_rate("RFTP", data::Rates::opt::oil, prod_rft); msim.well_rate("RFTP", data::Rates::opt::oil, prod_rft);
msim.well_rate("RFTI", data::Rates::opt::wat, inj_rft);
msim.solution("PRESSURE", pressure); msim.solution("PRESSURE", pressure);
{ {
const WorkArea work_area("test_msim"); const WorkArea work_area("test_msim");
@ -107,6 +113,7 @@ BOOST_AUTO_TEST_CASE(RUN) {
} }
const auto& fmwpa = smry.get("FMWPA"); const auto& fmwpa = smry.get("FMWPA");
const auto& fmwia = smry.get("FMWIA");
const auto& dates = smry.dates(); const auto& dates = smry.dates();
const auto& day = smry.get("DAY"); const auto& day = smry.get("DAY");
const auto& month = smry.get("MONTH"); const auto& month = smry.get("MONTH");
@ -120,8 +127,10 @@ BOOST_AUTO_TEST_CASE(RUN) {
} }
BOOST_CHECK_EQUAL( fmwpa[0], 0.0 ); BOOST_CHECK_EQUAL( fmwpa[0], 0.0 );
// The RFTP well will appear as an abondoned well. BOOST_CHECK_EQUAL( fmwia[0], 0.0 );
// The RFTP /RFTI wells will appear as an abondoned well.
BOOST_CHECK_EQUAL( fmwpa[dates.size() - 1], 1.0 ); BOOST_CHECK_EQUAL( fmwpa[dates.size() - 1], 1.0 );
BOOST_CHECK_EQUAL( fmwia[dates.size() - 1], 1.0 );
const auto rsm = EclIO::ERsm("SPE1CASE1.RSM"); const auto rsm = EclIO::ERsm("SPE1CASE1.RSM");
BOOST_CHECK( EclIO::cmp( smry, rsm )); BOOST_CHECK( EclIO::cmp( smry, rsm ));
@ -141,8 +150,10 @@ BOOST_AUTO_TEST_CASE(RUN) {
const int report_step = 50; const int report_step = 50;
const auto& rst_state = Opm::RestartIO::RstState::load(rst, report_step); const auto& rst_state = Opm::RestartIO::RstState::load(rst, report_step);
Schedule sched_rst(deck, state, python, &rst_state); Schedule sched_rst(deck, state, python, &rst_state);
const auto& rft_well = sched_rst.getWell("RFTP", report_step); const auto& rfti_well = sched_rst.getWell("RFTI", report_step);
BOOST_CHECK(rft_well.getStatus() == Well::Status::SHUT); const auto& rftp_well = sched_rst.getWell("RFTP", report_step);
BOOST_CHECK(rftp_well.getStatus() == Well::Status::SHUT);
BOOST_CHECK(rfti_well.getStatus() == Well::Status::SHUT);
} }
} }
} }