Merge pull request #3607 from totto82/operHist

Check operabiliy for wells under history
This commit is contained in:
Tor Harald Sandve 2021-10-19 09:03:34 +02:00 committed by GitHub
commit 5717a95cb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 38 deletions

View File

@ -587,14 +587,14 @@ namespace Opm {
// Close all consistently failing wells.
int num_shut_wells = 0;
for (const auto& well : failing_wells) {
bool was_shut = solver.model().wellModel().forceShutWellByNameIfPredictionMode(well, substepTimer.simulationTimeElapsed());
bool was_shut = solver.model().wellModel().forceShutWellByName(well, substepTimer.simulationTimeElapsed());
if (was_shut) {
++num_shut_wells;
}
}
if (num_shut_wells == 0) {
// None of the problematic wells were prediction wells,
// so none were shut. We must fall back to chopping again.
// None of the problematic wells were shut.
// We must fall back to chopping again.
chopTimestep();
} else {
substepTimer.provideTimeStepEstimate(dt);

View File

@ -1586,18 +1586,16 @@ hasTHPConstraints() const
bool
BlackoilWellModelGeneric::
forceShutWellByNameIfPredictionMode(const std::string& wellname,
const double simulation_time)
forceShutWellByName(const std::string& wellname,
const double simulation_time)
{
// Only add the well to the closed list on the
// process that owns it.
int well_was_shut = 0;
for (const auto& well : well_container_generic_) {
if (well->name() == wellname && !well->wellIsStopped()) {
if (well->underPredictionMode()) {
wellTestState().close_well(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time);
well_was_shut = 1;
}
wellTestState().close_well(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time);
well_was_shut = 1;
break;
}
}

View File

@ -157,10 +157,10 @@ public:
/// Return true if any well has a THP constraint.
bool hasTHPConstraints() const;
/// Shut down any single well, but only if it is in prediction mode.
/// Shut down any single well
/// Returns true if the well was actually found and shut.
bool forceShutWellByNameIfPredictionMode(const std::string& wellname,
const double simulation_time);
bool forceShutWellByName(const std::string& wellname,
const double simulation_time);
protected:

View File

@ -332,7 +332,6 @@ protected:
bool solveWellForTesting(const Simulator& ebosSimulator, WellState& well_state, const GroupState& group_state,
DeferredLogger& deferred_logger);
bool shutUnsolvableWells() const;
};
}

View File

@ -811,13 +811,6 @@ updateWellTestState(const SingleWellState& ws,
WellTestState& wellTestState,
DeferredLogger& deferred_logger) const
{
// Based on current understanding, only under prediction mode, we need to shut well due to various
// reasons or limits. With more knowlage or testing cases later, this might need to be corrected.
if (!underPredictionMode() ) {
return;
}
// updating well test state based on physical (THP/BHP) limits.
updateWellTestStatePhysical(simulationTime, writeMessageToOPMLog, wellTestState, deferred_logger);

View File

@ -478,7 +478,7 @@ namespace Opm
// unsolvable wells are treated as not operable and will not be solved for in this iteration.
if (!converged) {
if (this->shutUnsolvableWells())
if (param_.shut_unsolvable_wells_)
this->operability_status_.solvable = false;
}
}
@ -551,10 +551,6 @@ namespace Opm
return;
}
if (!this->underPredictionMode() ) {
return;
}
if (this->wellIsStopped() && !changed_to_stopped_this_step_) {
return;
}
@ -563,19 +559,6 @@ namespace Opm
}
template<typename TypeTag>
bool
WellInterface<TypeTag>::
shutUnsolvableWells() const
{
bool shut_unsolvable_wells = param_.shut_unsolvable_wells_;
// the well operability system currently works only for producers in prediction mode
return shut_unsolvable_wells && this->underPredictionMode();
}
template<typename TypeTag>
void