mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add opm-parser variants for the incompressible property classes
This commit is contained in:
parent
97d1a36686
commit
eb656c60ec
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
|
||||||
IncompPropertiesFromDeck::IncompPropertiesFromDeck(const EclipseGridParser& deck,
|
IncompPropertiesFromDeck::IncompPropertiesFromDeck(const EclipseGridParser& deck,
|
||||||
const UnstructuredGrid& grid)
|
const UnstructuredGrid& grid)
|
||||||
{
|
{
|
||||||
@ -39,6 +38,18 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IncompPropertiesFromDeck::IncompPropertiesFromDeck(Opm::DeckConstPtr newParserDeck,
|
||||||
|
const UnstructuredGrid& grid)
|
||||||
|
{
|
||||||
|
rock_.init(newParserDeck, grid.number_of_cells, grid.global_cell, grid.cartdims);
|
||||||
|
pvt_.init(newParserDeck);
|
||||||
|
satprops_.init(newParserDeck, grid, 200);
|
||||||
|
if (pvt_.numPhases() != satprops_.numPhases()) {
|
||||||
|
OPM_THROW(std::runtime_error, "IncompPropertiesFromDeck::IncompPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
|
||||||
|
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ").");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IncompPropertiesFromDeck::~IncompPropertiesFromDeck()
|
IncompPropertiesFromDeck::~IncompPropertiesFromDeck()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,11 @@
|
|||||||
#ifndef OPM_INCOMPPROPERTIESFROMDECK_HEADER_INCLUDED
|
#ifndef OPM_INCOMPPROPERTIESFROMDECK_HEADER_INCLUDED
|
||||||
#define OPM_INCOMPPROPERTIESFROMDECK_HEADER_INCLUDED
|
#define OPM_INCOMPPROPERTIESFROMDECK_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <opm/core/props/IncompPropertiesInterface.hpp>
|
#include <opm/core/props/IncompPropertiesInterface.hpp>
|
||||||
#include <opm/core/props/rock/RockFromDeck.hpp>
|
#include <opm/core/props/rock/RockFromDeck.hpp>
|
||||||
#include <opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp>
|
#include <opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp>
|
||||||
#include <opm/core/props/satfunc/SaturationPropsFromDeck.hpp>
|
#include <opm/core/props/satfunc/SaturationPropsFromDeck.hpp>
|
||||||
#include <opm/core/io/eclipse/EclipseGridParser.hpp>
|
|
||||||
|
|
||||||
struct UnstructuredGrid;
|
struct UnstructuredGrid;
|
||||||
|
|
||||||
@ -53,6 +53,14 @@ namespace Opm
|
|||||||
IncompPropertiesFromDeck(const EclipseGridParser& deck,
|
IncompPropertiesFromDeck(const EclipseGridParser& deck,
|
||||||
const UnstructuredGrid& grid);
|
const UnstructuredGrid& grid);
|
||||||
|
|
||||||
|
/// Initialize from deck and grid.
|
||||||
|
/// \param deck Deck input parser
|
||||||
|
/// \param grid Grid to which property object applies, needed for the
|
||||||
|
/// mapping from cell indices (typically from a processed grid)
|
||||||
|
/// to logical cartesian indices consistent with the deck.
|
||||||
|
IncompPropertiesFromDeck(Opm::DeckConstPtr newParserDeck,
|
||||||
|
const UnstructuredGrid& grid);
|
||||||
|
|
||||||
/// Destructor.
|
/// Destructor.
|
||||||
virtual ~IncompPropertiesFromDeck();
|
virtual ~IncompPropertiesFromDeck();
|
||||||
|
|
||||||
|
@ -88,6 +88,61 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PvtPropertiesIncompFromDeck::init(Opm::DeckConstPtr newParserDeck )
|
||||||
|
{
|
||||||
|
// If we need multiple regions, this class and the SinglePvt* classes must change.
|
||||||
|
int region_number = 0;
|
||||||
|
|
||||||
|
PhaseUsage phase_usage = phaseUsageFromDeck(newParserDeck);
|
||||||
|
if (phase_usage.phase_used[PhaseUsage::Vapour] ||
|
||||||
|
!phase_usage.phase_used[PhaseUsage::Aqua] ||
|
||||||
|
!phase_usage.phase_used[PhaseUsage::Liquid]) {
|
||||||
|
OPM_THROW(std::runtime_error, "PvtPropertiesIncompFromDeck::init() -- must have gas and oil phases (only) in deck input.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Surface densities. Accounting for different orders in eclipse and our code.
|
||||||
|
if (newParserDeck->hasKeyword("DENSITY")) {
|
||||||
|
Opm::DeckRecordConstPtr densityRecord = newParserDeck->getKeyword("DENSITY")->getRecord(region_number);
|
||||||
|
surface_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] = densityRecord->getItem("OIL")->getSIDouble(0);
|
||||||
|
surface_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] = densityRecord->getItem("WATER")->getSIDouble(0);
|
||||||
|
} else {
|
||||||
|
OPM_THROW(std::runtime_error, "Input is missing DENSITY\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make reservoir densities the same as surface densities initially.
|
||||||
|
// We will modify them with formation volume factors if found.
|
||||||
|
reservoir_density_ = surface_density_;
|
||||||
|
|
||||||
|
// Water viscosity.
|
||||||
|
if (newParserDeck->hasKeyword("PVTW")) {
|
||||||
|
Opm::DeckRecordConstPtr pvtwRecord = newParserDeck->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");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Oil viscosity.
|
||||||
|
if (newParserDeck->hasKeyword("PVCDO")) {
|
||||||
|
Opm::DeckRecordConstPtr pvcdoRecord = newParserDeck->getKeyword("PVCDO")->getRecord(region_number);
|
||||||
|
|
||||||
|
if (pvcdoRecord->getItem("OIL_COMPRESSIBILITY")->getSIDouble(0) != 0.0 ||
|
||||||
|
pvcdoRecord->getItem("OIL_VISCOSIBILITY")->getSIDouble(0) != 0.0) {
|
||||||
|
OPM_MESSAGE("Compressibility effects in PVCDO are ignored.");
|
||||||
|
}
|
||||||
|
reservoir_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] /= pvcdoRecord->getItem("OIL_VOL_FACTOR")->getSIDouble(0);
|
||||||
|
viscosity_[phase_usage.phase_pos[PhaseUsage::Liquid]] = pvcdoRecord->getItem("OIL_VISCOSITY")->getSIDouble(0);
|
||||||
|
} else {
|
||||||
|
OPM_THROW(std::runtime_error, "Input is missing PVCDO\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const double* PvtPropertiesIncompFromDeck::surfaceDensities() const
|
const double* PvtPropertiesIncompFromDeck::surfaceDensities() const
|
||||||
{
|
{
|
||||||
return surface_density_.data();
|
return surface_density_.data();
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
#ifndef OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED
|
#ifndef OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED
|
||||||
#define OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED
|
#define OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include <opm/core/io/eclipse/EclipseGridParser.hpp>
|
#include <opm/core/io/eclipse/EclipseGridParser.hpp>
|
||||||
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@ -41,6 +41,9 @@ namespace Opm
|
|||||||
/// Initialize from deck.
|
/// Initialize from deck.
|
||||||
void init(const EclipseGridParser& deck);
|
void init(const EclipseGridParser& deck);
|
||||||
|
|
||||||
|
/// Initialize from deck.
|
||||||
|
void init(Opm::DeckConstPtr newParserDeck);
|
||||||
|
|
||||||
/// Number of active phases.
|
/// Number of active phases.
|
||||||
int numPhases() const;
|
int numPhases() const;
|
||||||
|
|
||||||
|
@ -63,6 +63,18 @@ namespace Opm
|
|||||||
const UnstructuredGrid& grid,
|
const UnstructuredGrid& grid,
|
||||||
const int samples);
|
const int samples);
|
||||||
|
|
||||||
|
/// Initialize from deck and grid.
|
||||||
|
/// \param[in] deck Deck input parser
|
||||||
|
/// \param[in] grid Grid to which property object applies, needed for the
|
||||||
|
/// mapping from cell indices (typically from a processed grid)
|
||||||
|
/// to logical cartesian indices consistent with the deck.
|
||||||
|
/// \param[in] samples Number of uniform sample points for saturation tables.
|
||||||
|
/// NOTE: samples will only be used with the SatFuncSetUniform template argument.
|
||||||
|
void init(Opm::DeckConstPtr newParserDeck,
|
||||||
|
const UnstructuredGrid& grid,
|
||||||
|
const int samples);
|
||||||
|
|
||||||
|
|
||||||
/// Initialize from deck and grid.
|
/// Initialize from deck and grid.
|
||||||
/// \param[in] deck Deck input parser
|
/// \param[in] deck Deck input parser
|
||||||
/// \param[in] number_of_cells The number of cells of the grid to which property
|
/// \param[in] number_of_cells The number of cells of the grid to which property
|
||||||
@ -84,23 +96,7 @@ namespace Opm
|
|||||||
const T& begin_cell_centroids,
|
const T& begin_cell_centroids,
|
||||||
int dimensions,
|
int dimensions,
|
||||||
const int samples);
|
const int samples);
|
||||||
|
|
||||||
/// Initialize from deck and grid.
|
|
||||||
/// \param[in] newParserDeck Deck input parser
|
|
||||||
/// \param[in] grid Grid to which property object applies, needed for the
|
|
||||||
/// mapping from cell indices (typically from a processed grid)
|
|
||||||
/// to logical cartesian indices consistent with the deck.
|
|
||||||
/// \param[in] samples Number of uniform sample points for saturation tables.
|
|
||||||
/// NOTE: samples will only be used with the SatFuncSetUniform template argument.
|
|
||||||
void init(Opm::DeckConstPtr newParserDeck,
|
|
||||||
const UnstructuredGrid& grid,
|
|
||||||
const int samples);
|
|
||||||
|
|
||||||
/// Initialize from deck and grid.
|
|
||||||
/// \param[in] newParserDeck Deck input parser
|
|
||||||
/// \param[in] number_of_cells The number of cells of the grid to which property
|
|
||||||
/// object applies, needed for the
|
|
||||||
/// mapping from cell indices (typically from a processed
|
|
||||||
/// grid) to logical cartesian indices consistent with the
|
/// grid) to logical cartesian indices consistent with the
|
||||||
/// deck.
|
/// deck.
|
||||||
/// \param[in] global_cell The mapping from local cell indices of the grid to
|
/// \param[in] global_cell The mapping from local cell indices of the grid to
|
||||||
|
@ -57,6 +57,18 @@ namespace Opm
|
|||||||
grid.dimensions, samples);
|
grid.dimensions, samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Initialize from deck.
|
||||||
|
template <class SatFuncSet>
|
||||||
|
void SaturationPropsFromDeck<SatFuncSet>::init(Opm::DeckConstPtr newParserDeck,
|
||||||
|
const UnstructuredGrid& grid,
|
||||||
|
const int samples)
|
||||||
|
{
|
||||||
|
init(newParserDeck, grid.number_of_cells,
|
||||||
|
grid.global_cell, grid.cell_centroids,
|
||||||
|
grid.dimensions, samples);
|
||||||
|
}
|
||||||
|
|
||||||
/// Initialize from deck.
|
/// Initialize from deck.
|
||||||
template <class SatFuncSet>
|
template <class SatFuncSet>
|
||||||
template< class T>
|
template< class T>
|
||||||
@ -157,18 +169,6 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Initialize from deck.
|
|
||||||
template <class SatFuncSet>
|
|
||||||
void SaturationPropsFromDeck<SatFuncSet>::init(Opm::DeckConstPtr newParserDeck,
|
|
||||||
const UnstructuredGrid& grid,
|
|
||||||
const int samples)
|
|
||||||
{
|
|
||||||
this->template init<SatFuncSet>(newParserDeck, grid.number_of_cells,
|
|
||||||
grid.global_cell, grid.cell_centroids,
|
|
||||||
grid.dimensions, samples);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Initialize from deck.
|
/// Initialize from deck.
|
||||||
template <class SatFuncSet>
|
template <class SatFuncSet>
|
||||||
template<class T>
|
template<class T>
|
||||||
|
Loading…
Reference in New Issue
Block a user