From 8ff67bd4a1d836ac1150edfe03ddd68aaa08e474 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 5 Jan 2016 11:47:20 +0100 Subject: [PATCH 1/2] Removed erroneous test data. --- tests/test_norne_pvt.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_norne_pvt.cpp b/tests/test_norne_pvt.cpp index 9905bfd03..3bc92bddf 100644 --- a/tests/test_norne_pvt.cpp +++ b/tests/test_norne_pvt.cpp @@ -76,7 +76,8 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) { 61, 61, 70, 70, 80, 80, - 100, 100, 100}; + 100, 100 , + 100}; std::vector P = {114, 148, @@ -86,7 +87,7 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) { 194, 228, 214, 248, 234, 268, - 270 , 300, 330}; + 270 }; std::vector mu_expected = {0.00106736588, 0.00113961037, @@ -96,7 +97,7 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) { 0.00072883113, 0.00076988665, 0.00068250424, 0.00072040786, 0.00062347677, 0.00064963306, - 0.00065122911, 0.00409946846, 0.00472871311}; + 0.00065122911}; std::vector b_expected = {0.88421444595, 0.88893909117, @@ -106,7 +107,7 @@ void verify_norne_oil_pvt_region2(const TableManager& tableManager) { 0.81904041272, 0.82404719615, 0.80341044483, 0.80845950744, 0.77131381726, 0.77661604334, - 0.77691738473, 0.98268067196, 0.98617572121}; + 0.77691738473}; { std::vector tableIndex(P.size() , 0); From 718ec8e7917cbcc06ec5dc338004a44bf1334795 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 5 Jan 2016 12:12:29 +0100 Subject: [PATCH 2/2] Changed to use new table api from opm-parser. --- opm/core/props/rock/RockCompressibility.cpp | 10 ++++--- opm/core/props/satfunc/RelpermDiagnostics.cpp | 26 +++++++++---------- opm/core/simulator/initStateEquil.hpp | 12 ++++++--- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/opm/core/props/rock/RockCompressibility.cpp b/opm/core/props/rock/RockCompressibility.cpp index af84c8094..8ee859d6d 100644 --- a/opm/core/props/rock/RockCompressibility.cpp +++ b/opm/core/props/rock/RockCompressibility.cpp @@ -50,9 +50,13 @@ namespace Opm if (rocktabTables.size() != 1) OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB."); - p_ = rocktabTable.getPressureColumn(); - poromult_ = rocktabTable.getPoreVolumeMultiplierColumn(); - transmult_ = rocktabTable.getTransmissibilityMultiplierColumn(); + p_ = rocktabTable.getColumn("PO").vectorCopy( ); + poromult_ = rocktabTable.getColumn("PV_MULT").vectorCopy(); + if (rocktabTable.hasColumn("PV_MULT_TRAN")) { + transmult_ = rocktabTable.getColumn("PV_MULT_TRAN").vectorCopy(); + } else { + transmult_ = rocktabTable.getColumn("PV_MULT_TRANX").vectorCopy(); + } } else if (deck->hasKeyword("ROCK")) { Opm::DeckKeywordConstPtr rockKeyword = deck->getKeyword("ROCK"); if (rockKeyword->size() != 1) { diff --git a/opm/core/props/satfunc/RelpermDiagnostics.cpp b/opm/core/props/satfunc/RelpermDiagnostics.cpp index c886fc4dd..073bd7bc8 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics.cpp +++ b/opm/core/props/satfunc/RelpermDiagnostics.cpp @@ -541,27 +541,25 @@ namespace Opm{ if (fluidSystem_ == FluidSystem::BlackOil) { if (satFamily_ == SaturationFunctionFamily::FamilyI) { if (!sgofTables.empty()) { - auto sg = sgofTables.getTable(satnumIdx).getSgColumn(); - auto krog = sgofTables.getTable(satnumIdx).getKrogColumn(); - krog_value=Opm::linearInterpolation(sg, krog,unscaledEpsInfo_[satnumIdx].Sgl); + const auto& table = sgofTables.getTable(satnumIdx); + krog_value = table.evaluate( "KROG" , unscaledEpsInfo_[satnumIdx].Sgl ); } else { assert(!slgofTables.empty()); - auto sl = slgofTables.getTable(satnumIdx).getSlColumn(); - auto krog = slgofTables.getTable(satnumIdx).getKrogColumn(); - krog_value=Opm::linearInterpolation(sl, krog, unscaledEpsInfo_[satnumIdx].Sgl); + const auto& table = slgofTables.getTable(satnumIdx); + krog_value = table.evaluate( "KROG" , unscaledEpsInfo_[satnumIdx].Sgl ); + } + { + const auto& table = swofTables.getTable(satnumIdx); + krow_value = table.evaluate("KROW" , unscaledEpsInfo_[satnumIdx].Swl); } - auto sw = swofTables.getTable(satnumIdx).getSwColumn(); - auto krow = swofTables.getTable(satnumIdx).getKrowColumn(); - krow_value = Opm::linearInterpolation(sw, krow,unscaledEpsInfo_[satnumIdx].Swl); } if (satFamily_ == SaturationFunctionFamily::FamilyII) { assert(!sof3Tables.empty()); + const auto& table = sof3Tables.getTable(satnumIdx); const double Sou = 1.- unscaledEpsInfo_[satnumIdx].Swl - unscaledEpsInfo_[satnumIdx].Sgl; - auto so = sof3Tables.getTable(satnumIdx).getSoColumn(); - auto krow = sof3Tables.getTable(satnumIdx).getKrowColumn(); - auto krog = sof3Tables.getTable(satnumIdx).getKrogColumn(); - krow_value = Opm::linearInterpolation(so, krow, Sou); - krog_value = Opm::linearInterpolation(so, krog, Sou); + + krow_value = table.evaluate("KROW" , Sou); + krog_value = table.evaluate("KROG" , Sou); } if (krow_value != krog_value) { std::string msg = "Warning: Krow(sSomax) should equal Krog(Somax)."; diff --git a/opm/core/simulator/initStateEquil.hpp b/opm/core/simulator/initStateEquil.hpp index 6ce7f96bb..e439d0805 100644 --- a/opm/core/simulator/initStateEquil.hpp +++ b/opm/core/simulator/initStateEquil.hpp @@ -294,10 +294,11 @@ namespace Opm if (rec[i].live_oil_table_index > 0) { if (rsvdTables.size() > 0 && size_t(rec[i].live_oil_table_index) <= rsvdTables.size()) { const RsvdTable& rsvdTable = rsvdTables.getTable(i); + std::vector depthColumn = rsvdTable.getColumn("DEPTH").vectorCopy(); + std::vector rsColumn = rsvdTable.getColumn("RS").vectorCopy(); rs_func_.push_back(std::make_shared(props, cell, - rsvdTable.getDepthColumn(), - rsvdTable.getRsColumn())); + depthColumn , rsColumn)); } else { OPM_THROW(std::runtime_error, "Cannot initialise: RSVD table " << (rec[i].live_oil_table_index) << " not available."); } @@ -327,10 +328,13 @@ namespace Opm if (rec[i].wet_gas_table_index > 0) { if (rvvdTables.size() > 0 && size_t(rec[i].wet_gas_table_index) <= rvvdTables.size()) { const RvvdTable& rvvdTable = rvvdTables.getTable(i); + std::vector depthColumn = rvvdTable.getColumn("DEPTH").vectorCopy(); + std::vector rvColumn = rvvdTable.getColumn("RV").vectorCopy(); + rv_func_.push_back(std::make_shared(props, cell, - rvvdTable.getDepthColumn(), - rvvdTable.getRvColumn())); + depthColumn , rvColumn)); + } else { OPM_THROW(std::runtime_error, "Cannot initialise: RVVD table " << (rec[i].wet_gas_table_index) << " not available."); }