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.
bool hasTHPConstraints() const;
/// Shut down any single well.
void forceShutWellByName(const std::string& wellname, const double simulation_time);
/// Shut down any single well, but only if it is in prediction mode.
void forceShutWellByNameIfPredictionMode(const std::string& wellname, const double simulation_time);
protected:

View File

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

View File

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

View File

@ -378,7 +378,7 @@ namespace Opm {
} else {
// Close all consistently 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);
if (solverVerbose_) {