only double check the current group constraint at the start of a report step

This commit is contained in:
Tor Harald Sandve 2020-01-29 08:41:41 +01:00
parent f5c6bafd90
commit b499180776
2 changed files with 7 additions and 2 deletions

View File

@ -270,6 +270,7 @@ namespace Opm {
double gravity_;
std::vector<double> depth_;
bool initial_step_;
bool report_step_starts_;
std::unique_ptr<RateConverterType> rateConverter_;
std::unique_ptr<VFPProperties<VFPInjProperties,VFPProdProperties>> vfp_properties_;

View File

@ -206,6 +206,7 @@ namespace Opm {
beginReportStep(const int timeStepIdx)
{
Opm::DeferredLogger local_deferredLogger;
report_step_starts_ = true;
const Grid& grid = ebosSimulator_.vanguard().grid();
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
@ -439,6 +440,9 @@ namespace Opm {
BlackoilWellModel<TypeTag>::
timeStepSucceeded(const double& simulationTime, const double dt) {
// time step is finished and we are not any more at the beginning of an report step
report_step_starts_ = false;
Opm::DeferredLogger local_deferredLogger;
for (const auto& well : well_container_) {
if (GET_PROP_VALUE(TypeTag, EnablePolymerMW) && well->isInjector()) {
@ -834,10 +838,10 @@ namespace Opm {
calculateExplicitQuantities(local_deferredLogger);
prepareTimeStep(local_deferredLogger);
}
// also check the current group control the first two iterations. The first itertion is needed for changes in group/well controls and closing of wells etc.
// check the current group control in the beginning of an episode for the first two iterations. The first itertion is needed for changes in group/well controls and closing of wells etc.
// a second check is needed for REIN and VREP controls since they depend on results from other wells.
// This check can probably be made more sofisticated, but this simple rule seems to work
bool checkCurrentGroupControls = (iterationIdx < 2);
bool checkCurrentGroupControls = (report_step_starts_ && iterationIdx < 2);
updateWellControls(local_deferredLogger, /*allow for switching to group controls*/true, checkCurrentGroupControls);
// Set the well primary variables based on the value of well solutions