From 0756e2d1c1b80f9ab9d4b42a212effd30a4f1218 Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Thu, 26 Oct 2023 13:50:42 +0200 Subject: [PATCH] Initialize rates/previous rates before well-test --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 1ce2daf58..1e0a61d05 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -544,6 +544,14 @@ namespace Opm { well->setVFPProperties(vfp_properties_.get()); well->setGuideRate(&guideRate_); + // initialize rates/previous rates to prevent zero fractions in vfp-interpolation + if (well->isProducer()) { + well->updateWellStateRates(ebosSimulator_, this->wellState(), deferred_logger); + } + if (well->isVFPActive(deferred_logger)) { + well->setPrevSurfaceRates(this->wellState(), this->prevWellState()); + } + well->wellTesting(ebosSimulator_, simulationTime, this->wellState(), this->groupState(), wellTestState(), deferred_logger); } }