From e39ffefb2e290e5df5bb09abb822ab2cd1ac3990 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Fri, 24 Mar 2017 15:11:49 +0100 Subject: [PATCH] performing prepareTimeStep in assemble for StandardWellsDense instead of model->preppareStep() to avoid segmenttation error from eclSimulator and also not intervening with NonlinearSolver --- opm/autodiff/BlackoilModelEbos.hpp | 4 +--- opm/autodiff/NonlinearSolver_impl.hpp | 3 +-- opm/autodiff/StandardWellsDense_impl.hpp | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index de82a6844..eb00c14d2 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -213,13 +213,11 @@ namespace Opm { /// \param[in, out] well_state well state variables void prepareStep(const SimulatorTimerInterface& /*timer*/, const ReservoirState& reservoir_state, - WellState& well_state) + const WellState& /* well_state */) { if ( wellModel().wellCollection()->havingVREPGroups() ) { updateRateConverter(reservoir_state); } - - well_model_.prepareTimeStep(ebosSimulator_, well_state); } diff --git a/opm/autodiff/NonlinearSolver_impl.hpp b/opm/autodiff/NonlinearSolver_impl.hpp index 9062ad5b0..d6bb608e5 100644 --- a/opm/autodiff/NonlinearSolver_impl.hpp +++ b/opm/autodiff/NonlinearSolver_impl.hpp @@ -130,8 +130,7 @@ namespace Opm // TODO: this is not the correct fix, possibly breaking the sequential solver // TODO: the only reason to do this is that the wellPotentials() is part of the well_state, which will be modified // during the well_potential calculation - model_->prepareStep(timer, initial_reservoir_state, well_state); - // model_->prepareStep(timer, initial_reservoir_state, initial_reservoir_state); + model_->prepareStep(timer, initial_reservoir_state, initial_well_state); int iteration = 0; diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index c601ae30e..2f640a821 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -130,6 +130,10 @@ namespace Opm { WellState& well_state) { + if (iterationIdx == 0) { + prepareTimeStep(ebosSimulator, well_state); + } + // after restarting, the well_controls can be modified while // the well_state still uses the old control index // we need to synchronize these two.