From d7c5a43226fd5b686258a92c0e456dd64583675b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Thu, 28 Apr 2016 09:46:01 +0200 Subject: [PATCH] WGLR+WGLRH support --- src/opm/output/eclipse/Summary.cpp | 19 +++++++++++++++++++ tests/summary_deck.DATA | 5 +++++ tests/test_Summary.cpp | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index b621e9d3f..8e0a8369d 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -138,6 +138,8 @@ enum class E : out::Summary::kwtype { WGITH, WGOR, WGORH, + WGLR, + WGLRH, WGPR, WGPRH, WGPT, @@ -190,6 +192,8 @@ const std::map< std::string, E > keyhash = { { "WGITH", E::WGITH }, { "WGOR", E::WGOR }, { "WGORH", E::WGORH }, + { "WGLR", E::WGLR }, + { "WGLRH", E::WGLRH }, { "WGPR", E::WGPR }, { "WGPRH", E::WGPRH }, { "WGPT", E::WGPT }, @@ -283,6 +287,17 @@ inline double wgorh( const Well& w, size_t ts ) { return glr( p.GasRate, p.OilRate ); } +inline double wglrh( const Well& w, size_t ts ) { + /* We do not support mixed injections, and gas/oil is undefined when oil is + * zero (i.e. pure gas injector), so always output 0 if this is an injector + */ + if( w.isInjector( ts ) ) return 0; + + const auto& p = w.getProductionProperties( ts ); + + return glr( p.GasRate, p.WaterRate + p.OilRate ); +} + enum class WT { wat, oil, gas }; inline double prodrate( const Well& w, size_t timestep, @@ -429,6 +444,10 @@ inline double well_keywords( E keyword, case E::WGOR: return glr( rate( rt::gas ), rate( rt::oil ) ); case E::WGORH: return wgorh( state_well, tstep ); + case E::WGLR: return glr( rate( rt::gas ), + rate( rt::wat ) + rate( rt::oil ) ); + case E::WGLRH: return wglrh( state_well, tstep ); + /* Pressures */ case E::WBHP: return convert( sim_well.bhp, dim::pressure, conversion_table ); case E::WBHPH: return 0; /* not supported */ diff --git a/tests/summary_deck.DATA b/tests/summary_deck.DATA index 8d39865f2..363603814 100644 --- a/tests/summary_deck.DATA +++ b/tests/summary_deck.DATA @@ -197,6 +197,11 @@ WGOR / WGORH / +WGLR +/ +WGLRH +/ + -- Performance WBHP diff --git a/tests/test_Summary.cpp b/tests/test_Summary.cpp index c69a8c16c..6c5512a73 100644 --- a/tests/test_Summary.cpp +++ b/tests/test_Summary.cpp @@ -220,6 +220,29 @@ BOOST_AUTO_TEST_CASE(WGOR_H) { } +BOOST_AUTO_TEST_CASE(WGLR_H) { + setup cfg( "sum_test_WGOR_H" ); + + out::Summary writer( cfg.es, cfg.config, cfg.name ); + writer.add_timestep( 1, 1, cfg.es, cfg.wells ); + writer.write(); + + auto res = readsum( cfg.name ); + const auto* resp = res.get(); + + const double wgor1 = 10.2 / ( 10.0 + 10.1 ); + const double wgor2 = 20.2 / ( 20.0 + 20.1 ); + const double wgor3 = 30.2 / ( 30.0 + 30.1 ); + + BOOST_CHECK_CLOSE( wgor1, ecl_sum_get_well_var( resp, 0, "W_1", "WGLR" ), 1e-5 ); + BOOST_CHECK_CLOSE( wgor2, ecl_sum_get_well_var( resp, 0, "W_2", "WGLR" ), 1e-5 ); + BOOST_CHECK_CLOSE( wgor3, ecl_sum_get_well_var( resp, 0, "W_3", "WGLR" ), 1e-5 ); + + BOOST_CHECK_CLOSE( wgor1, ecl_sum_get_well_var( resp, 0, "W_1", "WGLRH" ), 1e-5 ); + BOOST_CHECK_CLOSE( wgor2, ecl_sum_get_well_var( resp, 0, "W_2", "WGLRH" ), 1e-5 ); + BOOST_CHECK_CLOSE( 0, ecl_sum_get_well_var( resp, 0, "W_3", "WGLRH" ), 1e-5 ); +} + BOOST_AUTO_TEST_CASE(WBHP) { setup cfg( "sum_test_WBHP" );