WGLR+WGLRH support

This commit is contained in:
Jørgen Kvalsvik 2016-04-28 09:46:01 +02:00
parent eb7f6afae6
commit d7c5a43226
3 changed files with 47 additions and 0 deletions

View File

@ -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 */

View File

@ -197,6 +197,11 @@ WGOR
/
WGORH
/
WGLR
/
WGLRH
/
-- Performance
WBHP

View File

@ -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" );