mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: use updateProperty_ in updateMinPressure_
This commit is contained in:
parent
80b54a85ad
commit
f4cd69f422
@ -2251,26 +2251,14 @@ private:
|
|||||||
if (this->minOilPressure_.empty())
|
if (this->minOilPressure_.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
this->updateProperty_("EclProblem::updateMinPressure_() failed:",
|
||||||
ElementContext elemCtx(this->simulator());
|
[this](unsigned compressedDofIdx, const IntensiveQuantities& iq)
|
||||||
const auto& vanguard = this->simulator().vanguard();
|
{
|
||||||
auto elemIt = vanguard.gridView().template begin</*codim=*/0>();
|
const auto& fs = iq.fluidState();
|
||||||
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
|
const Scalar mo = getValue(fs.pressure(oilPhaseIdx));
|
||||||
for (; elemIt != elemEndIt; ++elemIt) {
|
auto& mos = this->minOilPressure_;
|
||||||
const Element& elem = *elemIt;
|
mos[compressedDofIdx] = std::min(mos[compressedDofIdx], mo);
|
||||||
|
});
|
||||||
elemCtx.updatePrimaryStencil(elem);
|
|
||||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
|
||||||
|
|
||||||
unsigned compressedDofIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
|
||||||
const auto& iq = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
|
||||||
const auto& fs = iq.fluidState();
|
|
||||||
|
|
||||||
this->minOilPressure_[compressedDofIdx] =
|
|
||||||
std::min(this->minOilPressure_[compressedDofIdx],
|
|
||||||
getValue(fs.pressure(oilPhaseIdx)));
|
|
||||||
}
|
|
||||||
OPM_END_PARALLEL_TRY_CATCH("EclProblem::updateMinPressure_() failed: ", this->simulator().vanguard().grid().comm());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user