mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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;
|
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
|
} // namespace Opm
|
||||||
|
@ -44,6 +44,9 @@ public:
|
|||||||
//! \brief Checks if well has THP constraints.
|
//! \brief Checks if well has THP constraints.
|
||||||
bool wellHasTHPConstraints(const SummaryState& summaryState) const;
|
bool wellHasTHPConstraints(const SummaryState& summaryState) const;
|
||||||
|
|
||||||
|
//! \brief Get THP constraint for well.
|
||||||
|
double getTHPConstraint(const SummaryState& summaryState) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
const WellInterfaceGeneric& well_; //!< Reference to well interface
|
||||||
};
|
};
|
||||||
|
@ -227,17 +227,8 @@ double WellInterfaceGeneric::getTHPConstraint(const SummaryState& summaryState)
|
|||||||
if (dynamic_thp_limit_) {
|
if (dynamic_thp_limit_) {
|
||||||
return *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( )) {
|
return WellBhpThpCalculator(*this).getTHPConstraint(summaryState);
|
||||||
const auto& controls = well_ecl_.productionControls(summaryState);
|
|
||||||
return controls.thp_limit;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WellInterfaceGeneric::underPredictionMode() const
|
bool WellInterfaceGeneric::underPredictionMode() const
|
||||||
|
Loading…
Reference in New Issue
Block a user