mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BlackoilWellModel: move hasTHPConstraints to generic class
This commit is contained in:
@@ -261,9 +261,6 @@ namespace Opm {
|
||||
// called at the beginning of a report step
|
||||
void beginReportStep(const int time_step);
|
||||
|
||||
/// Return true if any well has a THP constraint.
|
||||
bool hasTHPConstraints() const;
|
||||
|
||||
/// Shut down any single well, but only if it is in prediction mode.
|
||||
/// Returns true if the well was actually found and shut.
|
||||
bool forceShutWellByNameIfPredictionMode(const std::string& wellname, const double simulation_time);
|
||||
|
||||
@@ -1508,4 +1508,17 @@ updateAndCommunicateGroupData(const int reportStepIdx,
|
||||
updateWsolvent(fieldGroup, reportStepIdx, well_state_nupcol);
|
||||
}
|
||||
|
||||
bool
|
||||
BlackoilWellModelGeneric::
|
||||
hasTHPConstraints() const
|
||||
{
|
||||
int local_result = false;
|
||||
for (const auto& well : well_container_generic_) {
|
||||
if (well->wellHasTHPConstraints(summaryState_)) {
|
||||
local_result=true;
|
||||
}
|
||||
}
|
||||
return comm_.max(local_result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -138,6 +138,9 @@ public:
|
||||
|
||||
data::GroupAndNetworkValues groupAndNetworkData(const int reportStepIdx) const;
|
||||
|
||||
/// Return true if any well has a THP constraint.
|
||||
bool hasTHPConstraints() const;
|
||||
|
||||
protected:
|
||||
GroupState& groupState() { return this->active_wgstate_.group_state; }
|
||||
|
||||
|
||||
@@ -156,25 +156,6 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
/// Return true if any well has a THP constraint.
|
||||
template<typename TypeTag>
|
||||
bool
|
||||
BlackoilWellModel<TypeTag>::
|
||||
hasTHPConstraints() const
|
||||
{
|
||||
int local_result = false;
|
||||
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
|
||||
for (const auto& well : well_container_) {
|
||||
if (well->wellHasTHPConstraints(summaryState)) {
|
||||
local_result=true;
|
||||
}
|
||||
}
|
||||
return grid().comm().max(local_result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// Return true if the well was found and shut.
|
||||
template<typename TypeTag>
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user