mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-08-17 18:04:49 -05:00
Merge pull request #1101 from jokva/changes-in-grouptree
GroupTree interface changed upstream
This commit is contained in:
@@ -735,15 +735,6 @@ namespace Opm
|
||||
|
||||
}
|
||||
|
||||
void WellsManager::addChildGroups(const GroupTreeNode& parentNode, const Schedule& schedule, size_t timeStep, const PhaseUsage& phaseUsage) {
|
||||
for (auto childIter = parentNode.begin(); childIter != parentNode.end(); ++childIter) {
|
||||
const auto& childNode = (*childIter).second;
|
||||
well_collection_.addGroup(schedule.getGroup(childNode->name()), parentNode.name(), timeStep, phaseUsage);
|
||||
addChildGroups(*childNode, schedule, timeStep, phaseUsage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WellsManager::setupGuideRates(std::vector< const Well* >& wells, const size_t timeStep, std::vector<WellData>& well_data, std::map<std::string, int>& well_names_to_index,
|
||||
const PhaseUsage& phaseUsage, const std::vector<double>& well_potentials)
|
||||
{
|
||||
|
||||
@@ -194,7 +194,6 @@ namespace Opm
|
||||
const std::unordered_set<std::string>& deactivated_wells,
|
||||
const DynamicListEconLimited& list_econ_limited);
|
||||
|
||||
void addChildGroups(const GroupTreeNode& parentNode, const Schedule& schedule, size_t timeStep, const PhaseUsage& phaseUsage);
|
||||
void setupGuideRates(std::vector<const Well*>& wells, const size_t timeStep, std::vector<WellData>& well_data, std::map<std::string, int>& well_names_to_index,
|
||||
const PhaseUsage& phaseUsage, const std::vector<double>& well_potentials);
|
||||
// Data
|
||||
|
||||
@@ -404,13 +404,23 @@ WellsManager::init(const Opm::EclipseState& eclipseState,
|
||||
setupWellControls(wells, timeStep, well_names, pu, wells_on_proc, list_econ_limited);
|
||||
|
||||
{
|
||||
const auto& fieldNode =
|
||||
schedule.getGroupTree(timeStep).getNode("FIELD");
|
||||
|
||||
const auto& fieldGroup = schedule.getGroup(fieldNode->name());
|
||||
|
||||
const auto& fieldGroup = schedule.getGroup( "FIELD" );
|
||||
well_collection_.addField(fieldGroup, timeStep, pu);
|
||||
addChildGroups(*fieldNode, schedule, timeStep, pu);
|
||||
|
||||
const auto& grouptree = schedule.getGroupTree( timeStep );
|
||||
std::vector< std::string > group_stack = { "FIELD" };
|
||||
|
||||
do {
|
||||
auto parent = group_stack.back();
|
||||
group_stack.pop_back();
|
||||
const auto& children = grouptree.children( parent );
|
||||
group_stack.insert( group_stack.end(), children.begin(), children.end() );
|
||||
|
||||
for( const auto& child : children ) {
|
||||
well_collection_.addGroup( schedule.getGroup( child ), parent, timeStep, pu );
|
||||
}
|
||||
|
||||
} while( !group_stack.empty() );
|
||||
}
|
||||
|
||||
for (auto w = wells.begin(), e = wells.end(); w != e; ++w) {
|
||||
|
||||
Reference in New Issue
Block a user