Read PVTW from EclipseState

Read the PVTW table entries from EclipseState rather than manually
through the Deck object.
This commit is contained in:
Jørgen Kvalsvik 2016-12-06 13:43:35 +01:00
parent 28a02f6953
commit f0b4c4f390
3 changed files with 13 additions and 19 deletions

View File

@ -32,7 +32,7 @@ namespace Opm
const UnstructuredGrid& grid)
{
rock_.init(eclState, grid.number_of_cells, grid.global_cell, grid.cartdims);
pvt_.init(deck);
pvt_.init(eclState, deck);
auto materialLawManager = std::make_shared<typename SaturationPropsFromDeck::MaterialLawManager>();
std::vector<int> compressedToCartesianIdx(grid.number_of_cells);

View File

@ -21,12 +21,10 @@
#include "config.h"
#include <opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp>
#include <opm/core/props/phaseUsageFromDeck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
namespace Opm
@ -36,7 +34,7 @@ namespace Opm
{
}
void PvtPropertiesIncompFromDeck::init(const Opm::Deck& deck)
void PvtPropertiesIncompFromDeck::init(const EclipseState& es, const Opm::Deck& deck)
{
// So far, this class only supports a single PVT region. TODO?
int region_number = 0;
@ -61,21 +59,15 @@ namespace Opm
// We will modify them with formation volume factors if found.
reservoir_density_ = surface_density_;
// Water viscosity.
if (deck.hasKeyword("PVTW")) {
const auto& pvtwRecord = deck.getKeyword("PVTW").getRecord(region_number);
if (pvtwRecord.getItem("WATER_COMPRESSIBILITY").getSIDouble(0) != 0.0 ||
pvtwRecord.getItem("WATER_VISCOSIBILITY").getSIDouble(0) != 0.0) {
OPM_MESSAGE("Compressibility effects in PVTW are ignored.");
}
reservoir_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] /= pvtwRecord.getItem("WATER_VOL_FACTOR").getSIDouble(0);
viscosity_[phase_usage.phase_pos[PhaseUsage::Aqua]] = pvtwRecord.getItem("WATER_VISCOSITY").getSIDouble(0);
} else {
// Eclipse 100 default.
// viscosity_[phase_usage.phase_pos[PhaseUsage::Aqua]] = 0.5*Opm::prefix::centi*Opm::unit::Poise;
OPM_THROW(std::runtime_error, "Input is missing PVTW\n");
const auto& pvtw = es.getTableManager().getPvtwTable().at( region_number );
if (pvtw.compressibility != 0.0 || pvtw.viscosibility != 0.0) {
OPM_MESSAGE("Compressibility effects in PVTW are ignored.");
}
reservoir_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] /= pvtw.volume_factor;
viscosity_[phase_usage.phase_pos[PhaseUsage::Aqua]] = pvtw.viscosity;
// Oil viscosity.
if (deck.hasKeyword("PVCDO")) {
const auto& pvcdoRecord = deck.getKeyword("PVCDO").getRecord(region_number);

View File

@ -21,6 +21,8 @@
#define OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <array>
namespace Opm
@ -38,7 +40,7 @@ namespace Opm
PvtPropertiesIncompFromDeck();
/// Initialize from deck.
void init(const Opm::Deck& deck);
void init(const EclipseState&, const Opm::Deck& deck);
/// Number of active phases.
int numPhases() const;