Count of abondoned wells should handle both STOP and SHUT
This commit is contained in:
parent
6e82f3cb7a
commit
a2f72f0953
@ -50,6 +50,7 @@
|
||||
|
||||
#include <opm/output/eclipse/RegionCache.hpp>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
@ -738,39 +739,31 @@ inline quantity injection_history( const fn_args& args ) {
|
||||
return { sum, rate_unit< phase >() };
|
||||
}
|
||||
|
||||
inline quantity abondoned_injectors( const fn_args& args ) {
|
||||
template< bool injection >
|
||||
inline quantity abondoned_well( 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())
|
||||
if (injection && !sched_well.hasInjected())
|
||||
continue;
|
||||
|
||||
count += !well_iter->second.flowing();
|
||||
if (!injection && !sched_well.hasProduced())
|
||||
continue;
|
||||
|
||||
|
||||
const auto& well_name = sched_well.name();
|
||||
auto well_iter = args.wells.find( well_name );
|
||||
if (well_iter == args.wells.end()) {
|
||||
count += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
count += !well_iter->second.flowing();
|
||||
}
|
||||
|
||||
return { 1.0 * count, measure::identity };
|
||||
}
|
||||
|
||||
inline quantity abondoned_producers( const fn_args& args ) {
|
||||
std::size_t count = 0;
|
||||
|
||||
for (const auto& sched_well : args.schedule_wells) {
|
||||
if (sched_well.hasProduced()) {
|
||||
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 res_vol_production_target( const fn_args& args ) {
|
||||
|
||||
@ -1379,8 +1372,8 @@ static const std::unordered_map< std::string, ofun > funs = {
|
||||
{ "FMWIN", flowing< injector > },
|
||||
{ "FMWPR", flowing< producer > },
|
||||
{ "FVPRT", res_vol_production_target },
|
||||
{ "FMWPA", abondoned_producers },
|
||||
{ "FMWIA", abondoned_injectors },
|
||||
{ "FMWPA", abondoned_well< producer > },
|
||||
{ "FMWIA", abondoned_well< injector >},
|
||||
|
||||
//Field control mode
|
||||
{ "FMCTP", group_control< false, true, false, false >},
|
||||
|
@ -455,7 +455,7 @@ TSTEP
|
||||
|
||||
WELOPEN
|
||||
'RFTP' 'SHUT' /
|
||||
'RFTI' 'SHUT' /
|
||||
'RFTI' 'STOP' /
|
||||
/
|
||||
|
||||
TSTEP
|
||||
|
@ -56,11 +56,16 @@ double prod_rft(const EclipseState& es, const Schedule& /* sched */, const Summ
|
||||
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 */) {
|
||||
double inj_rfti(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);
|
||||
}
|
||||
|
||||
double inj_inj(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, 100);
|
||||
}
|
||||
|
||||
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& units = es.getUnits();
|
||||
@ -90,7 +95,8 @@ BOOST_AUTO_TEST_CASE(RUN) {
|
||||
|
||||
msim.well_rate("PROD", data::Rates::opt::oil, prod_opr);
|
||||
msim.well_rate("RFTP", data::Rates::opt::oil, prod_rft);
|
||||
msim.well_rate("RFTI", data::Rates::opt::wat, inj_rft);
|
||||
msim.well_rate("RFTI", data::Rates::opt::wat, inj_rfti);
|
||||
msim.well_rate("INJ", data::Rates::opt::gas, inj_inj);
|
||||
msim.solution("PRESSURE", pressure);
|
||||
{
|
||||
const WorkArea work_area("test_msim");
|
||||
@ -128,6 +134,7 @@ BOOST_AUTO_TEST_CASE(RUN) {
|
||||
|
||||
BOOST_CHECK_EQUAL( fmwpa[0], 0.0 );
|
||||
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( fmwia[dates.size() - 1], 1.0 );
|
||||
|
Loading…
Reference in New Issue
Block a user