mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Read PVTW from EclipseState
Read the PVTW table entries from EclipseState rather than manually through the Deck object.
This commit is contained in:
parent
7f4c23812a
commit
f8b1bef974
@ -32,7 +32,7 @@ namespace Opm
|
|||||||
const UnstructuredGrid& grid)
|
const UnstructuredGrid& grid)
|
||||||
{
|
{
|
||||||
rock_.init(eclState, grid.number_of_cells, grid.global_cell, grid.cartdims);
|
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>();
|
auto materialLawManager = std::make_shared<typename SaturationPropsFromDeck::MaterialLawManager>();
|
||||||
|
|
||||||
std::vector<int> compressedToCartesianIdx(grid.number_of_cells);
|
std::vector<int> compressedToCartesianIdx(grid.number_of_cells);
|
||||||
|
@ -21,12 +21,10 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp>
|
#include <opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp>
|
||||||
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/Units/Units.hpp>
|
#include <opm/parser/eclipse/Units/Units.hpp>
|
||||||
#include <opm/common/ErrorMacros.hpp>
|
#include <opm/common/ErrorMacros.hpp>
|
||||||
#include <opm/core/props/BlackoilPhases.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
|
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?
|
// So far, this class only supports a single PVT region. TODO?
|
||||||
int region_number = 0;
|
int region_number = 0;
|
||||||
@ -61,20 +59,14 @@ namespace Opm
|
|||||||
// We will modify them with formation volume factors if found.
|
// We will modify them with formation volume factors if found.
|
||||||
reservoir_density_ = surface_density_;
|
reservoir_density_ = surface_density_;
|
||||||
|
|
||||||
// Water viscosity.
|
const auto& pvtw = es.getTableManager().getPvtwTable().at( region_number );
|
||||||
if (deck.hasKeyword("PVTW")) {
|
|
||||||
const auto& pvtwRecord = deck.getKeyword("PVTW").getRecord(region_number);
|
if (pvtw.compressibility != 0.0 || pvtw.viscosibility != 0.0) {
|
||||||
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.");
|
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);
|
reservoir_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] /= pvtw.volume_factor;
|
||||||
} else {
|
viscosity_[phase_usage.phase_pos[PhaseUsage::Aqua]] = pvtw.viscosity;
|
||||||
// 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");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Oil viscosity.
|
// Oil viscosity.
|
||||||
if (deck.hasKeyword("PVCDO")) {
|
if (deck.hasKeyword("PVCDO")) {
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#define OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED
|
#define OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@ -38,7 +40,7 @@ namespace Opm
|
|||||||
PvtPropertiesIncompFromDeck();
|
PvtPropertiesIncompFromDeck();
|
||||||
|
|
||||||
/// Initialize from deck.
|
/// Initialize from deck.
|
||||||
void init(const Opm::Deck& deck);
|
void init(const EclipseState&, const Opm::Deck& deck);
|
||||||
|
|
||||||
/// Number of active phases.
|
/// Number of active phases.
|
||||||
int numPhases() const;
|
int numPhases() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user