Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WTHPH+WBHPH keywords #222

Merged
merged 1 commit into from
Dec 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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