From dd3bf5126221215dac73a14f6b3d1a31f1a2a472 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Sun, 14 Feb 2016 23:44:21 +0100 Subject: [PATCH] ignore the PORV grid property this is required because that property is "drive-by created" when initializing the grid and the code in opm-autodiff ignores it. (and is slightly inconsistent with what opm-parser does...) --- applications/ebos/eclproblem.hh | 36 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/applications/ebos/eclproblem.hh b/applications/ebos/eclproblem.hh index 6ffcde74f..a85e7db4a 100644 --- a/applications/ebos/eclproblem.hh +++ b/applications/ebos/eclproblem.hh @@ -814,21 +814,6 @@ private: } } - // overwrite the porosity using the PORV keyword for the elements for which PORV - // is defined... - if (eclState->hasDoubleGridProperty("PORV")) { - const std::vector &porvData = - eclState->getDoubleGridProperty("PORV")->getData(); - - for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) { - unsigned cartesianElemIdx = gridManager.cartesianIndex(dofIdx); - if (std::isfinite(porvData[cartesianElemIdx])) { - Scalar dofVolume = this->simulator().model().dofTotalVolume(dofIdx); - porosity_[dofIdx] = porvData[cartesianElemIdx]/dofVolume; - } - } - } - // apply the NTG keyword to the porosity if (eclState->hasDoubleGridProperty("NTG")) { const std::vector &ntgData = @@ -847,6 +832,27 @@ private: porosity_[dofIdx] *= multpvData[gridManager.cartesianIndex(dofIdx)]; } + // overwrite the porosity using the PORV keyword for the elements for which PORV + // is defined... + // + // HACK: the PORV keyword is currently always present because the grid managers + // for ebos all need to "drive-by create" it to initialize the grid structures :( + // (WTF: why is eclState->getDoubleGridProperty() marked as 'const' even though + // it alters the external semantics of the object?) since the FLOW simulator from + // opm-autodiff ignored it so far, we do so as well. + if (false && eclState->hasDoubleGridProperty("PORV")) { + const std::vector &porvData = + eclState->getDoubleGridProperty("PORV")->getData(); + + for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) { + unsigned cartesianElemIdx = gridManager.cartesianIndex(dofIdx); + if (std::isfinite(porvData[cartesianElemIdx])) { + Scalar dofVolume = this->simulator().model().dofTotalVolume(dofIdx); + porosity_[dofIdx] = porvData[cartesianElemIdx]/dofVolume; + } + } + } + // the fluid-matrix interactions for ECL problems are dealt with by a separate class std::vector compressedToCartesianElemIdx(numDof); for (unsigned elemIdx = 0; elemIdx < numDof; ++elemIdx)