From c0bc0abc73e8c680ef0170c2aa43ab3f490f21db Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 10 May 2023 14:55:17 +0200 Subject: [PATCH] StandardWell::getMobility: use Scalar relperms when possible --- opm/simulators/wells/StandardWell_impl.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index c78ad025a..e7ba66402 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -837,6 +837,15 @@ namespace Opm return this->extendEval(value); } }; + auto relpermArray = []() + { + if constexpr (std::is_same_v) { + return std::array{}; + } else { + return std::array{}; + } + }; + const int cell_idx = this->well_cells_[perf]; assert (int(mob.size()) == this->num_components_); const auto& intQuants = ebosSimulator.model().intensiveQuantities(cell_idx, /*timeIdx=*/0); @@ -860,7 +869,7 @@ namespace Opm } } else { const auto& paramsCell = materialLawManager->connectionMaterialLawParams(satid, cell_idx); - std::array relativePerms = { 0.0, 0.0, 0.0 }; + auto relativePerms = relpermArray(); MaterialLaw::relativePermeabilities(relativePerms, paramsCell, intQuants.fluidState()); // reset the satnumvalue back to original