mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
keep current injection and production control
This commit is contained in:
parent
008eb17693
commit
04701580d8
@ -35,17 +35,21 @@ namespace Opm {
|
||||
setCmodeGroup( schedule.getGroup2(groupName, reportStepIdx), schedule, summaryState, reportStepIdx, wellState);
|
||||
}
|
||||
|
||||
// use FLD as default control
|
||||
wellState.setCurrentInjectionGroupControl(group.name(), Group2::InjectionCMode::FLD);
|
||||
wellState.setCurrentProductionGroupControl(group.name(), Group2::ProductionCMode::FLD);
|
||||
|
||||
if (group.isInjectionGroup()) {
|
||||
const auto controls = group.injectionControls(summaryState);
|
||||
wellState.setCurrentInjectionGroupControl(group.name(), controls.cmode);
|
||||
if (!wellState.hasInjectionGroupControl(group.name())) {
|
||||
// use NONE as default control
|
||||
wellState.setCurrentInjectionGroupControl(group.name(), Group2::InjectionCMode::NONE);
|
||||
if (group.isInjectionGroup()) {
|
||||
const auto controls = group.injectionControls(summaryState);
|
||||
wellState.setCurrentInjectionGroupControl(group.name(), controls.cmode);
|
||||
}
|
||||
}
|
||||
if (group.isProductionGroup()) {
|
||||
const auto controls = group.productionControls(summaryState);
|
||||
wellState.setCurrentProductionGroupControl(group.name(), controls.cmode);
|
||||
if (!wellState.hasProductionGroupControl(group.name())) {
|
||||
// use NONE as default control
|
||||
wellState.setCurrentProductionGroupControl(group.name(), Group2::ProductionCMode::NONE);
|
||||
if (group.isProductionGroup()) {
|
||||
const auto controls = group.productionControls(summaryState);
|
||||
wellState.setCurrentProductionGroupControl(group.name(), controls.cmode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,9 +160,6 @@ namespace Opm
|
||||
|
||||
current_injection_controls_.resize(nw);
|
||||
current_production_controls_.resize(nw);
|
||||
current_injection_group_controls_.clear();
|
||||
current_production_group_controls_.clear();
|
||||
|
||||
|
||||
perfRateSolvent_.clear();
|
||||
perfRateSolvent_.resize(nperf, 0.0);
|
||||
@ -326,6 +323,14 @@ namespace Opm
|
||||
std::vector<Well2::ProducerCMode>& currentProductionControls() { return current_production_controls_; }
|
||||
const std::vector<Well2::ProducerCMode>& currentProductionControls() const { return current_production_controls_; }
|
||||
|
||||
bool hasProductionGroupControl(const std::string& groupName) {
|
||||
return current_production_group_controls_.count(groupName) > 0;
|
||||
}
|
||||
|
||||
bool hasInjectionGroupControl(const std::string& groupName) {
|
||||
return current_injection_group_controls_.count(groupName) > 0;
|
||||
}
|
||||
|
||||
/// One current control per group.
|
||||
void setCurrentProductionGroupControl(const std::string& groupName, const Group2::ProductionCMode& groupControl ) {
|
||||
current_production_group_controls_[groupName] = groupControl;
|
||||
|
Loading…
Reference in New Issue
Block a user