Merge pull request #939 from joakim-hove/table-column

Table column
This commit is contained in:
Joakim Hove 2016-01-08 15:29:10 +01:00
commit 4a95eb2917
4 changed files with 32 additions and 25 deletions

View File

@ -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) {

View File

@ -541,27 +541,25 @@ namespace Opm{
if (fluidSystem_ == FluidSystem::BlackOil) {
if (satFamily_ == SaturationFunctionFamily::FamilyI) {
if (!sgofTables.empty()) {
auto sg = sgofTables.getTable<SgofTable>(satnumIdx).getSgColumn();
auto krog = sgofTables.getTable<SgofTable>(satnumIdx).getKrogColumn();
krog_value=Opm::linearInterpolation(sg, krog,unscaledEpsInfo_[satnumIdx].Sgl);
const auto& table = sgofTables.getTable<SgofTable>(satnumIdx);
krog_value = table.evaluate( "KROG" , unscaledEpsInfo_[satnumIdx].Sgl );
} else {
assert(!slgofTables.empty());
auto sl = slgofTables.getTable<SlgofTable>(satnumIdx).getSlColumn();
auto krog = slgofTables.getTable<SlgofTable>(satnumIdx).getKrogColumn();
krog_value=Opm::linearInterpolation(sl, krog, unscaledEpsInfo_[satnumIdx].Sgl);
const auto& table = slgofTables.getTable<SlgofTable>(satnumIdx);
krog_value = table.evaluate( "KROG" , unscaledEpsInfo_[satnumIdx].Sgl );
}
{
const auto& table = swofTables.getTable<SwofTable>(satnumIdx);
krow_value = table.evaluate("KROW" , unscaledEpsInfo_[satnumIdx].Swl);
}
auto sw = swofTables.getTable<SwofTable>(satnumIdx).getSwColumn();
auto krow = swofTables.getTable<SwofTable>(satnumIdx).getKrowColumn();
krow_value = Opm::linearInterpolation(sw, krow,unscaledEpsInfo_[satnumIdx].Swl);
}
if (satFamily_ == SaturationFunctionFamily::FamilyII) {
assert(!sof3Tables.empty());
const auto& table = sof3Tables.getTable<Sof3Table>(satnumIdx);
const double Sou = 1.- unscaledEpsInfo_[satnumIdx].Swl - unscaledEpsInfo_[satnumIdx].Sgl;
auto so = sof3Tables.getTable<Sof3Table>(satnumIdx).getSoColumn();
auto krow = sof3Tables.getTable<Sof3Table>(satnumIdx).getKrowColumn();
auto krog = sof3Tables.getTable<Sof3Table>(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).";

View File

@ -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<RsvdTable>(i);
std::vector<double> depthColumn = rsvdTable.getColumn("DEPTH").vectorCopy();
std::vector<double> rsColumn = rsvdTable.getColumn("RS").vectorCopy();
rs_func_.push_back(std::make_shared<Miscibility::RsVD>(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<RvvdTable>(i);
std::vector<double> depthColumn = rvvdTable.getColumn("DEPTH").vectorCopy();
std::vector<double> rvColumn = rvvdTable.getColumn("RV").vectorCopy();
rv_func_.push_back(std::make_shared<Miscibility::RvVD>(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.");
}

View File

@ -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<double> 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<double> 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<double> 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<int> tableIndex(P.size() , 0);