Add support for GVIR keyword

This commit is contained in:
Sveinung Rundhovde 2018-01-24 11:47:01 +01:00
parent c623452823
commit db963b7286
2 changed files with 4 additions and 0 deletions

View File

@ -677,6 +677,8 @@ static const std::unordered_map< std::string, ofun > funs = {
{ "GOIR", rate< rt::oil, injector > },
{ "GGIR", rate< rt::gas, injector > },
{ "GNIR", rate< rt::solvent, injector > },
{ "GVIR", sum( sum( rate< rt::reservoir_water, injector >, rate< rt::reservoir_oil, injector > ),
rate< rt::reservoir_gas, injector > ) },
{ "GWIT", mul( rate< rt::wat, injector >, duration ) },
{ "GOIT", mul( rate< rt::oil, injector >, duration ) },
{ "GGIT", mul( rate< rt::gas, injector >, duration ) },

View File

@ -518,6 +518,8 @@ BOOST_AUTO_TEST_CASE(group_keywords) {
BOOST_CHECK_CLOSE( 30.0, ecl_sum_get_group_var( resp, 1, "G_2", "GWIR" ), 1e-5 );
BOOST_CHECK_CLOSE( 30.2, ecl_sum_get_group_var( resp, 1, "G_2", "GGIR" ), 1e-5 );
BOOST_CHECK_CLOSE( 30.3, ecl_sum_get_group_var( resp, 1, "G_2", "GNIR" ), 1e-5 );
BOOST_CHECK_CLOSE( (30.6 + 30.7 + 30.8),
ecl_sum_get_group_var( resp, 1, "G_2", "GVIR" ), 1e-5 );
/* Injection totals */
BOOST_CHECK_CLOSE( 30.0, ecl_sum_get_group_var( resp, 1, "G_2", "GWIT" ), 1e-5 );