From 7553e227269022edae9d9b523feafeefdb9cdd5e Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 10 Nov 2022 12:57:21 +0100 Subject: [PATCH] remove derivative in thermal flux for injectors --- opm/simulators/wells/StandardWell_impl.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index ebb60c25b..7824425b5 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -681,10 +681,13 @@ namespace Opm fs.setDensity(phaseIdx, rho); const auto& h = FluidSystem::enthalpy(fs, paramCache, phaseIdx); fs.setEnthalpy(phaseIdx, h); + cq_r_thermal *= this->extendEval(fs.enthalpy(phaseIdx)) * this->extendEval(fs.density(phaseIdx)); + connectionRates[perf][Indices::contiEnergyEqIdx] += getValue(cq_r_thermal); + } else { + // compute the thermal flux + cq_r_thermal *= this->extendEval(fs.enthalpy(phaseIdx)) * this->extendEval(fs.density(phaseIdx)); + connectionRates[perf][Indices::contiEnergyEqIdx] += Base::restrictEval(cq_r_thermal); } - // compute the thermal flux - cq_r_thermal *= this->extendEval(fs.enthalpy(phaseIdx)) * this->extendEval(fs.density(phaseIdx)); - connectionRates[perf][Indices::contiEnergyEqIdx] += Base::restrictEval(cq_r_thermal); } }