adapt the the table related API changes of opm-parser

This commit is contained in:
Andreas Lauser 2014-09-17 12:43:12 +02:00
parent 65ce6b4d22
commit 0f436e12c9
5 changed files with 18 additions and 22 deletions

View File

@ -108,7 +108,7 @@ try
// check_well_controls = param.getDefault("check_well_controls", false); // check_well_controls = param.getDefault("check_well_controls", false);
// max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10);
// Rock compressibility. // Rock compressibility.
rock_comp.reset(new RockCompressibility(deck)); rock_comp.reset(new RockCompressibility(deck, eclipseState));
// Gravity. // Gravity.
gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity; gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity;
// Init state variables (saturation and pressure). // Init state variables (saturation and pressure).

View File

@ -121,7 +121,7 @@ try
// check_well_controls = param.getDefault("check_well_controls", false); // check_well_controls = param.getDefault("check_well_controls", false);
// max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10);
// Rock compressibility. // Rock compressibility.
rock_comp.reset(new RockCompressibility(deck)); rock_comp.reset(new RockCompressibility(deck, eclipseState));
// Gravity. // Gravity.
gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity; gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity;
// Init state variables (saturation and pressure). // Init state variables (saturation and pressure).

View File

@ -128,7 +128,7 @@ try
// check_well_controls = param.getDefault("check_well_controls", false); // check_well_controls = param.getDefault("check_well_controls", false);
// max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10);
// Rock compressibility. // Rock compressibility.
rock_comp.reset(new RockCompressibility(deck)); rock_comp.reset(new RockCompressibility(deck, eclipseState));
// Gravity. // Gravity.
gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity; gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity;

View File

@ -157,7 +157,7 @@ try
// check_well_controls = param.getDefault("check_well_controls", false); // check_well_controls = param.getDefault("check_well_controls", false);
// max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10);
// Rock compressibility. // Rock compressibility.
rock_comp.reset(new RockCompressibility(deck)); rock_comp.reset(new RockCompressibility(deck, eclipseState));
// Gravity. // Gravity.
gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity; gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity;

View File

@ -34,11 +34,6 @@
#include <opm/parser/eclipse/Deck/Deck.hpp> #include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/Utility/PvtoTable.hpp>
#include <opm/parser/eclipse/Utility/PvtgTable.hpp>
#include <opm/parser/eclipse/Utility/PvtwTable.hpp>
#include <opm/parser/eclipse/Utility/PvdoTable.hpp>
#include <opm/parser/eclipse/Utility/PvcdoTable.hpp>
namespace Opm namespace Opm
{ {
@ -143,19 +138,20 @@ namespace Opm
if (phase_usage_.phase_used[Liquid]) { if (phase_usage_.phase_used[Liquid]) {
// for oil, we support the "PVDO", "PVTO" and "PVCDO" // for oil, we support the "PVDO", "PVTO" and "PVCDO"
// keywords... // keywords...
if (deck->hasKeyword("PVDO")) { const auto& pvdoTables = eclState->getPvdoTables();
Opm::DeckKeywordConstPtr pvdoKeyword = deck->getKeyword("PVDO"); const auto& pvtoTables = eclState->getPvtoTables();
if (!pvdoTables.empty()) {
if (numSamples > 0) { if (numSamples > 0) {
auto splinePvt = std::shared_ptr<PvtDeadSpline>(new PvtDeadSpline); auto splinePvt = std::shared_ptr<PvtDeadSpline>(new PvtDeadSpline);
splinePvt->initFromOil(pvdoKeyword, numSamples); splinePvt->initFromOil(pvdoTables, numSamples);
props_[phase_usage_.phase_pos[Liquid]] = splinePvt; props_[phase_usage_.phase_pos[Liquid]] = splinePvt;
} else { } else {
auto deadPvt = std::shared_ptr<PvtDead>(new PvtDead); auto deadPvt = std::shared_ptr<PvtDead>(new PvtDead);
deadPvt->initFromOil(pvdoKeyword); deadPvt->initFromOil(pvdoTables);
props_[phase_usage_.phase_pos[Liquid]] = deadPvt; props_[phase_usage_.phase_pos[Liquid]] = deadPvt;
} }
} else if (deck->hasKeyword("PVTO")) { } else if (!pvtoTables.empty()) {
props_[phase_usage_.phase_pos[Liquid]].reset(new PvtLiveOil(deck->getKeyword("PVTO"))); props_[phase_usage_.phase_pos[Liquid]].reset(new PvtLiveOil(pvtoTables));
} else if (deck->hasKeyword("PVCDO")) { } else if (deck->hasKeyword("PVCDO")) {
std::shared_ptr<PvtConstCompr> pvcdo(new PvtConstCompr); std::shared_ptr<PvtConstCompr> pvcdo(new PvtConstCompr);
pvcdo->initFromOil(deck->getKeyword("PVCDO")); pvcdo->initFromOil(deck->getKeyword("PVCDO"));
@ -168,22 +164,22 @@ namespace Opm
// Gas PVT // Gas PVT
if (phase_usage_.phase_used[Vapour]) { if (phase_usage_.phase_used[Vapour]) {
// gas can be specified using the "PVDG" or "PVTG" keywords... // gas can be specified using the "PVDG" or "PVTG" keywords...
if (deck->hasKeyword("PVDG")) { const auto& pvdgTables = eclState->getPvdgTables();
Opm::DeckKeywordConstPtr pvdgKeyword = deck->getKeyword("PVDG"); const auto& pvtgTables = eclState->getPvtgTables();
if (!pvdgTables.empty()) {
if (numSamples > 0) { if (numSamples > 0) {
std::shared_ptr<PvtDeadSpline> splinePvt(new PvtDeadSpline); std::shared_ptr<PvtDeadSpline> splinePvt(new PvtDeadSpline);
splinePvt->initFromGas(pvdgKeyword, numSamples); splinePvt->initFromGas(pvdgTables, numSamples);
props_[phase_usage_.phase_pos[Vapour]] = splinePvt; props_[phase_usage_.phase_pos[Vapour]] = splinePvt;
} else { } else {
std::shared_ptr<PvtDead> deadPvt(new PvtDead); std::shared_ptr<PvtDead> deadPvt(new PvtDead);
deadPvt->initFromGas(pvdgKeyword); deadPvt->initFromGas(pvdgTables);
props_[phase_usage_.phase_pos[Vapour]] = deadPvt; props_[phase_usage_.phase_pos[Vapour]] = deadPvt;
} }
} else if (deck->hasKeyword("PVTG")) { } else if (!pvtgTables.empty()) {
props_[phase_usage_.phase_pos[Vapour]].reset(new PvtLiveGas(deck->getKeyword("PVTG"))); props_[phase_usage_.phase_pos[Vapour]].reset(new PvtLiveGas(pvtgTables));
} else { } else {
OPM_THROW(std::runtime_error, "Input is missing PVDG or PVTG\n"); OPM_THROW(std::runtime_error, "Input is missing PVDG or PVTG\n");
} }