Merge pull request #725 from atgeirr/minpv-use-actnum

Make MinpvProcessor ignore inactive cells.
This commit is contained in:
Bård Skaflestad committed 2015-01-23 11:27:13 +01:00
commit 8f0b4714a5
3 files changed
+21 -10

No files matched your search

+1 -1
View File
@@ -158,7 +158,7 @@ namespace Opm
if (!poreVolumes.empty() && eclipseGrid->isMinpvActive()) {
MinpvProcessor mp(g.dims[0], g.dims[1], g.dims[2]);
mp.process(poreVolumes, eclipseGrid->getMinpvValue(), zcorn.data());
mp.process(poreVolumes, eclipseGrid->getMinpvValue(), actnum, zcorn.data());
}
const double z_tolerance = eclipseGrid->isPinchActive() ?
+16 -6
View File
@@ -38,13 +38,17 @@ namespace Opm
/// \param[in] nz logical cartesian number of cells in K-direction
MinpvProcessor(const int nx, const int ny, const int nz);
/// Change zcorn so that it respects the minpv property.
/// \param[in] pv pore volumes of all logical cartesian cells
/// \param[in] minpv minimum pore volume to accept a cell
/// \param[in, out] zcorn ZCORN array to be manipulated
/// \param[in] pv pore volumes of all logical cartesian cells
/// \param[in] minpv minimum pore volume to accept a cell
/// \param[in] actnum active cells, inactive cells are not considered
/// \param[in, out] zcorn ZCORN array to be manipulated
/// After processing, all cells that have lower pore volume than minpv
/// will have the zcorn numbers changed so they are zero-thickness. Any
/// cell below will be changed to include the deleted volume.
void process(const std::vector<double>& pv, const double minpv, double* zcorn) const;
void process(const std::vector<double>& pv,
const double minpv,
const std::vector<int>& actnum,
double* zcorn) const;
private:
std::array<int,8> cornerIndices(const int i, const int j, const int k) const;
std::array<double, 8> getCellZcorn(const int i, const int j, const int k, const double* z) const;
@@ -67,7 +71,10 @@ namespace Opm
inline void MinpvProcessor::process(const std::vector<double>& pv, const double minpv, double* zcorn) const
inline void MinpvProcessor::process(const std::vector<double>& pv,
const double minpv,
const std::vector<int>& actnum,
double* zcorn) const
{
// Algorithm:
// 1. Process each column of cells (with same i and j
@@ -85,13 +92,16 @@ namespace Opm
if (pv.size() != log_size) {
OPM_THROW(std::runtime_error, "Wrong size of PORV input, must have one element per logical cartesian cell.");
}
if (actnum.size() != log_size) {
OPM_THROW(std::runtime_error, "Wrong size of ACTNUM input, must have one element per logical cartesian cell.");
}
// Main loop.
for (int kk = 0; kk < dims_[2]; ++kk) {
for (int jj = 0; jj < dims_[1]; ++jj) {
for (int ii = 0; ii < dims_[0]; ++ii) {
const int c = ii + dims_[0] * (jj + dims_[1] * kk);
if (pv[c] < minpv) {
if (pv[c] < minpv && actnum[c]) {
// Move deeper (higher k) coordinates to lower k coordinates.
std::array<double, 8> cz = getCellZcorn(ii, jj, kk, zcorn);
for (int count = 0; count < 4; ++count) {
+4 -3
View File
@@ -51,19 +51,20 @@ BOOST_AUTO_TEST_CASE(Processing)
0, 0, 0, 0,
6, 6, 6, 6 };
std::vector<double> pv = { 1, 2, 3 };
std::vector<int> actnum = { 1, 1, 1 };
Opm::MinpvProcessor mp1(1, 1, 3);
auto z1 = zcorn;
mp1.process(pv, 0.5, z1.data());
mp1.process(pv, 0.5, actnum, z1.data());
BOOST_CHECK_EQUAL_COLLECTIONS(z1.begin(), z1.end(), zcorn.begin(), zcorn.end());
Opm::MinpvProcessor mp2(1, 1, 3);
auto z2 = zcorn;
mp2.process(pv, 1.5, z2.data());
mp2.process(pv, 1.5, actnum, z2.data());
BOOST_CHECK_EQUAL_COLLECTIONS(z2.begin(), z2.end(), zcorn2after.begin(), zcorn2after.end());
Opm::MinpvProcessor mp3(1, 1, 3);
auto z3 = zcorn;
mp3.process(pv, 2.5, z3.data());
mp3.process(pv, 2.5, actnum, z3.data());
BOOST_CHECK_EQUAL_COLLECTIONS(z3.begin(), z3.end(), zcorn3after.begin(), zcorn3after.end());
}