Merge pull request #948 from joakim-hove/unit-system-api-energy

Add missing energy to unit system measure table
This commit is contained in:
Joakim Hove 2019-08-15 11:07:01 +02:00 committed by GitHub
commit ee482b9a5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,8 @@ namespace Opm {
oil_inverse_formation_volume_factor,
water_inverse_formation_volume_factor,
liquid_productivity_index,
gas_productivity_index
gas_productivity_index,
energy
};
explicit UnitSystem(UnitType unit = UnitType::UNIT_TYPE_METRIC);

View File

@ -339,6 +339,7 @@ BOOST_AUTO_TEST_CASE(METRIC_UNITS)
BOOST_CHECK_CLOSE( metric.to_si( Meas::water_inverse_formation_volume_factor , 1.0 ) , 1.0 , 1.0e-10 );
BOOST_CHECK_CLOSE( metric.to_si( Meas::liquid_productivity_index , 1.0 ) , 1.1574074074074073e-10 , 1.0e-10 );
BOOST_CHECK_CLOSE( metric.to_si( Meas::gas_productivity_index , 1.0 ) , 1.1574074074074073e-10 , 1.0e-10 );
BOOST_CHECK_CLOSE( metric.to_si( Meas::energy, 1.0), 1000, 1e-10);
// ----------------------------------------------------------------
// SI -> METRIC
@ -371,6 +372,7 @@ BOOST_AUTO_TEST_CASE(METRIC_UNITS)
BOOST_CHECK_CLOSE( metric.from_si( Meas::water_inverse_formation_volume_factor , 1.0 ) , 1.0 , 1.0e-10 );
BOOST_CHECK_CLOSE( metric.from_si( Meas::liquid_productivity_index , 1.0 ) , 86.400e8 , 1.0e-10 );
BOOST_CHECK_CLOSE( metric.from_si( Meas::gas_productivity_index , 1.0 ) , 86.400e8 , 1.0e-10 );
BOOST_CHECK_CLOSE( metric.from_si( Meas::energy, 1000.0), 1, 1e-10);
}
BOOST_AUTO_TEST_CASE(FIELD_UNITS)