mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
cleanup based on review
This commit is contained in:
parent
5c8a9eca5b
commit
7b4894b600
@ -98,21 +98,13 @@ namespace Opm {
|
|||||||
const auto& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
const auto& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||||
const auto& gefac = groupTmp.getGroupEfficiencyFactor();
|
const auto& gefac = groupTmp.getGroupEfficiencyFactor();
|
||||||
rate += gefac * sumWellPhaseRates(res_rates, groupTmp, schedule, wellState, reportStepIdx, phasePos, injector);
|
rate += gefac * sumWellPhaseRates(res_rates, groupTmp, schedule, wellState, reportStepIdx, phasePos, injector);
|
||||||
const auto& gsatprod = schedule[reportStepIdx].gsatprod.get();
|
}
|
||||||
// only sum once
|
|
||||||
if (wellState.isRank0() && !injector && gsatprod.has(groupName)) {
|
// only sum satelite production once
|
||||||
const auto& gsatprod_rates = gsatprod.get(groupName);
|
if (wellState.isRank0() && !injector) {
|
||||||
const auto& pu = wellState.phaseUsage();
|
const auto rateComp = selectRateComponent(wellState.phaseUsage(), phasePos);
|
||||||
using Rate = GSatProd::GSatProdGroup::Rate;
|
if (rateComp.has_value()) {
|
||||||
if (pu.phase_used[BlackoilPhases::Aqua] && pu.phase_pos[BlackoilPhases::Aqua] == phasePos) {
|
rate += satelliteProduction(schedule[reportStepIdx], group.groups(), *rateComp);
|
||||||
rate += gsatprod_rates.rate[Rate::Water];
|
|
||||||
}
|
|
||||||
if (pu.phase_used[BlackoilPhases::Liquid] && pu.phase_pos[BlackoilPhases::Liquid] == phasePos) {
|
|
||||||
rate += gsatprod_rates.rate[Rate::Oil];
|
|
||||||
}
|
|
||||||
if (pu.phase_used[BlackoilPhases::Vapour] && pu.phase_pos[BlackoilPhases::Vapour] == phasePos) {
|
|
||||||
rate += gsatprod_rates.rate[Rate::Gas];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +146,42 @@ namespace Opm {
|
|||||||
return rate;
|
return rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename Scalar>
|
||||||
|
Scalar WellGroupHelpers<Scalar>::
|
||||||
|
satelliteProduction(const ScheduleState& sched,
|
||||||
|
const std::vector<std::string>& groups,
|
||||||
|
const GSatProd::GSatProdGroup::Rate rateComp)
|
||||||
|
{
|
||||||
|
auto gsatProdRate = Scalar{};
|
||||||
|
const auto& gsatProd = sched.gsatprod();
|
||||||
|
for (const auto& group : groups) {
|
||||||
|
if (! gsatProd.has(group)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
gsatProdRate += gsatProd.get(group).rate[rateComp];
|
||||||
|
}
|
||||||
|
return gsatProdRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Scalar>
|
||||||
|
std::optional<GSatProd::GSatProdGroup::Rate> WellGroupHelpers<Scalar>::
|
||||||
|
selectRateComponent(const PhaseUsage& pu, const int phasePos)
|
||||||
|
{
|
||||||
|
using Rate = GSatProd::GSatProdGroup::Rate;
|
||||||
|
|
||||||
|
for (const auto& [phase, rateComp] : std::array {
|
||||||
|
std::pair { BlackoilPhases::Aqua, Rate::Water },
|
||||||
|
std::pair { BlackoilPhases::Liquid, Rate::Oil },
|
||||||
|
std::pair { BlackoilPhases::Vapour, Rate::Gas } })
|
||||||
|
{
|
||||||
|
if (pu.phase_used[phase] && (pu.phase_pos[phase] == phasePos)) {
|
||||||
|
return rateComp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
void WellGroupHelpers<Scalar>::
|
void WellGroupHelpers<Scalar>::
|
||||||
setCmodeGroup(const Group& group,
|
setCmodeGroup(const Group& group,
|
||||||
|
@ -22,8 +22,10 @@
|
|||||||
#define OPM_WELLGROUPHELPERS_HEADER_INCLUDED
|
#define OPM_WELLGROUPHELPERS_HEADER_INCLUDED
|
||||||
|
|
||||||
#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
|
#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
|
||||||
|
#include <opm/input/eclipse/Schedule/Group/GSatProd.hpp>
|
||||||
#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
|
#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
|
||||||
#include <opm/simulators/utils/ParallelCommunication.hpp>
|
#include <opm/simulators/utils/ParallelCommunication.hpp>
|
||||||
|
#include <opm/input/eclipse/Schedule/ScheduleState.hpp>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -56,6 +58,13 @@ public:
|
|||||||
const int phasePos,
|
const int phasePos,
|
||||||
const bool injector);
|
const bool injector);
|
||||||
|
|
||||||
|
static Scalar satelliteProduction(const ScheduleState& sched,
|
||||||
|
const std::vector<std::string>& groups,
|
||||||
|
const GSatProd::GSatProdGroup::Rate rateComp);
|
||||||
|
|
||||||
|
static std::optional<GSatProd::GSatProdGroup::Rate>
|
||||||
|
selectRateComponent(const PhaseUsage& pu, const int phasePos);
|
||||||
|
|
||||||
static void setCmodeGroup(const Group& group,
|
static void setCmodeGroup(const Group& group,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
|
Loading…
Reference in New Issue
Block a user