move updateWellTestState to WellInterfaceGeneric

This commit is contained in:
Arne Morten Kvarving 2022-10-24 11:06:35 +02:00
parent 8b503f9a00
commit 0cc0b29a14
5 changed files with 27 additions and 32 deletions

View File

@ -34,7 +34,6 @@
#include <opm/simulators/wells/TargetCalculator.hpp> #include <opm/simulators/wells/TargetCalculator.hpp>
#include <opm/simulators/wells/WellGroupHelpers.hpp> #include <opm/simulators/wells/WellGroupHelpers.hpp>
#include <opm/simulators/wells/WellState.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WellTest.hpp>
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
@ -503,26 +502,6 @@ checkConstraints(WellState& well_state,
} }
} }
template<typename FluidSystem>
void
WellInterfaceFluidSystem<FluidSystem>::
updateWellTestState(const SingleWellState& ws,
const double& simulationTime,
const bool& writeMessageToOPMLog,
WellTestState& wellTestState,
DeferredLogger& deferred_logger) const
{
// updating well test state based on Economic limits for operable wells
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
}
template<typename FluidSystem> template<typename FluidSystem>
int int
WellInterfaceFluidSystem<FluidSystem>:: WellInterfaceFluidSystem<FluidSystem>::

View File

@ -52,12 +52,6 @@ protected:
static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max(); static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
public: public:
void updateWellTestState(const SingleWellState& ws,
const double& simulationTime,
const bool& writeMessageToOPMLog,
WellTestState& wellTestState,
DeferredLogger& deferred_logger) const;
int flowPhaseToEbosPhaseIdx(const int phaseIdx) const; int flowPhaseToEbosPhaseIdx(const int phaseIdx) const;
static constexpr int Water = BlackoilPhases::Aqua; static constexpr int Water = BlackoilPhases::Aqua;

View File

@ -27,10 +27,11 @@
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp> #include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/wells/PerforationData.hpp> #include <opm/simulators/wells/PerforationData.hpp>
#include <opm/simulators/wells/ParallelWellInfo.hpp> #include <opm/simulators/wells/ParallelWellInfo.hpp>
#include <opm/simulators/wells/VFPProperties.hpp>
#include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WellHelpers.hpp>
#include <opm/simulators/wells/VFPHelpers.hpp> #include <opm/simulators/wells/VFPHelpers.hpp>
#include <opm/simulators/wells/VFPProperties.hpp>
#include <opm/simulators/wells/WellHelpers.hpp>
#include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WellTest.hpp>
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
#include <cstddef> #include <cstddef>
@ -215,6 +216,24 @@ double WellInterfaceGeneric::mostStrictBhpFromBhpLimits(const SummaryState& summ
return 0.0; return 0.0;
} }
void WellInterfaceGeneric::updateWellTestState(const SingleWellState& ws,
const double& simulationTime,
const bool& writeMessageToOPMLog,
WellTestState& wellTestState,
DeferredLogger& deferred_logger) const
{
// updating well test state based on Economic limits for operable wells
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
}
double WellInterfaceGeneric::getTHPConstraint(const SummaryState& summaryState) const double WellInterfaceGeneric::getTHPConstraint(const SummaryState& summaryState) const
{ {
if (dynamic_thp_limit_) { if (dynamic_thp_limit_) {

View File

@ -197,7 +197,11 @@ public:
DeferredLogger& deferred_logger DeferredLogger& deferred_logger
) const; ) const;
void updateWellTestState(const SingleWellState& ws,
const double& simulationTime,
const bool& writeMessageToOPMLog,
WellTestState& wellTestState,
DeferredLogger& deferred_logger) const;
protected: protected:
bool getAllowCrossFlow() const; bool getAllowCrossFlow() const;

View File

@ -455,5 +455,4 @@ void WellTest::updateWellTestStatePhysical(const double simulation_time,
} }
} }
} // namespace Opm } // namespace Opm