mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #150 from andlaus/enable_property_modifiers
glue in support for property modifiers
This commit is contained in:
commit
aecfa3ed50
@ -110,7 +110,7 @@ try
|
|||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new GridManager(deck));
|
grid.reset(new GridManager(deck));
|
||||||
// Rock and fluid init
|
// Rock and fluid init
|
||||||
props.reset(new BlackoilPropertiesFromDeck(deck, *grid->c_grid(), param));
|
props.reset(new BlackoilPropertiesFromDeck(deck, eclipseState, *grid->c_grid(), param));
|
||||||
// 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.
|
||||||
|
@ -117,7 +117,7 @@ try
|
|||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new GridManager(deck));
|
grid.reset(new GridManager(deck));
|
||||||
// Rock and fluid init
|
// Rock and fluid init
|
||||||
props.reset(new IncompPropertiesFromDeck(deck, *grid->c_grid()));
|
props.reset(new IncompPropertiesFromDeck(deck, eclipseState, *grid->c_grid()));
|
||||||
// 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.
|
||||||
|
@ -110,8 +110,8 @@ try
|
|||||||
Opm::EclipseWriter outputWriter(param, deck, share_obj(*grid->c_grid()));
|
Opm::EclipseWriter outputWriter(param, deck, share_obj(*grid->c_grid()));
|
||||||
|
|
||||||
// Rock and fluid init
|
// Rock and fluid init
|
||||||
props.reset(new BlackoilPropertiesFromDeck(deck, *grid->c_grid(), param));
|
props.reset(new BlackoilPropertiesFromDeck(deck, eclipseState, *grid->c_grid(), param));
|
||||||
new_props.reset(new BlackoilPropsAdFromDeck(deck, *grid->c_grid()));
|
new_props.reset(new BlackoilPropsAdFromDeck(deck, eclipseState, *grid->c_grid()));
|
||||||
|
|
||||||
// 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);
|
||||||
|
@ -131,6 +131,7 @@ try
|
|||||||
|
|
||||||
Opm::ParserPtr newParser(new Opm::Parser() );
|
Opm::ParserPtr newParser(new Opm::Parser() );
|
||||||
Opm::DeckConstPtr deck = newParser->parseFile( deck_filename );
|
Opm::DeckConstPtr deck = newParser->parseFile( deck_filename );
|
||||||
|
Opm::EclipseStateConstPtr eclipseState(new EclipseState(deck));
|
||||||
|
|
||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new Dune::CpGrid());
|
grid.reset(new Dune::CpGrid());
|
||||||
@ -151,12 +152,13 @@ try
|
|||||||
Opm::UgGridHelpers::dimensions(*grid));
|
Opm::UgGridHelpers::dimensions(*grid));
|
||||||
|
|
||||||
// Rock and fluid init
|
// Rock and fluid init
|
||||||
props.reset(new BlackoilPropertiesFromDeck(deck, Opm::UgGridHelpers::numCells(*grid),
|
props.reset(new BlackoilPropertiesFromDeck(deck, eclipseState,
|
||||||
|
Opm::UgGridHelpers::numCells(*grid),
|
||||||
Opm::UgGridHelpers::globalCell(*grid),
|
Opm::UgGridHelpers::globalCell(*grid),
|
||||||
Opm::UgGridHelpers::cartDims(*grid),
|
Opm::UgGridHelpers::cartDims(*grid),
|
||||||
Opm::UgGridHelpers::beginCellCentroids(*grid),
|
Opm::UgGridHelpers::beginCellCentroids(*grid),
|
||||||
Opm::UgGridHelpers::dimensions(*grid), param));
|
Opm::UgGridHelpers::dimensions(*grid), param));
|
||||||
new_props.reset(new BlackoilPropsAdFromDeck(deck, *grid));
|
new_props.reset(new BlackoilPropsAdFromDeck(deck, eclipseState, *grid));
|
||||||
// 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.
|
||||||
@ -232,7 +234,6 @@ try
|
|||||||
WellStateFullyImplicitBlackoil well_state;
|
WellStateFullyImplicitBlackoil well_state;
|
||||||
Opm::TimeMapPtr timeMap(new Opm::TimeMap(deck));
|
Opm::TimeMapPtr timeMap(new Opm::TimeMap(deck));
|
||||||
SimulatorTimer simtimer;
|
SimulatorTimer simtimer;
|
||||||
std::shared_ptr<EclipseState> eclipseState(new EclipseState(deck));
|
|
||||||
|
|
||||||
// initialize variables
|
// initialize variables
|
||||||
simtimer.init(timeMap);
|
simtimer.init(timeMap);
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <opm/core/utility/Units.hpp>
|
#include <opm/core/utility/Units.hpp>
|
||||||
|
|
||||||
#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/Utility/PvtoTable.hpp>
|
#include <opm/parser/eclipse/Utility/PvtoTable.hpp>
|
||||||
#include <opm/parser/eclipse/Utility/PvtgTable.hpp>
|
#include <opm/parser/eclipse/Utility/PvtgTable.hpp>
|
||||||
#include <opm/parser/eclipse/Utility/PvtwTable.hpp>
|
#include <opm/parser/eclipse/Utility/PvtwTable.hpp>
|
||||||
@ -51,20 +52,22 @@ namespace Opm
|
|||||||
|
|
||||||
/// Constructor wrapping an opm-core black oil interface.
|
/// Constructor wrapping an opm-core black oil interface.
|
||||||
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||||
|
Opm::EclipseStateConstPtr eclState,
|
||||||
const UnstructuredGrid& grid,
|
const UnstructuredGrid& grid,
|
||||||
const bool init_rock)
|
const bool init_rock)
|
||||||
{
|
{
|
||||||
init(deck, grid.number_of_cells, grid.global_cell, grid.cartdims,
|
init(deck, eclState, grid.number_of_cells, grid.global_cell, grid.cartdims,
|
||||||
grid.cell_centroids, grid.dimensions, init_rock);
|
grid.cell_centroids, grid.dimensions, init_rock);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DUNE_CORNERPOINT
|
#ifdef HAVE_DUNE_CORNERPOINT
|
||||||
/// Constructor wrapping an opm-core black oil interface.
|
/// Constructor wrapping an opm-core black oil interface.
|
||||||
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||||
|
Opm::EclipseStateConstPtr eclState,
|
||||||
const Dune::CpGrid& grid,
|
const Dune::CpGrid& grid,
|
||||||
const bool init_rock )
|
const bool init_rock )
|
||||||
{
|
{
|
||||||
init(deck, grid.numCells(), static_cast<const int*>(&grid.globalCell()[0]),
|
init(deck, eclState, grid.numCells(), static_cast<const int*>(&grid.globalCell()[0]),
|
||||||
static_cast<const int*>(&grid.logicalCartesianSize()[0]),
|
static_cast<const int*>(&grid.logicalCartesianSize()[0]),
|
||||||
grid.beginCellCentroids(), Dune::CpGrid::dimension, init_rock);
|
grid.beginCellCentroids(), Dune::CpGrid::dimension, init_rock);
|
||||||
}
|
}
|
||||||
@ -73,6 +76,7 @@ namespace Opm
|
|||||||
/// Initializes the properties.
|
/// Initializes the properties.
|
||||||
template <class CentroidIterator>
|
template <class CentroidIterator>
|
||||||
void BlackoilPropsAdFromDeck::init(Opm::DeckConstPtr deck,
|
void BlackoilPropsAdFromDeck::init(Opm::DeckConstPtr deck,
|
||||||
|
Opm::EclipseStateConstPtr eclState,
|
||||||
int number_of_cells,
|
int number_of_cells,
|
||||||
const int* global_cell,
|
const int* global_cell,
|
||||||
const int* cart_dims,
|
const int* cart_dims,
|
||||||
@ -85,7 +89,7 @@ namespace Opm
|
|||||||
extractPvtTableIndex(cellPvtRegionIdx_, deck, number_of_cells, global_cell);
|
extractPvtTableIndex(cellPvtRegionIdx_, deck, number_of_cells, global_cell);
|
||||||
|
|
||||||
if (init_rock){
|
if (init_rock){
|
||||||
rock_.init(deck, number_of_cells, global_cell, cart_dims);
|
rock_.init(eclState, number_of_cells, global_cell, cart_dims);
|
||||||
}
|
}
|
||||||
|
|
||||||
phase_usage_ = phaseUsageFromDeck(deck);
|
phase_usage_ = phaseUsageFromDeck(deck);
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <opm/core/props/rock/RockFromDeck.hpp>
|
#include <opm/core/props/rock/RockFromDeck.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <array>
|
#include <array>
|
||||||
@ -57,12 +58,14 @@ namespace Opm
|
|||||||
public:
|
public:
|
||||||
/// Constructor wrapping an opm-core black oil interface.
|
/// Constructor wrapping an opm-core black oil interface.
|
||||||
BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||||
|
Opm::EclipseStateConstPtr eclState,
|
||||||
const UnstructuredGrid& grid,
|
const UnstructuredGrid& grid,
|
||||||
const bool init_rock = true );
|
const bool init_rock = true );
|
||||||
|
|
||||||
#ifdef HAVE_DUNE_CORNERPOINT
|
#ifdef HAVE_DUNE_CORNERPOINT
|
||||||
/// Constructor wrapping an opm-core black oil interface.
|
/// Constructor wrapping an opm-core black oil interface.
|
||||||
BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
BlackoilPropsAdFromDeck(Opm::DeckConstPtr deck,
|
||||||
|
Opm::EclipseStateConstPtr eclState,
|
||||||
const Dune::CpGrid& grid,
|
const Dune::CpGrid& grid,
|
||||||
const bool init_rock = true );
|
const bool init_rock = true );
|
||||||
#endif
|
#endif
|
||||||
@ -345,6 +348,7 @@ namespace Opm
|
|||||||
/// Initializes the properties.
|
/// Initializes the properties.
|
||||||
template <class CentroidIterator>
|
template <class CentroidIterator>
|
||||||
void init(Opm::DeckConstPtr deck,
|
void init(Opm::DeckConstPtr deck,
|
||||||
|
Opm::EclipseStateConstPtr eclState,
|
||||||
int number_of_cells,
|
int number_of_cells,
|
||||||
const int* global_cell,
|
const int* global_cell,
|
||||||
const int* cart_dims,
|
const int* cart_dims,
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
|
-- =====================================================================
|
||||||
RUNSPEC
|
RUNSPEC
|
||||||
|
|
||||||
DIMENS
|
|
||||||
1 1 1
|
|
||||||
/
|
|
||||||
|
|
||||||
OIL
|
OIL
|
||||||
WATER
|
WATER
|
||||||
|
|
||||||
METRIC
|
METRIC
|
||||||
|
|
||||||
|
DIMENS
|
||||||
|
1 1 1
|
||||||
|
/
|
||||||
|
|
||||||
|
TABDIMS
|
||||||
|
-- use the default values for TABDIMS, but the keyword must be present
|
||||||
|
-- if any tables ought to be specified...
|
||||||
|
/
|
||||||
|
|
||||||
-- =====================================================================
|
-- =====================================================================
|
||||||
GRID
|
GRID
|
||||||
|
|
||||||
@ -28,30 +34,9 @@ DEPTHZ
|
|||||||
4*0
|
4*0
|
||||||
/
|
/
|
||||||
|
|
||||||
PERMX
|
|
||||||
1.01325E15
|
|
||||||
/
|
|
||||||
|
|
||||||
PERMY
|
|
||||||
1.01325E15
|
|
||||||
/
|
|
||||||
|
|
||||||
PERMZ
|
|
||||||
1.01325E15
|
|
||||||
/
|
|
||||||
|
|
||||||
PORO
|
|
||||||
1
|
|
||||||
/
|
|
||||||
|
|
||||||
-- =====================================================================
|
-- =====================================================================
|
||||||
PROPS
|
PROPS
|
||||||
|
|
||||||
TABDIMS
|
|
||||||
-- use the default values for TABDIMS, but the keyword must be present
|
|
||||||
-- if any tables ought to be specified...
|
|
||||||
/
|
|
||||||
|
|
||||||
PVTW
|
PVTW
|
||||||
-- Pw Bw(Pw) Cw muw Cv
|
-- Pw Bw(Pw) Cw muw Cv
|
||||||
1 1 0 1000 0
|
1 1 0 1000 0
|
||||||
@ -71,5 +56,13 @@ DENSITY
|
|||||||
800 1000 1
|
800 1000 1
|
||||||
/
|
/
|
||||||
|
|
||||||
|
-- =====================================================================
|
||||||
|
SOLUTION
|
||||||
|
-- empty section
|
||||||
|
|
||||||
|
-- =====================================================================
|
||||||
|
SCHEDULE
|
||||||
|
-- empty section
|
||||||
|
|
||||||
-- =====================================================================
|
-- =====================================================================
|
||||||
END
|
END
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -47,6 +48,7 @@ struct SetupSimple {
|
|||||||
{
|
{
|
||||||
Opm::ParserPtr parser(new Opm::Parser());
|
Opm::ParserPtr parser(new Opm::Parser());
|
||||||
deck = parser->parseFile("fluid.data");
|
deck = parser->parseFile("fluid.data");
|
||||||
|
eclState.reset(new Opm::EclipseState(deck));
|
||||||
|
|
||||||
param.disableOutput();
|
param.disableOutput();
|
||||||
param.insertParameter("init_rock" , "false" );
|
param.insertParameter("init_rock" , "false" );
|
||||||
@ -57,6 +59,7 @@ struct SetupSimple {
|
|||||||
|
|
||||||
Opm::parameter::ParameterGroup param;
|
Opm::parameter::ParameterGroup param;
|
||||||
Opm::DeckConstPtr deck;
|
Opm::DeckConstPtr deck;
|
||||||
|
Opm::EclipseStateConstPtr eclState;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -66,13 +69,14 @@ struct TestFixture : public Setup
|
|||||||
TestFixture()
|
TestFixture()
|
||||||
: Setup()
|
: Setup()
|
||||||
, grid (deck)
|
, grid (deck)
|
||||||
, props(deck, *grid.c_grid(), param,
|
, props(deck, eclState, *grid.c_grid(), param,
|
||||||
param.getDefault("init_rock", false))
|
param.getDefault("init_rock", false))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
using Setup::param;
|
using Setup::param;
|
||||||
using Setup::deck;
|
using Setup::deck;
|
||||||
|
using Setup::eclState;
|
||||||
|
|
||||||
Opm::GridManager grid;
|
Opm::GridManager grid;
|
||||||
Opm::BlackoilPropertiesFromDeck props;
|
Opm::BlackoilPropertiesFromDeck props;
|
||||||
|
Loading…
Reference in New Issue
Block a user