diff --git a/opm/core/simulator/WellState.hpp b/opm/core/simulator/WellState.hpp index adf3fb244..313914587 100644 --- a/opm/core/simulator/WellState.hpp +++ b/opm/core/simulator/WellState.hpp @@ -59,8 +59,10 @@ namespace Opm bhp_[w] = well_controls_get_current_target( ctrl ); } - // Initialize well rates to match controls if type is SURFACE_RATE, - // otherwise set to a small rate with the correct sign. + // Initialize well rates to match controls if type is SURFACE_RATE. + // Otherwise, we cannot set the correct value here, so we assign + // a small rate with the correct sign so that any logic depending on + // that sign will work as expected. if (well_controls_well_is_open( ctrl ) || (well_controls_get_current_type(ctrl) == SURFACE_RATE)) { const double rate_target = well_controls_get_current_target(ctrl); const double * distr = well_controls_get_current_distr( ctrl );