BlackoilWellModel: move hasTHPConstraints to generic class

This commit is contained in:
Arne Morten Kvarving
2021-06-07 12:20:49 +02:00
parent cf6a3801fb
commit 54ff1c4c45
4 changed files with 16 additions and 22 deletions

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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; }

View File

@@ -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