Add Support for WPIx Summary Vectors

We calculate these, for now, as

   WPIx = WOPR / (WBPx - WBHP)

but it is possible that we may have to revise this definition,
especially for injectors.
This commit is contained in:
Bård Skaflestad
2023-09-20 22:54:48 +02:00
parent 8ea35f2d0d
commit d225901733
3 changed files with 56 additions and 5 deletions

View File

@@ -1535,6 +1535,41 @@ inline quantity potential_rate( const fn_args& args )
return { sum, rate_unit< phase >() };
}
template <Opm::data::WellBlockAvgPress::Quantity wbp_quantity>
quantity well_block_average_prod_index(const fn_args& args)
{
// Note: This WPIn evaluation function is supported only at the well
// level. There is intentionally no loop over args.schedule_wells.
const auto unit = rate_unit<rt::productivity_index_oil>();
const quantity zero = { 0.0, unit };
if (args.schedule_wells.empty()) {
return zero;
}
const auto& name = args.schedule_wells.front()->name();
auto xwPos = args.wells.find(name);
if ((xwPos == args.wells.end()) ||
(xwPos->second.dynamicStatus == Opm::Well::Status::SHUT))
{
return zero;
}
auto p = args.wbp.values.find(args.schedule_wells.front()->name());
if (p == args.wbp.values.end()) {
return zero;
}
// Rt::oil is intentional.
const auto eff_fac = efac(args.eff_factors, name);
const auto q = xwPos->second.rates.get(rt::oil, 0.0) * eff_fac;
const auto dp = p->second[wbp_quantity] - xwPos->second.bhp;
return { - q / dp, unit };
}
inline quantity preferred_phase_productivty_index(const fn_args& args)
{
if (args.schedule_wells.empty())
@@ -2402,6 +2437,12 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "WPIG", potential_rate< rt::productivity_index_gas >},
{ "WPIL", sum( potential_rate< rt::productivity_index_water, true, false >,
potential_rate< rt::productivity_index_oil, true, false >)},
{ "WPI1", well_block_average_prod_index<Opm::data::WellBlockAvgPress::Quantity::WBP> },
{ "WPI4", well_block_average_prod_index<Opm::data::WellBlockAvgPress::Quantity::WBP4> },
{ "WPI5", well_block_average_prod_index<Opm::data::WellBlockAvgPress::Quantity::WBP5> },
{ "WPI9", well_block_average_prod_index<Opm::data::WellBlockAvgPress::Quantity::WBP9> },
// Well potential
{ "WWPP", potential_rate< rt::well_potential_water , true, false>},
{ "WOPP", potential_rate< rt::well_potential_oil , true, false>},

View File

@@ -716,11 +716,14 @@ WPIW
/
WPIL
/
WBP
/
WBP4
/
WPI1
'W_1' 'W_2' /
WPI4
'W_1' /
WPI5
'W_1' /
WPI9
'W_1' /
-- from model2
WOPTF
/

View File

@@ -663,6 +663,13 @@ BOOST_AUTO_TEST_CASE(well_keywords)
BOOST_CHECK_CLOSE( 10.11, ecl_sum_get_well_var( resp, 1, "W_1", "WPI" ), 1.0e-5 );
BOOST_CHECK_CLOSE( 21.01, ecl_sum_get_well_var( resp, 1, "W_1", "WPIL" ), 1.0e-5 );
BOOST_CHECK_CLOSE(10.1 / (123.456 - 0.1), ecl_sum_get_well_var( resp, 1, "W_1", "WPI1" ), 1.0e-5 );
BOOST_CHECK_CLOSE(10.1 / (123.567 - 0.1), ecl_sum_get_well_var( resp, 1, "W_1", "WPI4" ), 1.0e-5 );
BOOST_CHECK_CLOSE(10.1 / (123.678 - 0.1), ecl_sum_get_well_var( resp, 1, "W_1", "WPI5" ), 1.0e-5 );
BOOST_CHECK_CLOSE(10.1 / (123.789 - 0.1), ecl_sum_get_well_var( resp, 1, "W_1", "WPI9" ), 1.0e-5 );
BOOST_CHECK_CLOSE(0.0, ecl_sum_get_well_var( resp, 1, "W_2", "WPI1" ), 1.0e-5 );
BOOST_CHECK_CLOSE( 20.9 , ecl_sum_get_well_var( resp, 1, "W_2", "WPIW" ), 1.0e-5 );
BOOST_CHECK_CLOSE( 20.11, ecl_sum_get_well_var( resp, 1, "W_2", "WPIO" ), 1.0e-5 );
BOOST_CHECK_CLOSE( 20.12, ecl_sum_get_well_var( resp, 1, "W_2", "WPIG" ), 1.0e-5 );