mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
changed: use updateProperty_ in updateMaxOilSaturation_
This commit is contained in:
+8
-23
@@ -2209,33 +2209,18 @@ private:
|
|||||||
|
|
||||||
bool updateMaxOilSaturation_()
|
bool updateMaxOilSaturation_()
|
||||||
{
|
{
|
||||||
const auto& simulator = this->simulator();
|
|
||||||
int episodeIdx = this->episodeIndex();
|
int episodeIdx = this->episodeIndex();
|
||||||
|
|
||||||
// we use VAPPARS
|
// we use VAPPARS
|
||||||
if (this->vapparsActive(episodeIdx)) {
|
if (this->vapparsActive(episodeIdx)) {
|
||||||
ElementContext elemCtx(simulator);
|
this->updateProperty_("EclProblem::updateMaxOilSaturation_() failed:",
|
||||||
const auto& vanguard = simulator.vanguard();
|
[this](unsigned compressedDofIdx, const IntensiveQuantities& iq)
|
||||||
auto elemIt = vanguard.gridView().template begin</*codim=*/0>();
|
{
|
||||||
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
|
const auto& fs = iq.fluidState();
|
||||||
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
const Scalar So = decay<Scalar>(fs.saturation(oilPhaseIdx));
|
||||||
for (; elemIt != elemEndIt; ++elemIt) {
|
auto& mos = this->maxOilSaturation_;
|
||||||
const Element& elem = *elemIt;
|
mos[compressedDofIdx] = std::max(mos[compressedDofIdx], So);
|
||||||
|
});
|
||||||
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();
|
|
||||||
|
|
||||||
Scalar So = decay<Scalar>(fs.saturation(oilPhaseIdx));
|
|
||||||
|
|
||||||
this->maxOilSaturation_[compressedDofIdx] = std::max(this->maxOilSaturation_[compressedDofIdx], So);
|
|
||||||
}
|
|
||||||
OPM_END_PARALLEL_TRY_CATCH("EclProblem::updateMayOilSaturation() failed:", vanguard.grid().comm());
|
|
||||||
// we need to invalidate the intensive quantities cache here because the
|
|
||||||
// derivatives of Rs and Rv will most likely have changed
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user