[Summary] Rate and rate-derived F-keyword
Support for rate or rate-derived keywords (i.e. sans pressure, sales etc.) from the Field family of keywords.
This commit is contained in:
parent
ef64026bce
commit
fa7656bedf
@ -369,6 +369,58 @@ static const std::unordered_map< std::string, ofun > funs = {
|
||||
{ "CWPT", liq_vol( prodcrate< rt::wat > ) },
|
||||
{ "COPT", liq_vol( prodcrate< rt::oil > ) },
|
||||
{ "CGPT", gas_vol( prodcrate< rt::gas > ) },
|
||||
|
||||
{ "FWPR", prodrate< rt::wat > },
|
||||
{ "FOPR", prodrate< rt::oil > },
|
||||
{ "FGPR", prodrate< rt::gas > },
|
||||
{ "FLPR", sum( prodrate< rt::wat >, prodrate< rt::oil > ) },
|
||||
{ "FWPT", liq_vol( prodrate< rt::wat > ) },
|
||||
{ "FOPT", liq_vol( prodrate< rt::oil > ) },
|
||||
{ "FGPT", gas_vol( prodrate< rt::gas > ) },
|
||||
{ "FLPT", liq_vol( sum( prodrate< rt::wat >,
|
||||
prodrate< rt::oil > ) ) },
|
||||
|
||||
{ "FWIR", injerate< rt::wat > },
|
||||
{ "FOIR", injerate< rt::oil > },
|
||||
{ "FGIR", injerate< rt::gas > },
|
||||
{ "FLIR", sum( injerate< rt::wat >, injerate< rt::oil > ) },
|
||||
{ "FWIT", liq_vol( injerate< rt::wat > ) },
|
||||
{ "FOIT", liq_vol( injerate< rt::oil > ) },
|
||||
{ "FGIT", gas_vol( injerate< rt::gas > ) },
|
||||
{ "FLIT", liq_vol( sum( injerate< rt::wat >,
|
||||
injerate< rt::oil > ) ) },
|
||||
|
||||
{ "FWPRH", production_history< Phase::WATER > },
|
||||
{ "FOPRH", production_history< Phase::OIL > },
|
||||
{ "FGPRH", production_history< Phase::GAS > },
|
||||
{ "FLPRH", sum( production_history< Phase::WATER >,
|
||||
production_history< Phase::OIL > ) },
|
||||
{ "FWPTH", liq_vol( production_history< Phase::WATER > ) },
|
||||
{ "FOPTH", liq_vol( production_history< Phase::OIL > ) },
|
||||
{ "FGPTH", gas_vol( production_history< Phase::GAS > ) },
|
||||
{ "FLPTH", liq_vol( sum( production_history< Phase::WATER >,
|
||||
production_history< Phase::OIL > ) ) },
|
||||
|
||||
{ "FWIRH", injection_history< Phase::WATER > },
|
||||
{ "FOIRH", injection_history< Phase::OIL > },
|
||||
{ "FGIRH", injection_history< Phase::GAS > },
|
||||
{ "FWITH", liq_vol( injection_history< Phase::WATER > ) },
|
||||
{ "FOITH", liq_vol( injection_history< Phase::OIL > ) },
|
||||
{ "FGITH", gas_vol( injection_history< Phase::GAS > ) },
|
||||
|
||||
{ "FWCT", div( prodrate< rt::wat >,
|
||||
sum( prodrate< rt::wat >, prodrate< rt::oil > ) ) },
|
||||
{ "FWCT", div( prodrate< rt::wat >,
|
||||
sum( prodrate< rt::wat >, prodrate< rt::oil > ) ) },
|
||||
{ "FGOR", div( prodrate< rt::gas >, prodrate< rt::oil > ) },
|
||||
{ "FGOR", div( prodrate< rt::gas >, prodrate< rt::oil > ) },
|
||||
{ "FGLR", div( prodrate< rt::gas >,
|
||||
sum( prodrate< rt::wat >, prodrate< rt::oil > ) ) },
|
||||
{ "FGORH", div( production_history< Phase::GAS >,
|
||||
production_history< Phase::OIL > ) },
|
||||
{ "FGLRH", div( production_history< Phase::GAS >,
|
||||
sum( production_history< Phase::WATER >,
|
||||
production_history< Phase::OIL > ) ) },
|
||||
};
|
||||
|
||||
inline std::vector< const Well* > find_wells( const Schedule& schedule,
|
||||
@ -395,6 +447,9 @@ inline std::vector< const Well* > find_wells( const Schedule& schedule,
|
||||
return wells;
|
||||
}
|
||||
|
||||
if( type == ECL_SMSPEC_FIELD_VAR )
|
||||
return schedule.getWells();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -380,6 +380,82 @@ BOOST_AUTO_TEST_CASE(completion_kewords) {
|
||||
BOOST_CHECK_CLOSE( 2 * 200.2, ecl_sum_get_well_completion_var( resp, 2, "W_2", "CGPT", 1 ), 1e-5 );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(field_keywords) {
|
||||
setup cfg( "test_Summary_field" );
|
||||
|
||||
out::Summary writer( cfg.es, cfg.config, cfg.name );
|
||||
writer.add_timestep( 0, 0 * day, cfg.es, cfg.wells );
|
||||
writer.add_timestep( 1, 1 * day, cfg.es, cfg.wells );
|
||||
writer.add_timestep( 2, 2 * day, cfg.es, cfg.wells );
|
||||
writer.write();
|
||||
|
||||
auto res = readsum( cfg.name );
|
||||
const auto* resp = res.get();
|
||||
|
||||
/* Production rates */
|
||||
BOOST_CHECK_CLOSE( 10.0 + 20.0, ecl_sum_get_field_var( resp, 1, "FWPR" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.1 + 20.1, ecl_sum_get_field_var( resp, 1, "FOPR" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.2 + 20.2, ecl_sum_get_field_var( resp, 1, "FGPR" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.0 + 20.0 + 10.1 + 20.1,
|
||||
ecl_sum_get_field_var( resp, 1, "FLPR" ), 1e-5 );
|
||||
|
||||
/* Production totals */
|
||||
BOOST_CHECK_CLOSE( 10.0 + 20.0, ecl_sum_get_field_var( resp, 1, "FWPT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.1 + 20.1, ecl_sum_get_field_var( resp, 1, "FOPT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.2 + 20.2, ecl_sum_get_field_var( resp, 1, "FGPT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.0 + 20.0 + 10.1 + 20.1,
|
||||
ecl_sum_get_field_var( resp, 1, "FLPT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * (10.0 + 20.0), ecl_sum_get_field_var( resp, 2, "FWPT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * (10.1 + 20.1), ecl_sum_get_field_var( resp, 2, "FOPT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * (10.2 + 20.2), ecl_sum_get_field_var( resp, 2, "FGPT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * (10.0 + 20.0 + 10.1 + 20.1),
|
||||
ecl_sum_get_field_var( resp, 2, "FLPT" ), 1e-5 );
|
||||
|
||||
/* Production rates (history) */
|
||||
BOOST_CHECK_CLOSE( 10.0 + 20.0, ecl_sum_get_field_var( resp, 1, "FWPRH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.1 + 20.1, ecl_sum_get_field_var( resp, 1, "FOPRH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.2 + 20.2, ecl_sum_get_field_var( resp, 1, "FGPRH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 10.0 + 10.1 + 20.0 + 20.1,
|
||||
ecl_sum_get_field_var( resp, 1, "FLPRH" ), 1e-5 );
|
||||
|
||||
/* Production totals (history) */
|
||||
BOOST_CHECK_CLOSE( (10.0 + 20.0), ecl_sum_get_field_var( resp, 1, "FWPTH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( (10.1 + 20.1), ecl_sum_get_field_var( resp, 1, "FOPTH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( (10.2 + 20.2), ecl_sum_get_field_var( resp, 1, "FGPTH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( (10.0 + 20.0 + 10.1 + 20.1),
|
||||
ecl_sum_get_field_var( resp, 1, "FLPTH" ), 1e-5 );
|
||||
|
||||
BOOST_CHECK_CLOSE( 2 * (10.0 + 20.0), ecl_sum_get_field_var( resp, 2, "FWPTH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * (10.1 + 20.1), ecl_sum_get_field_var( resp, 2, "FOPTH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * (10.2 + 20.2), ecl_sum_get_field_var( resp, 2, "FGPTH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * (10.0 + 20.0 + 10.1 + 20.1),
|
||||
ecl_sum_get_field_var( resp, 2, "FLPTH" ), 1e-5 );
|
||||
|
||||
/* Injection rates */
|
||||
BOOST_CHECK_CLOSE( 30.0, ecl_sum_get_field_var( resp, 1, "FWIR" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 30.2, ecl_sum_get_field_var( resp, 1, "FGIR" ), 1e-5 );
|
||||
|
||||
/* Injection totals */
|
||||
BOOST_CHECK_CLOSE( 30.0, ecl_sum_get_field_var( resp, 1, "FWIT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 30.2, ecl_sum_get_field_var( resp, 1, "FGIT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * 30.0, ecl_sum_get_field_var( resp, 2, "FWIT" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 2 * 30.2, ecl_sum_get_field_var( resp, 2, "FGIT" ), 1e-5 );
|
||||
|
||||
/* Injection totals (history) */
|
||||
BOOST_CHECK_CLOSE( 30.0, ecl_sum_get_field_var( resp, 1, "FWITH" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( 60.0, ecl_sum_get_field_var( resp, 2, "FWITH" ), 1e-5 );
|
||||
|
||||
/* gwct - water cut */
|
||||
const double wcut = (10.0 + 20.0) / ( 10.0 + 10.1 + 20.0 + 20.1 );
|
||||
BOOST_CHECK_CLOSE( wcut, ecl_sum_get_field_var( resp, 1, "FWCT" ), 1e-5 );
|
||||
|
||||
/* ggor - gas-oil ratio */
|
||||
const double ggor = (10.2 + 20.2) / (10.1 + 20.1);
|
||||
BOOST_CHECK_CLOSE( ggor, ecl_sum_get_field_var( resp, 1, "FGOR" ), 1e-5 );
|
||||
BOOST_CHECK_CLOSE( ggor, ecl_sum_get_field_var( resp, 1, "FGORH" ), 1e-5 );
|
||||
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(report_steps_time) {
|
||||
setup cfg( "test_Summary_report_steps_time" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user