diff --git a/opm/simulators/wells/StandardWell.hpp b/opm/simulators/wells/StandardWell.hpp index 0202c02b7..77419b436 100644 --- a/opm/simulators/wells/StandardWell.hpp +++ b/opm/simulators/wells/StandardWell.hpp @@ -442,6 +442,10 @@ namespace Opm const double vap_wat_rate, const std::vector& cq_s, const IntensiveQuantities& intQuants) const; + + std::tuple + connectionRatesMICP(const std::vector& cq_s, + const IntensiveQuantities& intQuants) const; }; } diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 26203a8dd..5789fdfe2 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -768,28 +768,10 @@ namespace Opm } if constexpr (has_micp) { - const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx); - EvalWell cq_s_microbe = cq_s[waterCompIdx]; - if (this->isInjector()) { - cq_s_microbe *= this->wmicrobes(); - } else { - cq_s_microbe *= this->extendEval(intQuants.microbialConcentration()); - } - connectionRates[perf][Indices::contiMicrobialEqIdx] = Base::restrictEval(cq_s_microbe); - EvalWell cq_s_oxygen = cq_s[waterCompIdx]; - if (this->isInjector()) { - cq_s_oxygen *= this->woxygen(); - } else { - cq_s_oxygen *= this->extendEval(intQuants.oxygenConcentration()); - } - connectionRates[perf][Indices::contiOxygenEqIdx] = Base::restrictEval(cq_s_oxygen); - EvalWell cq_s_urea = cq_s[waterCompIdx]; - if (this->isInjector()) { - cq_s_urea *= this->wurea(); - } else { - cq_s_urea *= this->extendEval(intQuants.ureaConcentration()); - } - connectionRates[perf][Indices::contiUreaEqIdx] = Base::restrictEval(cq_s_urea); + std::tie(connectionRates[perf][Indices::contiMicrobialEqIdx], + connectionRates[perf][Indices::contiOxygenEqIdx], + connectionRates[perf][Indices::contiUreaEqIdx]) = + connectionRatesMICP(cq_s, intQuants); } // Store the perforation pressure for later usage. @@ -2392,4 +2374,40 @@ namespace Opm return Base::restrictEval(cq_s_sm); } + + template + std::tuple::Eval, + typename StandardWell::Eval, + typename StandardWell::Eval> + StandardWell:: + connectionRatesMICP(const std::vector& cq_s, + const IntensiveQuantities& intQuants) const + { + const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx); + EvalWell cq_s_microbe = cq_s[waterCompIdx]; + if (this->isInjector()) { + cq_s_microbe *= this->wmicrobes(); + } else { + cq_s_microbe *= this->extendEval(intQuants.microbialConcentration()); + } + + EvalWell cq_s_oxygen = cq_s[waterCompIdx]; + if (this->isInjector()) { + cq_s_oxygen *= this->woxygen(); + } else { + cq_s_oxygen *= this->extendEval(intQuants.oxygenConcentration()); + } + + EvalWell cq_s_urea = cq_s[waterCompIdx]; + if (this->isInjector()) { + cq_s_urea *= this->wurea(); + } else { + cq_s_urea *= this->extendEval(intQuants.ureaConcentration()); + } + + return {Base::restrictEval(cq_s_microbe), + Base::restrictEval(cq_s_oxygen), + Base::restrictEval(cq_s_urea)}; + } + } // namespace Opm