Merge pull request #5605 from totto82/issue_stopped_wells

Fix issue with stopped injectors in thermal runs
This commit is contained in:
Atgeirr Flø Rasmussen 2024-10-22 10:48:44 +02:00 committed by GitHub
commit bf5f0c864d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2606,7 +2606,7 @@ namespace Opm
}
// change temperature for injecting fluids
if (this->isInjector() && cq_s[activeCompIdx] > 0.0){
if (this->isInjector() && !this->wellIsStopped() && cq_r_thermal > 0.0){
// only handles single phase injection now
assert(this->well_ecl_.injectorType() != InjectorType::MULTI);
fs.setTemperature(this->well_ecl_.inj_temperature());
@ -2623,6 +2623,9 @@ namespace Opm
fs.setEnthalpy(phaseIdx, h);
cq_r_thermal *= this->extendEval(fs.enthalpy(phaseIdx)) * this->extendEval(fs.density(phaseIdx));
result += getValue(cq_r_thermal);
} else if (cq_r_thermal > 0.0) {
cq_r_thermal *= getValue(fs.enthalpy(phaseIdx)) * getValue(fs.density(phaseIdx));
result += Base::restrictEval(cq_r_thermal);
} else {
// compute the thermal flux
cq_r_thermal *= this->extendEval(fs.enthalpy(phaseIdx)) * this->extendEval(fs.density(phaseIdx));