diff --git a/opm/autodiff/BlackoilWellModel.hpp b/opm/autodiff/BlackoilWellModel.hpp index 44ab2a51a..0c383b4ff 100644 --- a/opm/autodiff/BlackoilWellModel.hpp +++ b/opm/autodiff/BlackoilWellModel.hpp @@ -194,6 +194,7 @@ namespace Opm { size_t number_of_cells_; double gravity_; std::vector depth_; + bool initial_step_; DynamicListEconLimited dynamic_list_econ_limited_; std::unique_ptr rateConverter_; diff --git a/opm/autodiff/BlackoilWellModel_impl.hpp b/opm/autodiff/BlackoilWellModel_impl.hpp index b42bed9c5..e52422383 100644 --- a/opm/autodiff/BlackoilWellModel_impl.hpp +++ b/opm/autodiff/BlackoilWellModel_impl.hpp @@ -29,6 +29,7 @@ namespace Opm { extractLegacyCellPvtRegionIndex_(); extractLegacyDepth_(); + initial_step_ = true; } @@ -273,6 +274,12 @@ namespace Opm { if (param_.solve_welleq_initially_ && iterationIdx == 0) { // solve the well equations as a pre-processing step last_report_ = solveWellEq(dt); + if (initial_step_) { + // update the explixit quanteties to get the initial fluid distribution in the well correct. + calculateExplicitQuantities(); + last_report_ = solveWellEq(dt); + initial_step_ = false; + } } assembleWellEq(dt, false);