GroupControlRetention.hpp
Go to the documentation of this file.
1/*
2 Copyright 2026 Equinor ASA
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_GROUP_CONTROL_RETENTION_HPP
21#define OPM_GROUP_CONTROL_RETENTION_HPP
22
23#include <opm/input/eclipse/Schedule/ResCoup/GrupSlav.hpp>
24
25#include <optional>
26
27namespace Opm::GroupStateHelpers {
28
44inline bool keepsProductionControl(const bool field_or_none,
45 const bool targeted,
46 const bool gas_lift_group,
47 const bool rc_master_hierarchy,
48 const std::optional<ReservoirCoupling::GrupSlav::FilterFlag>
49 master_target_filter)
50{
51 using FilterFlag = ReservoirCoupling::GrupSlav::FilterFlag;
52 const bool master_sets_control_mode =
53 master_target_filter.has_value() && *master_target_filter != FilterFlag::SLAV;
54 return targeted
55 || field_or_none
56 || gas_lift_group
57 || rc_master_hierarchy
58 || master_sets_control_mode;
59}
60
61} // namespace Opm::GroupStateHelpers
62
63#endif // OPM_GROUP_CONTROL_RETENTION_HPP
Definition: FractionCalculator.hpp:36
bool keepsProductionControl(const bool field_or_none, const bool targeted, const bool gas_lift_group, const bool rc_master_hierarchy, const std::optional< ReservoirCoupling::GrupSlav::FilterFlag > master_target_filter)
Definition: GroupControlRetention.hpp:44