WIP fix issue with stopped wells

This commit is contained in:
Tor Harald Sandve 2024-09-17 13:58:01 +02:00
parent 9eaba103cc
commit ee4a6e0e39

View File

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