mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix minpvProps calculations
This commit is contained in:
parent
5fb005d87b
commit
64feefaf05
@ -105,12 +105,9 @@ public:
|
|||||||
auto& transMult = eclState.getTransMult();
|
auto& transMult = eclState.getTransMult();
|
||||||
ElementMapper elemMapper(gridView);
|
ElementMapper elemMapper(gridView);
|
||||||
|
|
||||||
const std::vector<double>& ntg =
|
// get the ntg values, the ntg values are modified for the cells merged with minpv
|
||||||
eclState.get3DProperties().getDoubleGridProperty("NTG").getData();
|
std::vector<double> ntg;
|
||||||
|
minPvFillNtg_(ntg);
|
||||||
// modify the ntg values for the cells merged with minpv
|
|
||||||
std::vector<double> ntg_mod (ntg);
|
|
||||||
minPvFillNtg_(ntg_mod);
|
|
||||||
|
|
||||||
unsigned numElements = elemMapper.size();
|
unsigned numElements = elemMapper.size();
|
||||||
|
|
||||||
@ -213,8 +210,8 @@ public:
|
|||||||
axisCentroids),
|
axisCentroids),
|
||||||
permeability_[outsideElemIdx]);
|
permeability_[outsideElemIdx]);
|
||||||
|
|
||||||
applyNtg_(halfTrans1, insideFaceIdx, insideCartElemIdx, ntg_mod);
|
applyNtg_(halfTrans1, insideFaceIdx, insideCartElemIdx, ntg);
|
||||||
applyNtg_(halfTrans2, outsideFaceIdx, outsideCartElemIdx, ntg_mod);
|
applyNtg_(halfTrans2, outsideFaceIdx, outsideCartElemIdx, ntg);
|
||||||
|
|
||||||
// convert half transmissibilities to full face
|
// convert half transmissibilities to full face
|
||||||
// transmissibilities using the harmonic mean
|
// transmissibilities using the harmonic mean
|
||||||
@ -402,7 +399,7 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void minPvFillNtg_(std::vector<double>& ntg) const {
|
void minPvFillNtg_(std::vector<double>& averageNtg) const {
|
||||||
|
|
||||||
// compute volume weighted arithmetic average of NTG for
|
// compute volume weighted arithmetic average of NTG for
|
||||||
// cells merged as an result of minpv.
|
// cells merged as an result of minpv.
|
||||||
@ -410,18 +407,38 @@ private:
|
|||||||
const auto& eclGrid = eclState.getInputGrid();
|
const auto& eclGrid = eclState.getInputGrid();
|
||||||
const auto& porv = eclState.get3DProperties().getDoubleGridProperty("PORV").getData();
|
const auto& porv = eclState.get3DProperties().getDoubleGridProperty("PORV").getData();
|
||||||
const auto& actnum = eclState.get3DProperties().getIntGridProperty("ACTNUM").getData();
|
const auto& actnum = eclState.get3DProperties().getIntGridProperty("ACTNUM").getData();
|
||||||
|
const std::vector<double>& ntg =
|
||||||
|
eclState.get3DProperties().getDoubleGridProperty("NTG").getData();
|
||||||
|
|
||||||
const auto& cartMapper = gridManager_.cartesianIndexMapper();
|
const auto& cartMapper = gridManager_.cartesianIndexMapper();
|
||||||
const auto& cartDims = cartMapper.cartesianDimensions();
|
const auto& cartDims = cartMapper.cartesianDimensions();
|
||||||
assert(dimWorld > 1);
|
assert(dimWorld > 1);
|
||||||
const size_t nxny = cartDims[0] * cartDims[1];
|
const size_t nxny = cartDims[0] * cartDims[1];
|
||||||
|
|
||||||
|
averageNtg.clear();
|
||||||
|
averageNtg.resize(ntg.size(),1.0);
|
||||||
|
|
||||||
for (size_t cartesianCellIdx = 0; cartesianCellIdx < ntg.size(); ++cartesianCellIdx) {
|
for (size_t cartesianCellIdx = 0; cartesianCellIdx < ntg.size(); ++cartesianCellIdx) {
|
||||||
const double cellVolume = eclGrid.getCellVolume(cartesianCellIdx);
|
|
||||||
ntg[cartesianCellIdx] *= cellVolume;
|
// use the original ntg values for the inactive cells
|
||||||
double totalCellVolume = cellVolume;
|
if( ! actnum[cartesianCellIdx]) {
|
||||||
|
averageNtg[cartesianCellIdx] = ntg[cartesianCellIdx];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// use the original ntg values if the cell above has porv > minPVvalue.
|
||||||
|
int cartesianCellIdxAbove = cartesianCellIdx - nxny;
|
||||||
|
if (porv[cartesianCellIdxAbove] > eclGrid.getMinpvValue() ){
|
||||||
|
averageNtg[cartesianCellIdx] = ntg[cartesianCellIdx];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Average properties as long as there exist cells above
|
// Average properties as long as there exist cells above
|
||||||
// that has pore volume less than the MINPV threshold
|
// that has pore volume less than the MINPV threshold
|
||||||
int cartesianCellIdxAbove = cartesianCellIdx - nxny;
|
const double cellVolume = eclGrid.getCellVolume(cartesianCellIdx);
|
||||||
|
double ntgCellVolume = ntg[cartesianCellIdx] * cellVolume;
|
||||||
|
double totalCellVolume = cellVolume;
|
||||||
while ( cartesianCellIdxAbove >= 0 &&
|
while ( cartesianCellIdxAbove >= 0 &&
|
||||||
actnum[cartesianCellIdxAbove] > 0 &&
|
actnum[cartesianCellIdxAbove] > 0 &&
|
||||||
porv[cartesianCellIdxAbove] < eclGrid.getMinpvValue() ) {
|
porv[cartesianCellIdxAbove] < eclGrid.getMinpvValue() ) {
|
||||||
@ -429,10 +446,10 @@ private:
|
|||||||
// Volume weighted arithmetic average of NTG
|
// Volume weighted arithmetic average of NTG
|
||||||
const double cellAboveVolume = eclGrid.getCellVolume(cartesianCellIdxAbove);
|
const double cellAboveVolume = eclGrid.getCellVolume(cartesianCellIdxAbove);
|
||||||
totalCellVolume += cellAboveVolume;
|
totalCellVolume += cellAboveVolume;
|
||||||
ntg[cartesianCellIdx] += ntg[cartesianCellIdxAbove]*cellAboveVolume;
|
ntgCellVolume += ntg[cartesianCellIdxAbove]*cellAboveVolume;
|
||||||
cartesianCellIdxAbove -= nxny;
|
cartesianCellIdxAbove -= nxny;
|
||||||
}
|
}
|
||||||
ntg[cartesianCellIdx] /= totalCellVolume;
|
averageNtg[cartesianCellIdx] = ntgCellVolume / totalCellVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user