Add new constructor, that can handle MINPV processing.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/grid/cart_grid.h>
|
||||
#include <opm/core/grid/cornerpoint_grid.h>
|
||||
#include <opm/core/grid/MinpvProcessor.hpp>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
|
||||
@@ -32,11 +33,12 @@
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
/// Construct a 3d corner-point grid from a deck.
|
||||
GridManager::GridManager(Opm::EclipseGridConstPtr eclipseGrid)
|
||||
: ug_(0)
|
||||
{
|
||||
initFromEclipseGrid(eclipseGrid);
|
||||
initFromEclipseGrid(eclipseGrid, std::vector<double>());
|
||||
}
|
||||
|
||||
|
||||
@@ -44,10 +46,17 @@ namespace Opm
|
||||
: ug_(0)
|
||||
{
|
||||
auto eclipseGrid = std::make_shared<const Opm::EclipseGrid>(deck);
|
||||
initFromEclipseGrid(eclipseGrid);
|
||||
initFromEclipseGrid(eclipseGrid, std::vector<double>());
|
||||
}
|
||||
|
||||
|
||||
GridManager::GridManager(Opm::EclipseGridConstPtr eclipseGrid,
|
||||
const std::vector<double>& poreVolumes)
|
||||
: ug_(0)
|
||||
{
|
||||
initFromEclipseGrid(eclipseGrid, poreVolumes);
|
||||
}
|
||||
|
||||
|
||||
/// Construct a 2d cartesian grid with cells of unit size.
|
||||
GridManager::GridManager(int nx, int ny)
|
||||
@@ -124,7 +133,8 @@ namespace Opm
|
||||
|
||||
|
||||
// Construct corner-point grid from EclipseGrid.
|
||||
void GridManager::initFromEclipseGrid(Opm::EclipseGridConstPtr eclipseGrid)
|
||||
void GridManager::initFromEclipseGrid(Opm::EclipseGridConstPtr eclipseGrid,
|
||||
const std::vector<double>& poreVolumes)
|
||||
{
|
||||
struct grdecl g;
|
||||
std::vector<int> actnum;
|
||||
@@ -146,6 +156,11 @@ namespace Opm
|
||||
g.actnum = actnum.data();
|
||||
g.mapaxes = mapaxes.data();
|
||||
|
||||
if (!poreVolumes.empty() && eclipseGrid->isMinpvActive()) {
|
||||
MinpvProcessor mp(g.dims[0], g.dims[1], g.dims[2]);
|
||||
mp.process(poreVolumes, eclipseGrid->getMinpvValue(), zcorn.data());
|
||||
}
|
||||
|
||||
const double z_tolerance = eclipseGrid->isPinchActive() ?
|
||||
eclipseGrid->getPinchThresholdThickness() : 0.0;
|
||||
ug_ = create_grid_cornerpoint(&g, z_tolerance);
|
||||
@@ -208,4 +223,9 @@ namespace Opm
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
@@ -44,9 +44,17 @@ namespace Opm
|
||||
/// Construct a 3d corner-point grid or tensor grid from a deck.
|
||||
explicit GridManager(Opm::DeckConstPtr deck);
|
||||
|
||||
/// Construct a grid from an EclipseState::EclipseGrid instance
|
||||
/// Construct a grid from an EclipseState::EclipseGrid instance.
|
||||
explicit GridManager(Opm::EclipseGridConstPtr eclipseGrid);
|
||||
|
||||
/// Construct a grid from an EclipseState::EclipseGrid instance,
|
||||
/// giving an explicit set of pore volumes to be used for MINPV
|
||||
/// considerations.
|
||||
/// \input[in] eclipseGrid encapsulates a corner-point grid given from a deck
|
||||
/// \input[in] poreVolumes one element per logical cartesian grid element
|
||||
GridManager(Opm::EclipseGridConstPtr eclipseGrid,
|
||||
const std::vector<double>& poreVolumes);
|
||||
|
||||
/// Construct a 2d cartesian grid with cells of unit size.
|
||||
GridManager(int nx, int ny);
|
||||
|
||||
@@ -81,7 +89,8 @@ namespace Opm
|
||||
GridManager& operator=(const GridManager& other);
|
||||
|
||||
// Construct corner-point grid from EclipseGrid.
|
||||
void initFromEclipseGrid(Opm::EclipseGridConstPtr eclipseGrid);
|
||||
void initFromEclipseGrid(Opm::EclipseGridConstPtr eclipseGrid,
|
||||
const std::vector<double>& poreVolumes);
|
||||
|
||||
// The managed UnstructuredGrid.
|
||||
UnstructuredGrid* ug_;
|
||||
|
||||
Reference in New Issue
Block a user