mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-02 04:26:55 -06:00
Only shut down wells if under prediction-type control.
This commit is contained in:
parent
1979fc8f5d
commit
8bd3cbc1c1
@ -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:
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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_) {
|
||||
|
Loading…
Reference in New Issue
Block a user