Only shut down wells if under prediction-type control.

This commit is contained in:
Atgeirr Flø Rasmussen 2018-11-23 12:51:13 +01:00
parent 1979fc8f5d
commit 8bd3cbc1c1
4 changed files with 11 additions and 8 deletions

View File

@ -239,8 +239,8 @@ namespace Opm {
/// Return true if any well has a THP constraint. /// Return true if any well has a THP constraint.
bool hasTHPConstraints() const; bool hasTHPConstraints() const;
/// Shut down any single well. /// Shut down any single well, but only if it is in prediction mode.
void forceShutWellByName(const std::string& wellname, const double simulation_time); void forceShutWellByNameIfPredictionMode(const std::string& wellname, const double simulation_time);
protected: protected:

View File

@ -137,14 +137,16 @@ namespace Opm {
template<typename TypeTag> template<typename TypeTag>
void void
BlackoilWellModel<TypeTag>:: BlackoilWellModel<TypeTag>::
forceShutWellByName(const std::string& wellname, forceShutWellByNameIfPredictionMode(const std::string& wellname,
const double simulation_time) const double simulation_time)
{ {
// Only add the well to the closed list on the // Only add the well to the closed list on the
// process that owns it. // process that owns it.
for (const auto& well : well_container_) { for (const auto& well : well_container_) {
if (well->name() == wellname) { if (well->name() == wellname) {
wellTestState_.addClosedWell(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time); if (well->underPredictionMode()) {
wellTestState_.addClosedWell(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time);
}
break; break;
} }
} }

View File

@ -231,6 +231,9 @@ namespace Opm
/// Returns true if the well has one or more THP limits/constraints. /// Returns true if the well has one or more THP limits/constraints.
bool wellHasTHPConstraints() const; bool wellHasTHPConstraints() const;
/// Returns true if the well is currently in prediction mode (i.e. not history mode).
bool underPredictionMode() const;
protected: protected:
// to indicate a invalid completion // to indicate a invalid completion
@ -325,8 +328,6 @@ namespace Opm
bool checkRateEconLimits(const WellEconProductionLimits& econ_production_limits, bool checkRateEconLimits(const WellEconProductionLimits& econ_production_limits,
const WellState& well_state) const; const WellState& well_state) const;
bool underPredictionMode() const;
double getTHPConstraint() const; double getTHPConstraint() const;
int getTHPControlIndex() const; int getTHPControlIndex() const;

View File

@ -378,7 +378,7 @@ namespace Opm {
} else { } else {
// Close all consistently failing wells. // Close all consistently failing wells.
for (const auto& well : failing_wells) { for (const auto& well : failing_wells) {
solver.model().wellModel().forceShutWellByName(well, substepTimer.simulationTimeElapsed()); solver.model().wellModel().forceShutWellByNameIfPredictionMode(well, substepTimer.simulationTimeElapsed());
} }
substepTimer.provideTimeStepEstimate(dt); substepTimer.provideTimeStepEstimate(dt);
if (solverVerbose_) { if (solverVerbose_) {