Return zero for non-existing well/completion

To be consistent with the general summary behaviour and more input
tolerant, 0.0 is returned when some phase, completion or well is
requested that isn't provided by the simulator.

Solves the issue discussed in https://github.com/OPM/opm-output/pull/122
and extends the test input deck to trigger this behaviour.
This commit is contained in:
Jørgen Kvalsvik
2016-10-31 11:49:56 +01:00
parent b338943962
commit f2c895c701
4 changed files with 29 additions and 11 deletions

View File

@@ -121,9 +121,9 @@ BOOST_AUTO_TEST_CASE(get_completions) {
wellRates["OP_1"] = w1;
wellRates["OP_2"] = w2;
BOOST_CHECK_THROW( wellRates.get("NO_SUCH_WELL" , data::Rates::opt::wat), std::out_of_range);
BOOST_CHECK_EQUAL( 0.0, wellRates.get("NO_SUCH_WELL" , data::Rates::opt::wat) );
BOOST_CHECK_EQUAL( 5.67 , wellRates.get( "OP_1" , data::Rates::opt::wat));
BOOST_CHECK_THROW( wellRates.get("OP_2" , 10000 , data::Rates::opt::wat), std::out_of_range);
BOOST_CHECK_EQUAL( 0.0, wellRates.get("OP_2" , 10000 , data::Rates::opt::wat) );
BOOST_CHECK_EQUAL( 26.41 , wellRates.get( "OP_2" , 188 , data::Rates::opt::wat));
}