Implement min/max for GCONSALE

Only default action RATE is implemented for violation of maximum sales target
This commit is contained in:
Tor Harald Sandve
2020-05-04 15:56:34 +02:00
parent 1885426f3c
commit 85e95fb87d
6 changed files with 132 additions and 26 deletions

View File

@@ -2246,7 +2246,13 @@ namespace Opm
std::vector<double> resv_coeff(phaseUsage().num_phases, 1.0);
rateConverter_.calcCoeff(0, pvtRegionIdx_, resv_coeff); // FIPNUM region 0 here, should use FIPNUM from WELSPECS.
WellGroupHelpers::TargetCalculator tcalc(currentGroupControl, pu, resv_coeff);
// gconsale may adjust the grat target.
// the adjusted rates is send to the targetCalculator
double gratTargetFromSales = 0.0;
if (well_state.hasGroupGratTargetFromSales(group.name()))
gratTargetFromSales = well_state.currentGroupGratTargetFromSales(group.name());
WellGroupHelpers::TargetCalculator tcalc(currentGroupControl, pu, resv_coeff, gratTargetFromSales);
WellGroupHelpers::FractionCalculator fcalc(schedule, well_state, current_step_, guide_rate_, tcalc.guideTargetMode(), pu);
auto localFraction = [&](const std::string& child) {