mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Using TableManager to get tables.
This commit is contained in:
parent
6365579866
commit
08a77e36d0
@ -44,18 +44,18 @@ namespace Opm
|
||||
Opm::EclipseStateConstPtr eclipseState)
|
||||
{
|
||||
isothermalPvt_ = isothermalPvt;
|
||||
|
||||
auto tables = eclipseState->getTableManager();
|
||||
int numRegions;
|
||||
if (deck->hasKeyword("PVTG"))
|
||||
numRegions = eclipseState->getPvtgTables().size();
|
||||
numRegions = tables->getPvtgTables().size();
|
||||
else if (deck->hasKeyword("PVDG"))
|
||||
numRegions = eclipseState->getPvdgTables().size();
|
||||
numRegions = tables->getPvdgTables().size();
|
||||
else
|
||||
OPM_THROW(std::runtime_error, "Gas phase was not initialized using a known way");
|
||||
|
||||
// viscosity
|
||||
if (deck->hasKeyword("GASVISCT")) {
|
||||
gasvisctTables_ = &eclipseState->getGasvisctTables();
|
||||
gasvisctTables_ = &tables->getGasvisctTables();
|
||||
assert(int(gasvisctTables_->size()) == numRegions);
|
||||
|
||||
gasCompIdx_ = deck->getKeyword("GCOMPIDX")->getRecord(0)->getItem("GAS_COMPONENT_INDEX")->getInt(0) - 1;
|
||||
|
@ -46,10 +46,12 @@ namespace Opm
|
||||
isothermalPvt_ = isothermalPvt;
|
||||
|
||||
int numRegions;
|
||||
auto tables = eclipseState->getTableManager();
|
||||
|
||||
if (deck->hasKeyword("PVTO"))
|
||||
numRegions = eclipseState->getPvtoTables().size();
|
||||
numRegions = tables->getPvtoTables().size();
|
||||
else if (deck->hasKeyword("PVDO"))
|
||||
numRegions = eclipseState->getPvdoTables().size();
|
||||
numRegions = tables->getPvdoTables().size();
|
||||
else if (deck->hasKeyword("PVCDO"))
|
||||
numRegions = deck->getKeyword("PVCDO")->size();
|
||||
else
|
||||
@ -57,7 +59,7 @@ namespace Opm
|
||||
|
||||
// viscosity
|
||||
if (deck->hasKeyword("VISCREF")) {
|
||||
oilvisctTables_ = &eclipseState->getOilvisctTables();
|
||||
oilvisctTables_ = &tables->getOilvisctTables();
|
||||
Opm::DeckKeywordConstPtr viscrefKeyword = deck->getKeyword("VISCREF");
|
||||
|
||||
assert(int(oilvisctTables_->size()) == numRegions);
|
||||
|
@ -65,7 +65,8 @@ namespace Opm
|
||||
// quantities required for the temperature dependence of the viscosity
|
||||
// (basically we expect well-behaved VISCREF and WATVISCT keywords.)
|
||||
if (deck->hasKeyword("VISCREF")) {
|
||||
watvisctTables_ = &eclipseState->getWatvisctTables();
|
||||
auto tables = eclipseState->getTableManager();
|
||||
watvisctTables_ = &tables->getWatvisctTables();
|
||||
Opm::DeckKeywordConstPtr viscrefKeyword = deck->getKeyword("VISCREF");
|
||||
|
||||
assert(int(watvisctTables_->size()) == numRegions);
|
||||
|
@ -43,7 +43,8 @@ namespace Opm
|
||||
: pref_(0.0),
|
||||
rock_comp_(0.0)
|
||||
{
|
||||
const auto& rocktabTables = eclipseState->getRocktabTables();
|
||||
const auto tables = eclipseState->getTableManager();
|
||||
const auto& rocktabTables = tables->getRocktabTables();
|
||||
if (rocktabTables.size() > 0) {
|
||||
if (rocktabTables.size() != 1)
|
||||
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB.");
|
||||
|
@ -594,6 +594,7 @@ namespace Opm
|
||||
std::vector<std::vector<double> > param_col;
|
||||
std::vector<std::vector<double> > depth_col;
|
||||
std::vector<std::string> col_names;
|
||||
std::shared_ptr<const TableManager> tables = eclipseState->getTableManager();
|
||||
|
||||
// Active keyword assigned default values for each cell (in case of possible box-wise assignment)
|
||||
if ((keyword[0] == 'S' && (useStateKeyword || hasENPTVD)) || (keyword[1] == 'S' && useStateKeyword) ) {
|
||||
@ -602,7 +603,7 @@ namespace Opm
|
||||
scaleparam.resize(number_of_cells);
|
||||
}
|
||||
if (!useKeyword && itab > 0) {
|
||||
const auto& enptvdTables = eclipseState->getEnptvdTables();
|
||||
const auto& enptvdTables = tables->getEnptvdTables();
|
||||
int num_tables = enptvdTables.size();
|
||||
param_col.resize(num_tables);
|
||||
depth_col.resize(num_tables);
|
||||
@ -667,7 +668,7 @@ namespace Opm
|
||||
OPM_THROW(std::runtime_error, " -- unknown keyword: '" << keyword << "'");
|
||||
}
|
||||
if (!useKeyword && itab > 0) {
|
||||
const auto& enkrvdTables = eclipseState->getEnkrvdTables();
|
||||
const auto& enkrvdTables = tables->getEnkrvdTables();
|
||||
int num_tables = enkrvdTables.size();
|
||||
param_col.resize(num_tables);
|
||||
depth_col.resize(num_tables);
|
||||
|
@ -281,14 +281,14 @@ namespace Opm
|
||||
{
|
||||
// Get the equilibration records.
|
||||
const std::vector<EquilRecord> rec = getEquil(deck);
|
||||
|
||||
std::shared_ptr<const TableManager> tables = eclipseState->getTableManager();
|
||||
// Create (inverse) region mapping.
|
||||
const RegionMapping<> eqlmap(equilnum(deck, eclipseState, G));
|
||||
|
||||
// Create Rs functions.
|
||||
rs_func_.reserve(rec.size());
|
||||
if (deck->hasKeyword("DISGAS")) {
|
||||
const std::vector<RsvdTable>& rsvdTables = eclipseState->getRsvdTables();
|
||||
const std::vector<RsvdTable>& rsvdTables = tables->getRsvdTables();
|
||||
for (size_t i = 0; i < rec.size(); ++i) {
|
||||
const int cell = *(eqlmap.cells(i).begin());
|
||||
if (rec[i].live_oil_table_index > 0) {
|
||||
@ -320,7 +320,7 @@ namespace Opm
|
||||
|
||||
rv_func_.reserve(rec.size());
|
||||
if (deck->hasKeyword("VAPOIL")) {
|
||||
const std::vector<RvvdTable>& rvvdTables = eclipseState->getRvvdTables();
|
||||
const std::vector<RvvdTable>& rvvdTables = tables->getRvvdTables();
|
||||
for (size_t i = 0; i < rec.size(); ++i) {
|
||||
const int cell = *(eqlmap.cells(i).begin());
|
||||
if (rec[i].wet_gas_table_index > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user