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
asImpl().wellModel().updateWellControls(well_state);
// enforce VREP control when necessary.
applyVREPGroupControl(reservoir_state, well_state);
if (asImpl().wellModel().wellCollection()->groupControlActive()) {
// 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.
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
// communicate with all processes.
asImpl().wellModel().updateWellControls(well_state);
// Enforce the VREP control
applyVREPGroupControl(reservoir_state, well_state);
asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates());
if (asImpl().wellModel().wellCollection()->groupControlActive()) {
// Enforce the VREP control
applyVREPGroupControl(reservoir_state, well_state);
asImpl().wellModel().wellCollection()->updateWellTargets(well_state.wellRates());
}
} while (it < 15);
if (converged) {

View File

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

View File

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

View File

@ -76,7 +76,7 @@ namespace Opm
, wells_(wells_arg)
, wops_(wells_arg)
, 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)
, active_(nullptr)
, phase_condition_(nullptr)
@ -852,16 +852,20 @@ namespace Opm
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 (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) {
// under group control
well_node.setIndividualControl(false);
} else {
// individual control
well_node.setIndividualControl(true);
if (wellCollection()->groupControlActive()) {
// 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 (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) {
// under group control
well_node.setIndividualControl(false);
} else {
// individual control
well_node.setIndividualControl(true);
}
}
}