mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-12 01:11:55 -06:00
move checkGroupConstraints into BlackoilWellModelConstraints
This commit is contained in:
parent
df27ec5d4d
commit
82cf0deef4
@ -337,4 +337,41 @@ checkGroupProductionConstraints(const Group& group,
|
||||
return std::make_pair(Group::ProductionCMode::NONE, 1.0);
|
||||
}
|
||||
|
||||
bool BlackoilWellModelConstraints::
|
||||
checkGroupConstraints(const Group& group,
|
||||
const int reportStepIdx,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
if (group.isInjectionGroup()) {
|
||||
const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS};
|
||||
for (Phase phase : all) {
|
||||
if (!group.hasInjectionControl(phase)) {
|
||||
continue;
|
||||
}
|
||||
const auto& check = this->checkGroupInjectionConstraints(group,
|
||||
reportStepIdx, phase);
|
||||
if (check.first != Group::InjectionCMode::NONE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (group.isProductionGroup()) {
|
||||
const auto& check = this->checkGroupProductionConstraints(group,
|
||||
reportStepIdx,
|
||||
deferred_logger);
|
||||
if (check.first != Group::ProductionCMode::NONE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// call recursively down the group hierarchy
|
||||
bool violated = false;
|
||||
for (const std::string& groupName : group.groups()) {
|
||||
const auto& grp = wellModel_.schedule().getGroup(groupName, reportStepIdx);
|
||||
violated = violated || this->checkGroupConstraints(grp, reportStepIdx, deferred_logger);
|
||||
}
|
||||
return violated;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -57,6 +57,11 @@ public:
|
||||
const int reportStepIdx,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
//! \brief Check the constraints of a well group.
|
||||
bool checkGroupConstraints(const Group& group,
|
||||
const int reportStepIdx,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
private:
|
||||
const BlackoilWellModelGeneric& wellModel_; //!< Reference to well model
|
||||
};
|
||||
|
@ -540,44 +540,6 @@ initializeWellPerfData()
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
BlackoilWellModelGeneric::
|
||||
checkGroupConstraints(const Group& group,
|
||||
const int reportStepIdx,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
if (group.isInjectionGroup()) {
|
||||
const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS};
|
||||
for (Phase phase : all) {
|
||||
if (!group.hasInjectionControl(phase)) {
|
||||
continue;
|
||||
}
|
||||
const auto& check =
|
||||
BlackoilWellModelConstraints(*this).
|
||||
checkGroupInjectionConstraints(group, reportStepIdx, phase);
|
||||
if (check.first != Group::InjectionCMode::NONE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (group.isProductionGroup()) {
|
||||
const auto& check =
|
||||
BlackoilWellModelConstraints(*this).
|
||||
checkGroupProductionConstraints(group, reportStepIdx, deferred_logger);
|
||||
if (check.first != Group::ProductionCMode::NONE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// call recursively down the group hiearchy
|
||||
bool violated = false;
|
||||
for (const std::string& groupName : group.groups()) {
|
||||
violated = violated || checkGroupConstraints( schedule().getGroup(groupName, reportStepIdx), reportStepIdx, deferred_logger);
|
||||
}
|
||||
return violated;
|
||||
}
|
||||
|
||||
void
|
||||
BlackoilWellModelGeneric::
|
||||
checkGconsaleLimits(const Group& group,
|
||||
|
@ -293,10 +293,6 @@ protected:
|
||||
|
||||
void calculateEfficiencyFactors(const int reportStepIdx);
|
||||
|
||||
bool checkGroupConstraints(const Group& group,
|
||||
const int reportStepIdx,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
void checkGconsaleLimits(const Group& group,
|
||||
WellState& well_state,
|
||||
const int reportStepIdx,
|
||||
|
Loading…
Reference in New Issue
Block a user