mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move updateWellTestStatePhysical to WellTest
This commit is contained in:
parent
e2b5fc8082
commit
8b503f9a00
@ -24,7 +24,6 @@
|
||||
|
||||
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
|
||||
|
||||
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
|
||||
#include <opm/input/eclipse/Schedule/Schedule.hpp>
|
||||
|
||||
#include <opm/simulators/utils/DeferredLogger.hpp>
|
||||
@ -513,12 +512,13 @@ updateWellTestState(const SingleWellState& ws,
|
||||
WellTestState& wellTestState,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
// updating well test state based on physical (THP/BHP) limits.
|
||||
updateWellTestStatePhysical(simulationTime, writeMessageToOPMLog, wellTestState, deferred_logger);
|
||||
|
||||
// updating well test state based on Economic limits for operable wells
|
||||
if (this->isOperableAndSolvable())
|
||||
if (this->isOperableAndSolvable()) {
|
||||
WellTest(*this).updateWellTestStateEconomic(ws, simulationTime, writeMessageToOPMLog, wellTestState, deferred_logger);
|
||||
} else {
|
||||
// updating well test state based on physical (THP/BHP) limits.
|
||||
WellTest(*this).updateWellTestStatePhysical(simulationTime, writeMessageToOPMLog, wellTestState, deferred_logger);
|
||||
}
|
||||
|
||||
// TODO: well can be shut/closed due to other reasons
|
||||
}
|
||||
|
@ -394,26 +394,6 @@ bool WellInterfaceGeneric::isVFPActive(DeferredLogger& deferred_logger) const
|
||||
}
|
||||
}
|
||||
|
||||
void WellInterfaceGeneric::updateWellTestStatePhysical(const double simulation_time,
|
||||
const bool write_message_to_opmlog,
|
||||
WellTestState& well_test_state,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
if (!isOperableAndSolvable()) {
|
||||
if (well_test_state.well_is_closed(name())) {
|
||||
// Already closed, do nothing.
|
||||
} else {
|
||||
well_test_state.close_well(name(), WellTestConfig::Reason::PHYSICAL, simulation_time);
|
||||
if (write_message_to_opmlog) {
|
||||
const std::string action = well_ecl_.getAutomaticShutIn() ? "shut" : "stopped";
|
||||
const std::string msg = "Well " + name()
|
||||
+ " will be " + action + " as it can not operate under current reservoir conditions.";
|
||||
deferred_logger.info(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool WellInterfaceGeneric::isOperableAndSolvable() const
|
||||
{
|
||||
return operability_status_.isOperableAndSolvable();
|
||||
|
@ -202,10 +202,6 @@ public:
|
||||
protected:
|
||||
bool getAllowCrossFlow() const;
|
||||
double mostStrictBhpFromBhpLimits(const SummaryState& summaryState) const;
|
||||
void updateWellTestStatePhysical(const double simulation_time,
|
||||
const bool write_message_to_opmlog,
|
||||
WellTestState& well_test_state,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
std::optional<double> bhpMax(const std::function<double(const double)>& fflo,
|
||||
const double bhp_limit,
|
||||
|
@ -437,4 +437,23 @@ void WellTest::updateWellTestStateEconomic(const SingleWellState& ws,
|
||||
}
|
||||
}
|
||||
|
||||
void WellTest::updateWellTestStatePhysical(const double simulation_time,
|
||||
const bool write_message_to_opmlog,
|
||||
WellTestState& well_test_state,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
if (well_test_state.well_is_closed(well_.name())) {
|
||||
// Already closed, do nothing.
|
||||
} else {
|
||||
well_test_state.close_well(well_.name(), WellTestConfig::Reason::PHYSICAL, simulation_time);
|
||||
if (write_message_to_opmlog) {
|
||||
const std::string action = well_.wellEcl().getAutomaticShutIn() ? "shut" : "stopped";
|
||||
const std::string msg = "Well " + well_.name()
|
||||
+ " will be " + action + " as it can not operate under current reservoir conditions.";
|
||||
deferred_logger.info(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -49,6 +49,11 @@ public:
|
||||
WellTestState& well_test_state,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
void updateWellTestStatePhysical(const double simulation_time,
|
||||
const bool write_message_to_opmlog,
|
||||
WellTestState& well_test_state,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
private:
|
||||
struct RatioLimitCheckReport {
|
||||
static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
|
||||
|
Loading…
Reference in New Issue
Block a user