mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 23:20:12 -05:00
UDQ support for GSATPROD
This commit is contained in:
1 parent
165020c1ea
commit
2166d52920
8 files changed
+184
-83
No files matched your search
@@ -136,7 +136,7 @@ void BlackoilModelParameters<Scalar>::registerParameters()
|
||||
("Absolute maximum tolerated for residuals without cutting the time step size");
|
||||
Parameters::Register<Parameters::RelaxedMaxPvFraction<Scalar>>
|
||||
("The fraction of the pore volume of the reservoir "
|
||||
"where the volumetric error (CNV) may be voilated "
|
||||
"where the volumetric error (CNV) may be violated "
|
||||
"during strict Newton iterations.");
|
||||
Parameters::Register<Parameters::ToleranceMb<Scalar>>
|
||||
("Tolerated mass balance error relative to total mass present");
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
#include <opm/simulators/flow/ValidationFunctions.hpp>
|
||||
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParserKeywords/G.hpp>
|
||||
#include <opm/simulators/flow/KeywordValidation.hpp>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
namespace {
|
||||
void validateBRINE(const Opm::DeckKeyword& keyword,
|
||||
std::vector<Opm::KeywordValidation::ValidationError>& errors)
|
||||
@@ -39,6 +42,58 @@ namespace {
|
||||
std::string{"The BRINE keyword does not accept any salt name arguments"}}
|
||||
);
|
||||
}
|
||||
|
||||
// Special case since we support the parsing of the items, which can be UDAs.
|
||||
void validateGSATPROD(const Opm::DeckKeyword& keyword,
|
||||
std::vector<Opm::KeywordValidation::ValidationError>& errors)
|
||||
{
|
||||
if (keyword.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
using Kw = Opm::ParserKeywords::GSATPROD;
|
||||
|
||||
const auto& record = keyword.getRecord(0);
|
||||
|
||||
const auto& resv = record.getItem<Kw::RES_FLUID_VOL_PRODUCTION_RATE>().get<Opm::UDAValue>(0);
|
||||
if (resv.is_defined()) {
|
||||
const auto& resv_val = resv.is<double>() ? fmt::format("{}", resv.get<double>()) : resv.get<std::string>();
|
||||
errors.emplace_back(Opm::KeywordValidation::ValidationError {
|
||||
true,
|
||||
keyword.location(),
|
||||
0, // not relevant
|
||||
5,
|
||||
resv_val,
|
||||
std::string{"Reservoir volume rate is not supported and should be defaulted (1*)"}}
|
||||
);
|
||||
}
|
||||
|
||||
const auto& gaslift = record.getItem<Kw::LIFT_GAS_SUPPLY_RATE>().get<Opm::UDAValue>(0);
|
||||
if (gaslift.is_defined()) {
|
||||
const auto& gaslift_val = gaslift.is<double>() ? fmt::format("{}", gaslift.get<double>()) : gaslift.get<std::string>();
|
||||
errors.emplace_back(Opm::KeywordValidation::ValidationError {
|
||||
true,
|
||||
keyword.location(),
|
||||
0, // not relevant
|
||||
6,
|
||||
gaslift_val,
|
||||
std::string{"Gaslift rate is not supported and should be defaulted (1*)"}}
|
||||
);
|
||||
}
|
||||
|
||||
const auto& calrate = record.getItem<Kw::MEAN_CALORIFIC_VALUE>().get<Opm::UDAValue>(0);
|
||||
if (calrate.is_defined()) {
|
||||
const auto& calrate_val = calrate.is<double>() ? fmt::format("{}", calrate.get<double>()) : calrate.get<std::string>();
|
||||
errors.emplace_back(Opm::KeywordValidation::ValidationError {
|
||||
true,
|
||||
keyword.location(),
|
||||
0, // not relevant
|
||||
7,
|
||||
calrate_val,
|
||||
std::string{"Calorific rate is not used and should be defaulted (1*)"}}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Opm::KeywordValidation {
|
||||
@@ -46,7 +101,7 @@ namespace Opm::KeywordValidation {
|
||||
std::unordered_map<std::string, ValidationFunction>
|
||||
specialValidation()
|
||||
{
|
||||
return {{"BRINE", validateBRINE}};
|
||||
return {{"BRINE", validateBRINE}, {"GSATPROD", validateGSATPROD}};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -577,18 +577,10 @@ partiallySupported()
|
||||
{20,{true, allow_values<double> {}, "GCONPROD(COMBRATE): linearly combined rate is not used and should be defaulted (1*)"}}, // LINEAR_COMBINED_TARGET
|
||||
},
|
||||
},
|
||||
{
|
||||
"GSATPROD",
|
||||
{
|
||||
{5,{true, allow_values<double> {.0}, "GSATPROD(RESV): reservoir volume rate is not supported and should be defaulted (1*)"}}, // RESERVOIR_VOLUME_RATE
|
||||
{6,{true, allow_values<double> {.0}, "GSATPROD(GASLIFT): gaslift rate is not supported and should be defaulted (1*)"}}, // GASLIFT
|
||||
{7,{false, allow_values<double> {.0}, "GSATPROD(CALRATE): calorific rate is not used and should be defaulted (1*)"}}, // CALORIFIC_RATE
|
||||
},
|
||||
},
|
||||
{
|
||||
"GUIDERAT",
|
||||
{
|
||||
{10,{true, [](double x) { return x >= 0; }, "GUIDERAT(GROPT01): only only positive values allowed – will STOP"}}, // ALLOW_INCREASE
|
||||
{10,{true, [](double x) { return x >= 0; }, "GUIDERAT(GROPT01): only positive values allowed – will STOP"}}, // ALLOW_INCREASE
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -70,7 +70,8 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
phasePos,
|
||||
/*isInjector*/true);
|
||||
/*isInjector*/true,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
@@ -99,7 +100,8 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
phasePos,
|
||||
/*isInjector*/true);
|
||||
/*isInjector*/true,
|
||||
wellModel_.summaryState());
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
|
||||
@@ -129,7 +131,8 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
phasePos,
|
||||
/*isInjector*/false);
|
||||
/*isInjector*/false,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
production_Rate = wellModel_.comm().sum(production_Rate);
|
||||
@@ -140,7 +143,8 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
phasePos,
|
||||
/*isInjector*/true);
|
||||
/*isInjector*/true,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
@@ -165,18 +169,21 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(waterPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
voidage_rate += WellGroupHelpersType::sumWellResRates(groupVoidage,
|
||||
wellModel_.schedule(),
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(oilPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
voidage_rate += WellGroupHelpersType::sumWellResRates(groupVoidage,
|
||||
wellModel_.schedule(),
|
||||
well_state, reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(gasPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
voidage_rate = wellModel_.comm().sum(voidage_rate);
|
||||
@@ -187,19 +194,22 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(waterPhaseIdx),
|
||||
true);
|
||||
true,
|
||||
wellModel_.summaryState());
|
||||
total_rate += WellGroupHelpersType::sumWellResRates(group,
|
||||
wellModel_.schedule(),
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(oilPhaseIdx),
|
||||
true);
|
||||
true,
|
||||
wellModel_.summaryState());
|
||||
total_rate += WellGroupHelpersType::sumWellResRates(group,
|
||||
wellModel_.schedule(),
|
||||
wellModel_.schedule(),
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(gasPhaseIdx),
|
||||
true);
|
||||
true,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
total_rate = wellModel_.comm().sum(total_rate);
|
||||
@@ -237,7 +247,8 @@ checkGroupProductionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(oilPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
@@ -261,7 +272,8 @@ checkGroupProductionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(waterPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
@@ -284,7 +296,8 @@ checkGroupProductionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(gasPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
@@ -306,13 +319,15 @@ checkGroupProductionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(oilPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
current_rate += WellGroupHelpersType::sumWellSurfaceRates(group,
|
||||
wellModel_.schedule(),
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(waterPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
@@ -325,7 +340,8 @@ checkGroupProductionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(waterPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
current_water_rate = wellModel_.comm().sum(current_water_rate);
|
||||
if (std::abs(current_water_rate) < 1e-12) {
|
||||
skip = true;
|
||||
@@ -357,21 +373,24 @@ checkGroupProductionConstraints(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(waterPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
current_rate +=
|
||||
WellGroupHelpersType::sumWellResRates(group,
|
||||
wellModel_.schedule(),
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(oilPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
current_rate +=
|
||||
WellGroupHelpersType::sumWellResRates(group,
|
||||
wellModel_.schedule(),
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
pu.canonicalToActivePhaseIdx(gasPhaseIdx),
|
||||
false);
|
||||
false,
|
||||
wellModel_.summaryState());
|
||||
|
||||
// sum over all nodes
|
||||
current_rate = wellModel_.comm().sum(current_rate);
|
||||
|
||||
@@ -510,13 +510,15 @@ checkGconsaleLimits(const Group& group,
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
gasPos,
|
||||
/*isInjector*/false);
|
||||
/*isInjector*/false,
|
||||
this->summaryState_);
|
||||
Scalar injection_rate = WellGroupHelpersType::sumWellSurfaceRates(group,
|
||||
schedule(),
|
||||
well_state,
|
||||
reportStepIdx,
|
||||
gasPos,
|
||||
/*isInjector*/true);
|
||||
/*isInjector*/true,
|
||||
this->summaryState_);
|
||||
// sum over all nodes
|
||||
injection_rate = comm_.sum(injection_rate);
|
||||
production_rate = comm_.sum(production_rate);
|
||||
@@ -658,7 +660,8 @@ checkGroupHigherConstraints(const Group& group,
|
||||
this->wellState(),
|
||||
reportStepIdx,
|
||||
phasePos,
|
||||
/* isInjector */ true);
|
||||
/* isInjector */ true,
|
||||
this->summaryState_);
|
||||
// Sum over all processes
|
||||
rates[phasePos] = comm_.sum(local_current_rate) - reduction_rates[phasePos];
|
||||
}
|
||||
@@ -764,7 +767,8 @@ checkGroupHigherConstraints(const Group& group,
|
||||
this->wellState(),
|
||||
reportStepIdx,
|
||||
phasePos,
|
||||
/* isInjector */ false);
|
||||
/* isInjector */ false,
|
||||
this->summaryState_);
|
||||
// Sum over all processes
|
||||
rates[phasePos] = -comm_.sum(local_current_rate) - reduction_rates[phasePos];
|
||||
}
|
||||
@@ -1007,7 +1011,8 @@ updateWsolvent(const Group& group,
|
||||
wellState,
|
||||
reportStepIdx,
|
||||
gasPos,
|
||||
/*isInjector*/false);
|
||||
/*isInjector*/false,
|
||||
this->summaryState_);
|
||||
Scalar solventProductionRate = WellGroupHelpersType::sumSolventRates(groupRein,
|
||||
schedule_,
|
||||
wellState,
|
||||
@@ -1334,6 +1339,7 @@ updateAndCommunicateGroupData(const int reportStepIdx,
|
||||
group,
|
||||
schedule(),
|
||||
this->nupcolWellState(),
|
||||
this->summaryState_,
|
||||
reportStepIdx,
|
||||
phaseIdx,
|
||||
/*isInjector*/ false);
|
||||
@@ -1344,6 +1350,7 @@ updateAndCommunicateGroupData(const int reportStepIdx,
|
||||
group,
|
||||
schedule(),
|
||||
this->wellState(),
|
||||
this->summaryState_,
|
||||
reportStepIdx,
|
||||
phaseIdx,
|
||||
/*isInjector*/ false);
|
||||
@@ -1416,28 +1423,33 @@ updateAndCommunicateGroupData(const int reportStepIdx,
|
||||
schedule(),
|
||||
reportStepIdx,
|
||||
well_state_nupcol,
|
||||
this->groupState());
|
||||
this->groupState(),
|
||||
this->summaryState_);
|
||||
|
||||
WellGroupHelpersType::updateReservoirRatesInjectionGroups(fieldGroup,
|
||||
schedule(),
|
||||
reportStepIdx,
|
||||
well_state_nupcol,
|
||||
this->groupState());
|
||||
this->groupState(),
|
||||
this->summaryState_);
|
||||
WellGroupHelpersType::updateSurfaceRatesInjectionGroups(fieldGroup,
|
||||
schedule(),
|
||||
reportStepIdx,
|
||||
well_state_nupcol,
|
||||
this->groupState());
|
||||
this->groupState(),
|
||||
this->summaryState_);
|
||||
WellGroupHelpersType::updateNetworkLeafNodeProductionRates(schedule(),
|
||||
reportStepIdx,
|
||||
well_state_nupcol,
|
||||
this->groupState());
|
||||
this->groupState(),
|
||||
this->summaryState_);
|
||||
|
||||
WellGroupHelpersType::updateGroupProductionRates(fieldGroup,
|
||||
schedule(),
|
||||
reportStepIdx,
|
||||
well_state_nupcol,
|
||||
this->groupState());
|
||||
this->groupState(),
|
||||
this->summaryState_);
|
||||
|
||||
WellGroupHelpersType::updateWellRates(fieldGroup,
|
||||
schedule(),
|
||||
|
||||
@@ -84,7 +84,8 @@ GroupEconomicLimitsChecker(const BlackoilWellModelGeneric<Scalar, IndexTraits>&
|
||||
this->well_state_,
|
||||
this->report_step_idx_,
|
||||
phase_pos,
|
||||
/*isInjector*/false);
|
||||
/*isInjector*/false,
|
||||
well_model_.summaryState());
|
||||
this->production_rates_[i] = this->well_model_.comm().sum(production_rate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace Opm {
|
||||
const Opm::Group& group,
|
||||
const Opm::Schedule& schedule,
|
||||
const Opm::WellState<Scalar, IndexTraits>& wellState,
|
||||
const SummaryState& summaryState,
|
||||
const int reportStepIdx,
|
||||
const int phasePos,
|
||||
const bool injector,
|
||||
@@ -98,7 +99,7 @@ namespace Opm {
|
||||
for (const std::string& groupName : group.groups()) {
|
||||
const auto& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||
const auto& gefac = groupTmp.getGroupEfficiencyFactor(network);
|
||||
rate += gefac * sumWellPhaseRates(res_rates, groupTmp, schedule, wellState, reportStepIdx, phasePos, injector, network);
|
||||
rate += gefac * sumWellPhaseRates(res_rates, groupTmp, schedule, wellState, summaryState, reportStepIdx, phasePos, injector, network);
|
||||
}
|
||||
|
||||
// only sum satellite production once
|
||||
@@ -108,7 +109,7 @@ namespace Opm {
|
||||
if (wellState.isRank0() && !injector) {
|
||||
const auto rateComp = selectRateComponent(wellState.phaseUsageInfo(), phasePos);
|
||||
if (rateComp.has_value()) {
|
||||
rate += satelliteProduction(schedule[reportStepIdx], group.groups(), *rateComp);
|
||||
rate += satelliteProduction(summaryState, schedule[reportStepIdx], group.groups(), *rateComp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,9 +152,10 @@ namespace Opm {
|
||||
|
||||
template<typename Scalar, typename IndexTraits>
|
||||
Scalar WellGroupHelpers<Scalar, IndexTraits>::
|
||||
satelliteProduction(const ScheduleState& sched,
|
||||
satelliteProduction(const SummaryState& summaryState,
|
||||
const ScheduleState& sched,
|
||||
const std::vector<std::string>& groups,
|
||||
const GSatProd::GSatProdGroup::Rate rateComp)
|
||||
const GSatProd::GSatProdGroupProp::Rate rateComp)
|
||||
{
|
||||
auto gsatProdRate = Scalar{};
|
||||
const auto& gsatProd = sched.gsatprod();
|
||||
@@ -161,18 +163,18 @@ satelliteProduction(const ScheduleState& sched,
|
||||
if (! gsatProd.has(group)) {
|
||||
continue;
|
||||
}
|
||||
gsatProdRate += gsatProd.get(group).rate[rateComp];
|
||||
gsatProdRate += gsatProd.get(group, summaryState).rate[rateComp];
|
||||
}
|
||||
return gsatProdRate;
|
||||
}
|
||||
|
||||
template<typename Scalar, typename IndexTraits>
|
||||
std::optional<GSatProd::GSatProdGroup::Rate>
|
||||
std::optional<GSatProd::GSatProdGroupProp::Rate>
|
||||
WellGroupHelpers<Scalar, IndexTraits>::
|
||||
selectRateComponent(const PhaseUsageInfo<IndexTraits>& pu, const int phasePos)
|
||||
{
|
||||
// TODO: this function can be wrong, phasePos is not used anymore, this function requries checking and refactoring.
|
||||
using Rate = GSatProd::GSatProdGroup::Rate;
|
||||
using Rate = GSatProd::GSatProdGroupProp::Rate;
|
||||
|
||||
for (const auto& [phase, rateComp] : std::array {
|
||||
std::pair { IndexTraits::waterPhaseIdx, Rate::Water },
|
||||
@@ -271,9 +273,10 @@ sumWellSurfaceRates(const Group& group,
|
||||
const WellState<Scalar, IndexTraits>& wellState,
|
||||
const int reportStepIdx,
|
||||
const int phasePos,
|
||||
const bool injector)
|
||||
const bool injector,
|
||||
const SummaryState& summaryState)
|
||||
{
|
||||
return sumWellPhaseRates(false, group, schedule, wellState, reportStepIdx, phasePos, injector);
|
||||
return sumWellPhaseRates(false, group, schedule, wellState, summaryState, reportStepIdx, phasePos, injector);
|
||||
}
|
||||
|
||||
template<typename Scalar, typename IndexTraits>
|
||||
@@ -284,9 +287,10 @@ sumWellResRates(const Group& group,
|
||||
const WellState<Scalar, IndexTraits>& wellState,
|
||||
const int reportStepIdx,
|
||||
const int phasePos,
|
||||
const bool injector)
|
||||
const bool injector,
|
||||
const SummaryState& summaryState)
|
||||
{
|
||||
return sumWellPhaseRates(true, group, schedule, wellState, reportStepIdx, phasePos, injector);
|
||||
return sumWellPhaseRates(true, group, schedule, wellState, summaryState, reportStepIdx, phasePos, injector);
|
||||
}
|
||||
|
||||
template<typename Scalar, typename IndexTraits>
|
||||
@@ -404,7 +408,7 @@ updateGroupTargetReduction(const Group& group,
|
||||
= groupControlledWells(schedule, wellState, group_state, reportStepIdx, subGroupName, "", !isInjector, phase);
|
||||
if (individual_control || num_group_controlled_wells == 0) {
|
||||
groupTargetReduction[phase_pos]
|
||||
+= subGroupEfficiency * sumWellSurfaceRates(subGroup, schedule, wellState, reportStepIdx, phase_pos, isInjector);
|
||||
+= subGroupEfficiency * sumWellSurfaceRates(subGroup, schedule, wellState, reportStepIdx, phase_pos, isInjector, summaryState);
|
||||
} else {
|
||||
// Accumulate from this subgroup only if no group guide rate is set for it.
|
||||
if (!guide_rate.has(subGroupName, phase)) {
|
||||
@@ -421,7 +425,7 @@ updateGroupTargetReduction(const Group& group,
|
||||
if (individual_control || num_group_controlled_wells == 0) {
|
||||
for (int phase = 0; phase < np; phase++) {
|
||||
groupTargetReduction[phase]
|
||||
+= subGroupEfficiency * sumWellSurfaceRates(subGroup, schedule, wellState, reportStepIdx, phase, isInjector);
|
||||
+= subGroupEfficiency * sumWellSurfaceRates(subGroup, schedule, wellState, reportStepIdx, phase, isInjector, summaryState);
|
||||
}
|
||||
} else {
|
||||
// The subgroup may participate in group control.
|
||||
@@ -442,7 +446,7 @@ updateGroupTargetReduction(const Group& group,
|
||||
for (int phase = 0; phase < np; phase++) {
|
||||
const auto rateComp = selectRateComponent(wellState.phaseUsageInfo(), phase);
|
||||
if (rateComp.has_value()) {
|
||||
groupTargetReduction[phase] += satelliteProduction(schedule[reportStepIdx], group.groups(), *rateComp);
|
||||
groupTargetReduction[phase] += satelliteProduction(summaryState, schedule[reportStepIdx], group.groups(), *rateComp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -573,12 +577,13 @@ updateVREPForGroups(const Group& group,
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellState<Scalar, IndexTraits>& wellState,
|
||||
GroupState<Scalar>& group_state)
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState)
|
||||
{
|
||||
OPM_TIMEFUNCTION();
|
||||
for (const std::string& groupName : group.groups()) {
|
||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||
updateVREPForGroups(groupTmp, schedule, reportStepIdx, wellState, group_state);
|
||||
updateVREPForGroups(groupTmp, schedule, reportStepIdx, wellState, group_state, summaryState);
|
||||
}
|
||||
const int np = wellState.numPhases();
|
||||
Scalar resv = 0.0;
|
||||
@@ -587,6 +592,7 @@ updateVREPForGroups(const Group& group,
|
||||
group,
|
||||
schedule,
|
||||
wellState,
|
||||
summaryState,
|
||||
reportStepIdx,
|
||||
phase,
|
||||
/*isInjector*/ false);
|
||||
@@ -600,12 +606,13 @@ updateReservoirRatesInjectionGroups(const Group& group,
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellState<Scalar, IndexTraits>& wellState,
|
||||
GroupState<Scalar>& group_state)
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState)
|
||||
{
|
||||
OPM_TIMEFUNCTION();
|
||||
for (const std::string& groupName : group.groups()) {
|
||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||
updateReservoirRatesInjectionGroups(groupTmp, schedule, reportStepIdx, wellState, group_state);
|
||||
updateReservoirRatesInjectionGroups(groupTmp, schedule, reportStepIdx, wellState, group_state, summaryState);
|
||||
}
|
||||
const int np = wellState.numPhases();
|
||||
std::vector<Scalar> resv(np, 0.0);
|
||||
@@ -614,6 +621,7 @@ updateReservoirRatesInjectionGroups(const Group& group,
|
||||
group,
|
||||
schedule,
|
||||
wellState,
|
||||
summaryState,
|
||||
reportStepIdx,
|
||||
phase,
|
||||
/*isInjector*/ true);
|
||||
@@ -627,12 +635,13 @@ updateSurfaceRatesInjectionGroups(const Group& group,
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellState<Scalar, IndexTraits>& wellState,
|
||||
GroupState<Scalar>& group_state)
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState)
|
||||
{
|
||||
OPM_TIMEFUNCTION();
|
||||
for (const std::string& groupName : group.groups()) {
|
||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||
updateSurfaceRatesInjectionGroups(groupTmp, schedule, reportStepIdx, wellState, group_state);
|
||||
updateSurfaceRatesInjectionGroups(groupTmp, schedule, reportStepIdx, wellState, group_state, summaryState);
|
||||
}
|
||||
const int np = wellState.numPhases();
|
||||
std::vector<Scalar> rates(np, 0.0);
|
||||
@@ -641,6 +650,7 @@ updateSurfaceRatesInjectionGroups(const Group& group,
|
||||
group,
|
||||
schedule,
|
||||
wellState,
|
||||
summaryState,
|
||||
reportStepIdx,
|
||||
phase,
|
||||
/*isInjector*/ true);
|
||||
@@ -687,17 +697,18 @@ updateGroupProductionRates(const Group& group,
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellState<Scalar, IndexTraits>& wellState,
|
||||
GroupState<Scalar>& group_state)
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState)
|
||||
{
|
||||
OPM_TIMEFUNCTION();
|
||||
for (const std::string& groupName : group.groups()) {
|
||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||
updateGroupProductionRates(groupTmp, schedule, reportStepIdx, wellState, group_state);
|
||||
updateGroupProductionRates(groupTmp, schedule, reportStepIdx, wellState, group_state, summaryState);
|
||||
}
|
||||
const int np = wellState.numPhases();
|
||||
std::vector<Scalar> rates(np, 0.0);
|
||||
for (int phase = 0; phase < np; ++phase) {
|
||||
rates[phase] = sumWellPhaseRates(false, group, schedule, wellState, reportStepIdx, phase, /*isInjector*/ false);
|
||||
rates[phase] = sumWellPhaseRates(false, group, schedule, wellState, summaryState, reportStepIdx, phase, /*isInjector*/ false);
|
||||
}
|
||||
group_state.update_production_rates(group.name(), rates);
|
||||
}
|
||||
@@ -707,7 +718,8 @@ void WellGroupHelpers<Scalar, IndexTraits>::
|
||||
updateNetworkLeafNodeProductionRates(const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellState<Scalar, IndexTraits>& wellState,
|
||||
GroupState<Scalar>& group_state)
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState)
|
||||
{
|
||||
const auto& network = schedule[reportStepIdx].network();
|
||||
if (network.active()) {
|
||||
@@ -718,7 +730,7 @@ updateNetworkLeafNodeProductionRates(const Schedule& schedule,
|
||||
const auto& group = schedule[reportStepIdx].groups.get(group_name);
|
||||
if (group.numWells() > 0) {
|
||||
for (int phase = 0; phase < np; ++phase) {
|
||||
network_rates[phase] = sumWellPhaseRates(false, group, schedule, wellState, reportStepIdx, phase, /*isInjector*/ false, /*network*/ true);
|
||||
network_rates[phase] = sumWellPhaseRates(false, group, schedule, wellState, summaryState, reportStepIdx, phase, /*isInjector*/ false, /*network*/ true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -746,7 +758,7 @@ updateREINForGroups(const Group& group,
|
||||
|
||||
std::vector<Scalar> rein(np, 0.0);
|
||||
for (int phase = 0; phase < np; ++phase) {
|
||||
rein[phase] = sumWellPhaseRates(false, group, schedule, wellState, reportStepIdx, phase, /*isInjector*/ false);
|
||||
rein[phase] = sumWellPhaseRates(false, group, schedule, wellState, st, reportStepIdx, phase, /*isInjector*/ false);
|
||||
}
|
||||
|
||||
// add import rate and subtract consumption rate for group for gas
|
||||
@@ -1227,11 +1239,12 @@ updateGroupControlledWells(const Schedule& schedule,
|
||||
std::vector<Scalar> rates(num_phases, 0.0);
|
||||
for (int phase_pos = 0; phase_pos < num_phases; ++phase_pos) {
|
||||
rates[phase_pos] = WellGroupHelpers<Scalar, IndexTraits>::sumWellSurfaceRates(group,
|
||||
schedule,
|
||||
well_state,
|
||||
report_step,
|
||||
phase_pos,
|
||||
false);
|
||||
schedule,
|
||||
well_state,
|
||||
report_step,
|
||||
phase_pos,
|
||||
false,
|
||||
summary_state);
|
||||
}
|
||||
|
||||
// Get the ancestor of the auto choke group that has group control (cmode != FLD, NONE)
|
||||
|
||||
@@ -57,16 +57,18 @@ public:
|
||||
const Opm::Group& group,
|
||||
const Opm::Schedule& schedule,
|
||||
const WellStateType& wellState,
|
||||
const SummaryState& summaryState,
|
||||
const int reportStepIdx,
|
||||
const int phasePos,
|
||||
const bool injector,
|
||||
const bool network = false);
|
||||
|
||||
static Scalar satelliteProduction(const ScheduleState& sched,
|
||||
static Scalar satelliteProduction(const SummaryState& summaryState,
|
||||
const ScheduleState& sched,
|
||||
const std::vector<std::string>& groups,
|
||||
const GSatProd::GSatProdGroup::Rate rateComp);
|
||||
const GSatProd::GSatProdGroupProp::Rate rateComp);
|
||||
|
||||
static std::optional<GSatProd::GSatProdGroup::Rate>
|
||||
static std::optional<GSatProd::GSatProdGroupProp::Rate>
|
||||
selectRateComponent(const PhaseUsageInfo<IndexTraits>& pu, const int phasePos);
|
||||
|
||||
static void setCmodeGroup(const Group& group,
|
||||
@@ -85,7 +87,8 @@ public:
|
||||
const WellStateType& wellState,
|
||||
const int reportStepIdx,
|
||||
const int phasePos,
|
||||
const bool injector);
|
||||
const bool injector,
|
||||
const SummaryState& summaryState);
|
||||
|
||||
/// Returns the name of the worst offending well and its fraction (i.e. violated_phase / preferred_phase)
|
||||
static std::pair<std::optional<std::string>, Scalar>
|
||||
@@ -102,7 +105,8 @@ public:
|
||||
const WellStateType& wellState,
|
||||
const int reportStepIdx,
|
||||
const int phasePos,
|
||||
const bool injector);
|
||||
const bool injector,
|
||||
const SummaryState& summaryState);
|
||||
|
||||
static Scalar sumSolventRates(const Group& group,
|
||||
const Schedule& schedule,
|
||||
@@ -124,7 +128,8 @@ public:
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellStateType& wellState,
|
||||
GroupState<Scalar>& group_state);
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState);
|
||||
|
||||
template <class RegionalValues>
|
||||
static void updateGpMaintTargetForGroups(const Group& group,
|
||||
@@ -139,13 +144,15 @@ public:
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellStateType& wellState,
|
||||
GroupState<Scalar>& group_state);
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState);
|
||||
|
||||
static void updateSurfaceRatesInjectionGroups(const Group& group,
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellStateType& wellState,
|
||||
GroupState<Scalar>& group_state);
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState);
|
||||
|
||||
static void updateWellRates(const Group& group,
|
||||
const Schedule& schedule,
|
||||
@@ -157,12 +164,14 @@ public:
|
||||
const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellStateType& wellState,
|
||||
GroupState<Scalar>& group_state);
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState);
|
||||
|
||||
static void updateNetworkLeafNodeProductionRates(const Schedule& schedule,
|
||||
const int reportStepIdx,
|
||||
const WellStateType& wellState,
|
||||
GroupState<Scalar>& group_state);
|
||||
GroupState<Scalar>& group_state,
|
||||
const SummaryState& summaryState);
|
||||
|
||||
|
||||
static void updateWellRatesFromGroupTargetScale(const Scalar scale,
|
||||
|
||||
Reference in new issue
Block a user