Skip to content

Commit

Permalink
Add WTHPH+WBHPH keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
Sveinung Styve Rundhovde (IT SI SIB) committed Dec 1, 2017
1 parent d879409 commit 6698381
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
33 changes: 33 additions & 0 deletions opm/output/eclipse/Summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,36 @@ inline quantity thp( const fn_args& args ) {
return { p->second.thp, measure::pressure };
}

inline quantity bhp_history( const fn_args& args ) {
if( args.timestep == 0 ) return { 0.0, measure::pressure };

const auto timestep = args.timestep - 1;
const Well* sched_well = args.schedule_wells.front();

double bhp_hist;
if ( sched_well->isProducer( timestep ) )
bhp_hist = sched_well->getProductionProperties( timestep ).BHPH;
else
bhp_hist = sched_well->getInjectionProperties( timestep ).BHPH;

return { bhp_hist, measure::pressure };
}

inline quantity thp_history( const fn_args& args ) {
if( args.timestep == 0 ) return { 0.0, measure::pressure };

const auto timestep = args.timestep - 1;
const Well* sched_well = args.schedule_wells.front();

double thp_hist;
if ( sched_well->isProducer( timestep ) )
thp_hist = sched_well->getProductionProperties( timestep ).THPH;
else
thp_hist = sched_well->getInjectionProperties( timestep ).THPH;

return { thp_hist, measure::pressure };
}

template< Phase phase >
inline quantity production_history( const fn_args& args ) {
/*
Expand Down Expand Up @@ -631,6 +661,9 @@ static const std::unordered_map< std::string, ofun > funs = {
sum( production_history< Phase::WATER >,
production_history< Phase::OIL > ) ) },

{ "WTHPH", thp_history },
{ "WBHPH", bhp_history },

{ "GWPRH", production_history< Phase::WATER > },
{ "GOPRH", production_history< Phase::OIL > },
{ "GGPRH", production_history< Phase::GAS > },
Expand Down
6 changes: 3 additions & 3 deletions tests/summary_deck.DATA
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,13 @@ WCONHIST
-- history rates are set so that W_1 produces 1, W_2 produces 2 etc.
-- index.offset.
-- organised as oil-water-gas
W_1 SHUT ORAT 10.1 10 10.2 /
W_2 SHUT ORAT 20.1 20 20.2 /
W_1 SHUT ORAT 10.1 10 10.2 2* 0.2 0.1 /
W_2 SHUT ORAT 20.1 20 20.2 2* 1.2 1.1 /
/

WCONINJH
-- Injection historical rates (water only, as we only support pure injectors)
W_3 WATER STOP 30.0 /
W_3 WATER STOP 30.0 2.1 2.2 /
/

TSTEP
Expand Down
10 changes: 10 additions & 0 deletions tests/test_Summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,16 @@ BOOST_AUTO_TEST_CASE(well_keywords) {
BOOST_CHECK_CLOSE( 0.2, ecl_sum_get_well_var( resp, 1, "W_1", "WTHP" ), 1e-5 );
BOOST_CHECK_CLOSE( 1.2, ecl_sum_get_well_var( resp, 1, "W_2", "WTHP" ), 1e-5 );
BOOST_CHECK_CLOSE( 2.2, ecl_sum_get_well_var( resp, 1, "W_3", "WTHP" ), 1e-5 );

/* BHP (history) */
BOOST_CHECK_CLOSE( 0.1, ecl_sum_get_well_var( resp, 1, "W_1", "WBHPH" ), 1e-5 );
BOOST_CHECK_CLOSE( 1.1, ecl_sum_get_well_var( resp, 1, "W_2", "WBHPH" ), 1e-5 );
BOOST_CHECK_CLOSE( 2.1, ecl_sum_get_well_var( resp, 1, "W_3", "WBHPH" ), 1e-5 );

/* THP (history) */
BOOST_CHECK_CLOSE( 0.2, ecl_sum_get_well_var( resp, 1, "W_1", "WTHPH" ), 1e-5 );
BOOST_CHECK_CLOSE( 1.2, ecl_sum_get_well_var( resp, 1, "W_2", "WTHPH" ), 1e-5 );
BOOST_CHECK_CLOSE( 2.2, ecl_sum_get_well_var( resp, 1, "W_3", "WTHPH" ), 1e-5 );
}

BOOST_AUTO_TEST_CASE(group_keywords) {
Expand Down

0 comments on commit 6698381

Please sign in to comment.