Merge pull request #2141 from totto82/fixGroupFraction

fix group fraction bug
This commit is contained in:
Atgeirr Flø Rasmussen 2019-11-05 16:18:01 +01:00 committed by GitHub
commit 20f767555e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,11 +287,11 @@ namespace Opm {
// only count group under group control from its parent
if (isInjector) {
const Group2::InjectionCMode& currentGroupControl = wellState.currentInjectionGroupControl(group.name());
const Group2::InjectionCMode& currentGroupControl = wellState.currentInjectionGroupControl(groupName);
if (currentGroupControl != Group2::InjectionCMode::FLD)
continue;
} else {
const Group2::ProductionCMode& currentGroupControl = wellState.currentProductionGroupControl(group.name());
const Group2::ProductionCMode& currentGroupControl = wellState.currentProductionGroupControl(groupName);
if (currentGroupControl != Group2::ProductionCMode::FLD)
continue;
}
@ -303,13 +303,13 @@ namespace Opm {
}
}
if (groupTotalGuideRate == 0.0)
return 0.0;
return 1.0;
double groupGuideRate = guideRate->get(group.name(), groupTarget);
return groupGuideRate / groupTotalGuideRate;
}
inline void accumulateGroupFractions(const std::string& groupName, const std::string& controlGroupName, const Schedule& schedule, const WellStateFullyImplicitBlackoil& wellState,const int reportStepIdx, const GuideRate* guideRate, const Group2::GuideRateTarget& groupTarget, const bool isInjector, double fraction) {
inline void accumulateGroupFractions(const std::string& groupName, const std::string& controlGroupName, const Schedule& schedule, const WellStateFullyImplicitBlackoil& wellState,const int reportStepIdx, const GuideRate* guideRate, const Group2::GuideRateTarget& groupTarget, const bool isInjector, double& fraction) {
const Group2& group = schedule.getGroup2(groupName, reportStepIdx);
if (groupName != controlGroupName) {