mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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);
|
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,
|
const int reportStepIdx,
|
||||||
DeferredLogger& deferred_logger) const;
|
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:
|
private:
|
||||||
const BlackoilWellModelGeneric& wellModel_; //!< Reference to well model
|
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
|
void
|
||||||
BlackoilWellModelGeneric::
|
BlackoilWellModelGeneric::
|
||||||
checkGconsaleLimits(const Group& group,
|
checkGconsaleLimits(const Group& group,
|
||||||
|
@ -293,10 +293,6 @@ protected:
|
|||||||
|
|
||||||
void calculateEfficiencyFactors(const int reportStepIdx);
|
void calculateEfficiencyFactors(const int reportStepIdx);
|
||||||
|
|
||||||
bool checkGroupConstraints(const Group& group,
|
|
||||||
const int reportStepIdx,
|
|
||||||
DeferredLogger& deferred_logger) const;
|
|
||||||
|
|
||||||
void checkGconsaleLimits(const Group& group,
|
void checkGconsaleLimits(const Group& group,
|
||||||
WellState& well_state,
|
WellState& well_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
|
Loading…
Reference in New Issue
Block a user