Make MinpvProcessor ignore inactive cells.
This commit is contained in:
parent
f7bd6076e6
commit
605d3e0d09
@ -158,7 +158,7 @@ namespace Opm
|
|||||||
|
|
||||||
if (!poreVolumes.empty() && eclipseGrid->isMinpvActive()) {
|
if (!poreVolumes.empty() && eclipseGrid->isMinpvActive()) {
|
||||||
MinpvProcessor mp(g.dims[0], g.dims[1], g.dims[2]);
|
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() ?
|
const double z_tolerance = eclipseGrid->isPinchActive() ?
|
||||||
|
@ -40,11 +40,15 @@ namespace Opm
|
|||||||
/// Change zcorn so that it respects the minpv property.
|
/// Change zcorn so that it respects the minpv property.
|
||||||
/// \param[in] pv pore volumes of all logical cartesian cells
|
/// \param[in] pv pore volumes of all logical cartesian cells
|
||||||
/// \param[in] minpv minimum pore volume to accept a cell
|
/// \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
|
/// \param[in, out] zcorn ZCORN array to be manipulated
|
||||||
/// After processing, all cells that have lower pore volume than minpv
|
/// After processing, all cells that have lower pore volume than minpv
|
||||||
/// will have the zcorn numbers changed so they are zero-thickness. Any
|
/// will have the zcorn numbers changed so they are zero-thickness. Any
|
||||||
/// cell below will be changed to include the deleted volume.
|
/// 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:
|
private:
|
||||||
std::array<int,8> cornerIndices(const int i, const int j, const int k) const;
|
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;
|
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:
|
// Algorithm:
|
||||||
// 1. Process each column of cells (with same i and j
|
// 1. Process each column of cells (with same i and j
|
||||||
@ -85,13 +92,16 @@ namespace Opm
|
|||||||
if (pv.size() != log_size) {
|
if (pv.size() != log_size) {
|
||||||
OPM_THROW(std::runtime_error, "Wrong size of PORV input, must have one element per logical cartesian cell.");
|
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.
|
// Main loop.
|
||||||
for (int kk = 0; kk < dims_[2]; ++kk) {
|
for (int kk = 0; kk < dims_[2]; ++kk) {
|
||||||
for (int jj = 0; jj < dims_[1]; ++jj) {
|
for (int jj = 0; jj < dims_[1]; ++jj) {
|
||||||
for (int ii = 0; ii < dims_[0]; ++ii) {
|
for (int ii = 0; ii < dims_[0]; ++ii) {
|
||||||
const int c = ii + dims_[0] * (jj + dims_[1] * kk);
|
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.
|
// Move deeper (higher k) coordinates to lower k coordinates.
|
||||||
std::array<double, 8> cz = getCellZcorn(ii, jj, kk, zcorn);
|
std::array<double, 8> cz = getCellZcorn(ii, jj, kk, zcorn);
|
||||||
for (int count = 0; count < 4; ++count) {
|
for (int count = 0; count < 4; ++count) {
|
||||||
|
Loading…
Reference in New Issue
Block a user