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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user