Merge pull request #1107 from GitPaean/fixing_findWellNode
Adding a flag to WellCollection whether group control active
This commit is contained in:
commit
1e462f4c04
@ -50,6 +50,10 @@ namespace Opm
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (groupChild.isProductionGroup(timeStep) || groupChild.isInjectionGroup(timeStep)) {
|
||||||
|
group_control_active_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<WellsGroupInterface> child = createGroupWellsGroup(groupChild, timeStep, phaseUsage);
|
std::shared_ptr<WellsGroupInterface> child = createGroupWellsGroup(groupChild, timeStep, phaseUsage);
|
||||||
|
|
||||||
if (child->injSpec().control_mode_ == InjectionSpecification::VREP) {
|
if (child->injSpec().control_mode_ == InjectionSpecification::VREP) {
|
||||||
@ -308,8 +312,15 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WellCollection::havingVREPGroups() const {
|
bool WellCollection::havingVREPGroups() const
|
||||||
|
{
|
||||||
return having_vrep_groups_;
|
return having_vrep_groups_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool WellCollection::groupControlActive() const
|
||||||
|
{
|
||||||
|
return group_control_active_;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -136,6 +136,9 @@ namespace Opm
|
|||||||
/// When we have VREP group, we need to update the targets based on the updated production voidage rates for each iteration.
|
/// When we have VREP group, we need to update the targets based on the updated production voidage rates for each iteration.
|
||||||
bool havingVREPGroups() const;
|
bool havingVREPGroups() const;
|
||||||
|
|
||||||
|
/// Whether we have active group control
|
||||||
|
bool groupControlActive() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// To account for the possibility of a forest
|
// To account for the possibility of a forest
|
||||||
std::vector<std::shared_ptr<WellsGroupInterface> > roots_;
|
std::vector<std::shared_ptr<WellsGroupInterface> > roots_;
|
||||||
@ -145,6 +148,8 @@ namespace Opm
|
|||||||
|
|
||||||
bool having_vrep_groups_ = false;
|
bool having_vrep_groups_ = false;
|
||||||
|
|
||||||
|
bool group_control_active_ = false;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -423,15 +423,19 @@ WellsManager::init(const Opm::EclipseState& eclipseState,
|
|||||||
} while( !group_stack.empty() );
|
} while( !group_stack.empty() );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto w = wells.begin(), e = wells.end(); w != e; ++w) {
|
for (size_t i = 0; i < wells_on_proc.size(); ++i) {
|
||||||
well_collection_.addWell(*w, timeStep, pu);
|
// wells_on_proc is a vector of flag to indicate whether a well is on the process
|
||||||
|
if (wells_on_proc[i]) {
|
||||||
|
well_collection_.addWell(wells[i], timeStep, pu);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
well_collection_.setWellsPointer(w_);
|
well_collection_.setWellsPointer(w_);
|
||||||
|
|
||||||
setupGuideRates(wells, timeStep, well_data, well_names_to_index, pu, well_potentials);
|
if (well_collection_.groupControlActive()) {
|
||||||
|
setupGuideRates(wells, timeStep, well_data, well_names_to_index, pu, well_potentials);
|
||||||
well_collection_.applyGroupControls();
|
well_collection_.applyGroupControls();
|
||||||
|
}
|
||||||
|
|
||||||
// Debug output.
|
// Debug output.
|
||||||
#define EXTRA_OUTPUT
|
#define EXTRA_OUTPUT
|
||||||
|
Loading…
Reference in New Issue
Block a user