checking whethter group control is active

When applying group control related functions.
This commit is contained in:
Kai Bao 2016-11-17 14:21:46 +01:00
parent d38a6eb459
commit 0ab04b04cd
4 changed files with 37 additions and 25 deletions

View File

@ -790,10 +790,12 @@ namespace detail {
// get reasonable initial conditions for the wells // get reasonable initial conditions for the wells
asImpl().wellModel().updateWellControls(well_state); asImpl().wellModel().updateWellControls(well_state);
// enforce VREP control when necessary. if (asImpl().wellModel().wellCollection()->groupControlActive()) {
applyVREPGroupControl(reservoir_state, well_state); // enforce VREP control when necessary.
applyVREPGroupControl(reservoir_state, well_state);
asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates()); asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates());
}
// Create the primary variables. // Create the primary variables.
SolutionState state = asImpl().variableState(reservoir_state, well_state); SolutionState state = asImpl().variableState(reservoir_state, well_state);
@ -1097,9 +1099,12 @@ namespace detail {
// wells active or not as parallel logging will take place that needs to // wells active or not as parallel logging will take place that needs to
// communicate with all processes. // communicate with all processes.
asImpl().wellModel().updateWellControls(well_state); asImpl().wellModel().updateWellControls(well_state);
// Enforce the VREP control
applyVREPGroupControl(reservoir_state, well_state); if (asImpl().wellModel().wellCollection()->groupControlActive()) {
asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates()); // Enforce the VREP control
applyVREPGroupControl(reservoir_state, well_state);
asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates());
}
} while (it < 15); } while (it < 15);
if (converged) { if (converged) {

View File

@ -147,6 +147,7 @@ namespace Opm {
: wells_multisegment_( createMSWellVector(wells_arg, wells_ecl, time_step) ) : wells_multisegment_( createMSWellVector(wells_arg, wells_ecl, time_step) )
, wops_ms_(wells_multisegment_) , wops_ms_(wells_multisegment_)
, well_collection_(well_collection) , well_collection_(well_collection)
, well_perforation_efficiency_factors_(Vector::Ones(numWells()))
, num_phases_(wells_arg ? wells_arg->number_of_phases : 0) , num_phases_(wells_arg ? wells_arg->number_of_phases : 0)
, wells_(wells_arg) , wells_(wells_arg)
, fluid_(nullptr) , fluid_(nullptr)

View File

@ -904,16 +904,18 @@ namespace Opm
break; break;
} }
// get the well node in the well collection if (wellCollection()->groupControlActive()) {
WellNode& well_node = well_collection_->findWellNode(std::string(wells().name[w])); // get the well node in the well collection
WellNode& well_node = well_collection_->findWellNode(std::string(wells().name[w]));
// update whehter the well is under group control or individual control // update whehter the well is under group control or individual control
if (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) { if (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) {
// under group control // under group control
well_node.setIndividualControl(false); well_node.setIndividualControl(false);
} else { } else {
// individual control // individual control
well_node.setIndividualControl(true); well_node.setIndividualControl(true);
}
} }
} }

View File

@ -76,7 +76,7 @@ namespace Opm
, wells_(wells_arg) , wells_(wells_arg)
, wops_(wells_arg) , wops_(wells_arg)
, well_collection_(well_collection) , well_collection_(well_collection)
, well_perforation_efficiency_factors_(Vector()) , well_perforation_efficiency_factors_(Vector::Ones(wells_!=nullptr ? wells_->well_connpos[wells_->number_of_wells] : 0))
, fluid_(nullptr) , fluid_(nullptr)
, active_(nullptr) , active_(nullptr)
, phase_condition_(nullptr) , phase_condition_(nullptr)
@ -852,16 +852,20 @@ namespace Opm
break; break;
} }
// get well node in the well collection
WellNode& well_node = well_collection_->findWellNode(std::string(wells().name[w]));
// update whehter the well is under group control or individual control if (wellCollection()->groupControlActive()) {
if (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) {
// under group control // get well node in the well collection
well_node.setIndividualControl(false); WellNode& well_node = well_collection_->findWellNode(std::string(wells().name[w]));
} else {
// individual control // update whehter the well is under group control or individual control
well_node.setIndividualControl(true); if (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) {
// under group control
well_node.setIndividualControl(false);
} else {
// individual control
well_node.setIndividualControl(true);
}
} }
} }