mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move checkIndividualConstraints to WellConstraints
This commit is contained in:
@@ -32,6 +32,37 @@
|
|||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
|
||||||
|
bool WellConstraints::
|
||||||
|
checkIndividualConstraints(SingleWellState& ws,
|
||||||
|
const SummaryState& summaryState,
|
||||||
|
const RateConvFunc& calcReservoirVoidageRates,
|
||||||
|
bool& thp_limit_violated_but_not_switched,
|
||||||
|
DeferredLogger& deferred_logger) const
|
||||||
|
{
|
||||||
|
if (well_.isProducer()) {
|
||||||
|
auto new_cmode = this->activeProductionConstraint(ws, summaryState,
|
||||||
|
calcReservoirVoidageRates,
|
||||||
|
thp_limit_violated_but_not_switched,
|
||||||
|
deferred_logger);
|
||||||
|
if (new_cmode != ws.production_cmode) {
|
||||||
|
ws.production_cmode = new_cmode;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (well_.isInjector()) {
|
||||||
|
auto new_cmode = this->activeInjectionConstraint(ws, summaryState,
|
||||||
|
thp_limit_violated_but_not_switched,
|
||||||
|
deferred_logger);
|
||||||
|
if (new_cmode != ws.injection_cmode) {
|
||||||
|
ws.injection_cmode = new_cmode;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Well::InjectorCMode WellConstraints::
|
Well::InjectorCMode WellConstraints::
|
||||||
activeInjectionConstraint(const SingleWellState& ws,
|
activeInjectionConstraint(const SingleWellState& ws,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
|
|||||||
@@ -49,6 +49,14 @@ public:
|
|||||||
const std::vector<double>&,
|
const std::vector<double>&,
|
||||||
std::vector<double>&)>;
|
std::vector<double>&)>;
|
||||||
|
|
||||||
|
bool
|
||||||
|
checkIndividualConstraints(SingleWellState& ws,
|
||||||
|
const SummaryState& summaryState,
|
||||||
|
const RateConvFunc& calcReservoirVoidageRates,
|
||||||
|
bool& thp_limit_violated_but_not_switched,
|
||||||
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
|
private:
|
||||||
Well::InjectorCMode
|
Well::InjectorCMode
|
||||||
activeInjectionConstraint(const SingleWellState& ws,
|
activeInjectionConstraint(const SingleWellState& ws,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
@@ -62,7 +70,6 @@ public:
|
|||||||
bool& thp_limit_violated_but_not_switched,
|
bool& thp_limit_violated_but_not_switched,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
private:
|
|
||||||
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -98,29 +98,10 @@ checkIndividualConstraints(SingleWellState& ws,
|
|||||||
surface_rates, voidage_rates);
|
surface_rates, voidage_rates);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this->well_ecl_.isProducer()) {
|
return WellConstraints(*this).
|
||||||
auto new_cmode = WellConstraints(*this).activeProductionConstraint(ws, summaryState,
|
checkIndividualConstraints(ws, summaryState, rRates,
|
||||||
rRates,
|
|
||||||
this->operability_status_.thp_limit_violated_but_not_switched,
|
this->operability_status_.thp_limit_violated_but_not_switched,
|
||||||
deferred_logger);
|
deferred_logger);
|
||||||
if (new_cmode != ws.production_cmode) {
|
|
||||||
ws.production_cmode = new_cmode;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->well_ecl_.isInjector()) {
|
|
||||||
auto new_cmode = WellConstraints(*this).
|
|
||||||
activeInjectionConstraint(ws, summaryState,
|
|
||||||
this->operability_status_.thp_limit_violated_but_not_switched,
|
|
||||||
deferred_logger);
|
|
||||||
if (new_cmode != ws.injection_cmode) {
|
|
||||||
ws.injection_cmode = new_cmode;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FluidSystem>
|
template <typename FluidSystem>
|
||||||
|
|||||||
Reference in New Issue
Block a user