adapt the the table related API changes of opm-parser

This commit is contained in:
Andreas Lauser 2014-09-17 12:44:40 +02:00
parent 18dd2c6e39
commit 87adfef018

View File

@ -27,7 +27,6 @@
#include <opm/core/utility/RegionMapping.hpp> #include <opm/core/utility/RegionMapping.hpp>
#include <opm/core/utility/Units.hpp> #include <opm/core/utility/Units.hpp>
#include <opm/parser/eclipse/Utility/EquilWrapper.hpp> #include <opm/parser/eclipse/Utility/EquilWrapper.hpp>
#include <opm/parser/eclipse/Utility/SingleRecordTable.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <array> #include <array>
@ -279,15 +278,15 @@ namespace Opm
// Create Rs functions. // Create Rs functions.
rs_func_.reserve(rec.size()); rs_func_.reserve(rec.size());
if (deck->hasKeyword("DISGAS")) { if (deck->hasKeyword("DISGAS")) {
const std::vector<RsvdTable>& rsvdTables = eclipseState->getRsvdTables();
for (size_t i = 0; i < rec.size(); ++i) { for (size_t i = 0; i < rec.size(); ++i) {
const int cell = *(eqlmap.cells(i).begin()); const int cell = *(eqlmap.cells(i).begin());
if (rec[i].live_oil_table_index > 0) { if (rec[i].live_oil_table_index > 0) {
if (deck->hasKeyword("RSVD") && if (rsvdTables.size() > 0 && size_t(rec[i].live_oil_table_index) <= rsvdTables.size()) {
size_t(rec[i].live_oil_table_index) <= deck->getKeyword("RSVD")->size()) { rs_func_.push_back(std::make_shared<Miscibility::RsVD>(props,
Opm::SingleRecordTable rsvd(deck->getKeyword("RSVD"),std::vector<std::string>{"vd", "rs"},rec[i].live_oil_table_index-1); cell,
std::vector<double> vd(rsvd.getColumn("vd")); rsvdTables[i].getDepthColumn(),
std::vector<double> rs(rsvd.getColumn("rs")); rsvdTables[i].getRsColumn()));
rs_func_.push_back(std::make_shared<Miscibility::RsVD>(props, cell, vd, rs));
} else { } else {
OPM_THROW(std::runtime_error, "Cannot initialise: RSVD table " << (rec[i].live_oil_table_index) << " not available."); OPM_THROW(std::runtime_error, "Cannot initialise: RSVD table " << (rec[i].live_oil_table_index) << " not available.");
} }
@ -310,15 +309,15 @@ namespace Opm
rv_func_.reserve(rec.size()); rv_func_.reserve(rec.size());
if (deck->hasKeyword("VAPOIL")) { if (deck->hasKeyword("VAPOIL")) {
const std::vector<RvvdTable>& rvvdTables = eclipseState->getRvvdTables();
for (size_t i = 0; i < rec.size(); ++i) { for (size_t i = 0; i < rec.size(); ++i) {
const int cell = *(eqlmap.cells(i).begin()); const int cell = *(eqlmap.cells(i).begin());
if (rec[i].wet_gas_table_index > 0) { if (rec[i].wet_gas_table_index > 0) {
if (deck->hasKeyword("RVVD") && if (rvvdTables.size() > 0 && size_t(rec[i].wet_gas_table_index) <= rvvdTables.size()) {
size_t(rec[i].wet_gas_table_index) <= deck->getKeyword("RVVD")->size()) { rv_func_.push_back(std::make_shared<Miscibility::RvVD>(props,
Opm::SingleRecordTable rvvd(deck->getKeyword("RVVD"),std::vector<std::string>{"vd", "rv"},rec[i].wet_gas_table_index-1); cell,
std::vector<double> vd(rvvd.getColumn("vd")); rvvdTables[i].getDepthColumn(),
std::vector<double> rv(rvvd.getColumn("rv")); rvvdTables[i].getRvColumn()));
rv_func_.push_back(std::make_shared<Miscibility::RvVD>(props, cell, vd, rv));
} else { } else {
OPM_THROW(std::runtime_error, "Cannot initialise: RVVD table " << (rec[i].wet_gas_table_index) << " not available."); OPM_THROW(std::runtime_error, "Cannot initialise: RVVD table " << (rec[i].wet_gas_table_index) << " not available.");
} }