mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 01:01:00 -06:00
changed: move getTHPConstraint to WellBhpThpCalculator
This commit is contained in:
parent
cd734f7a0d
commit
d4e06536a0
@ -48,4 +48,20 @@ WellBhpThpCalculator::wellHasTHPConstraints(const SummaryState& summaryState) co
|
||||
return false;
|
||||
}
|
||||
|
||||
double WellBhpThpCalculator::getTHPConstraint(const SummaryState& summaryState) const
|
||||
{
|
||||
const auto& well_ecl = well_.wellEcl();
|
||||
if (well_ecl.isInjector()) {
|
||||
const auto& controls = well_ecl.injectionControls(summaryState);
|
||||
return controls.thp_limit;
|
||||
}
|
||||
|
||||
if (well_ecl.isProducer( )) {
|
||||
const auto& controls = well_ecl.productionControls(summaryState);
|
||||
return controls.thp_limit;
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -44,6 +44,9 @@ public:
|
||||
//! \brief Checks if well has THP constraints.
|
||||
bool wellHasTHPConstraints(const SummaryState& summaryState) const;
|
||||
|
||||
//! \brief Get THP constraint for well.
|
||||
double getTHPConstraint(const SummaryState& summaryState) const;
|
||||
|
||||
private:
|
||||
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
||||
};
|
||||
|
@ -227,17 +227,8 @@ double WellInterfaceGeneric::getTHPConstraint(const SummaryState& summaryState)
|
||||
if (dynamic_thp_limit_) {
|
||||
return *dynamic_thp_limit_;
|
||||
}
|
||||
if (well_ecl_.isInjector()) {
|
||||
const auto& controls = well_ecl_.injectionControls(summaryState);
|
||||
return controls.thp_limit;
|
||||
}
|
||||
|
||||
if (well_ecl_.isProducer( )) {
|
||||
const auto& controls = well_ecl_.productionControls(summaryState);
|
||||
return controls.thp_limit;
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
return WellBhpThpCalculator(*this).getTHPConstraint(summaryState);
|
||||
}
|
||||
|
||||
bool WellInterfaceGeneric::underPredictionMode() const
|
||||
|
Loading…
Reference in New Issue
Block a user