From 8b45f9d23b9649068273e8b902a9f52941295ff8 Mon Sep 17 00:00:00 2001 From: Halvor M Nilsen Date: Fri, 14 Feb 2025 14:46:13 +0100 Subject: [PATCH 1/2] avoid recreating wellcontainer including deleting informations form primaryvariables --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 7883d0b16..20b126ff6 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -233,7 +233,8 @@ namespace Opm { // the case of failed iterations this->commitWGState(); - this->wellStructureChangedDynamically_ = false; + //NB should check if anything is changed for now recreate all wells + this->wellStructureChangedDynamically_ = true; } @@ -362,7 +363,7 @@ namespace Opm { // structure change. That way we don't end up here in // subsequent calls to beginTimeStep() unless there's a new // dynamic change to the well structure during a report step. - this->wellStructureChangedDynamically_ = false; + //this->wellStructureChangedDynamically_ = false; } this->resetWGState(); @@ -784,8 +785,10 @@ namespace Opm { DeferredLogger local_deferredLogger; const int nw = this->numLocalWells(); - - well_container_.clear(); + if(this->wellStructureChangedDynamically_ = true){ + well_container_.clear(); + this->wellStructureChangedDynamically_ = false; + } if (nw > 0) { well_container_.reserve(nw); From 0b9b124b4e5cbbd953c79b0afe6e239118c07be1 Mon Sep 17 00:00:00 2001 From: Halvor M Nilsen Date: Fri, 14 Feb 2025 14:57:49 +0100 Subject: [PATCH 2/2] fixed error --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 20b126ff6..ef581bd43 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -785,7 +785,7 @@ namespace Opm { DeferredLogger local_deferredLogger; const int nw = this->numLocalWells(); - if(this->wellStructureChangedDynamically_ = true){ + if(this->wellStructureChangedDynamically_ == true){ well_container_.clear(); this->wellStructureChangedDynamically_ = false; }