diff --git a/tests/test_vfpproperties.cpp b/tests/test_vfpproperties.cpp index fcfba4860..9ba9fb602 100644 --- a/tests/test_vfpproperties.cpp +++ b/tests/test_vfpproperties.cpp @@ -43,7 +43,8 @@ - +const double max_d_tol = 1.0e-12; +const double sad_tol = 1.0e-9; @@ -277,8 +278,8 @@ BOOST_AUTO_TEST_CASE(InterpolatePlane) } BOOST_CHECK_CLOSE(sum, reference_sum, 0.0001); - BOOST_CHECK_SMALL(max_d, 1.0e-10); - BOOST_CHECK_SMALL(sad, 1.0e-10); + BOOST_CHECK_SMALL(max_d, max_d_tol); + BOOST_CHECK_SMALL(sad, sad_tol); } @@ -326,8 +327,8 @@ BOOST_AUTO_TEST_CASE(ExtrapolatePlane) } BOOST_CHECK_CLOSE(sum, reference_sum, 0.0001); - BOOST_CHECK_SMALL(max_d, 1.0e-10); - BOOST_CHECK_SMALL(sad, 1.0e-10); + BOOST_CHECK_SMALL(max_d, max_d_tol); + BOOST_CHECK_SMALL(sad, sad_tol); } @@ -403,8 +404,8 @@ BOOST_AUTO_TEST_CASE(ExtrapolatePlaneADB) } BOOST_CHECK_CLOSE(sum, reference_sum, 0.0001); - BOOST_CHECK_SMALL(max_d, 1.0e-10); - BOOST_CHECK_SMALL(sad, 1.0e-10); + BOOST_CHECK_SMALL(max_d, max_d_tol); + BOOST_CHECK_SMALL(sad, sad_tol); } @@ -413,7 +414,7 @@ BOOST_AUTO_TEST_CASE(ExtrapolatePlaneADB) * Test that we can generate some dummy data representing an ND plane, * interpolate using well flow rates and ADBs as input, and compare against the analytic solution */ -BOOST_AUTO_TEST_CASE(Wells_Qs_thp_and_alq_interpolation) +BOOST_AUTO_TEST_CASE(InterpolateADBAndQs) { fillDataPlane(); initProperties(); @@ -495,8 +496,8 @@ BOOST_AUTO_TEST_CASE(Wells_Qs_thp_and_alq_interpolation) max_d = std::max(abs_diff, max_d); } - BOOST_CHECK_SMALL(sad, 1.0e-10); - BOOST_CHECK_SMALL(max_d, 1.0e-10); + BOOST_CHECK_SMALL(max_d, max_d_tol); + BOOST_CHECK_SMALL(sad, sad_tol); } @@ -573,17 +574,15 @@ BOOST_FIXTURE_TEST_SUITE( ConversionTests, ConversionFixture ) BOOST_AUTO_TEST_CASE(getFlo) { //Compute reference solutions - std::vector ref_flo_oil; - std::vector ref_flo_liq; - std::vector ref_flo_gas; + std::vector ref_flo_oil(num_wells); + std::vector ref_flo_liq(num_wells); + std::vector ref_flo_gas(num_wells); for (int i=0; i ref_wfr_wor(num_wells); + std::vector ref_wfr_wct(num_wells); + std::vector ref_wfr_wgr(num_wells); + for (int i=0; igetKeyword("VFPPROD" , i); + Opm::DeckKeywordConstPtr keyword = deck->getKeyword("VFPPROD", i); tables.push_back(Opm::VFPProdTable()); tables[i].init(keyword, units); - properties.push_back(Opm::VFPProperties(&tables[i])); + } + + for (int i=0; i convert to SM3/second + double f_i = liq[f]*1.1574074074074073e-05; //THP given as BARSA => convert to Pascal double t_i = thp[t]*100000.0; - //WCT given as fraction + //WCT given as fraction, SM3/SM3 double w_i = wct[w]; - //GOR given as SM3 + //GOR given as SM3 / SM3 double g_i = gor[g]; //ALQ unit not relevant in this case double a_i = 0.0; - //Value given as BARSA - //FIXME: should convert to Pascal when proper conversion in VFPProperties.cpp is in place - double value_i = properties[0].bhp(f_i, t_i, w_i, g_i, a_i); + //Value given as pascal, convert to barsa for comparison with reference + double value_i = properties[0].bhp(f_i, t_i, w_i, g_i, a_i) * 10.0e-6; double abs_diff = std::abs(value_i - reference[i]); sad += abs_diff; @@ -771,8 +781,8 @@ BOOST_AUTO_TEST_CASE(ParseVFPProdAndInterpolate) std::cout << "];" << std::endl; #endif - BOOST_CHECK_SMALL(max_d, 1.0e-10); - BOOST_CHECK_SMALL(sad, 1.0e-10); + BOOST_CHECK_SMALL(max_d, 1.0e-12); + BOOST_CHECK_SMALL(sad, 1.0e-9); } /**