My Project
GasLiftCommon.hpp
1/*
2 Copyright 2022 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_GASLIFT_COMMON_HEADER_INCLUDED
21#define OPM_GASLIFT_COMMON_HEADER_INCLUDED
22
23#include <opm/simulators/utils/DeferredLogger.hpp>
24#include <opm/simulators/wells/WellState.hpp>
25#include <opm/simulators/wells/GroupState.hpp>
26
27#include <string>
28
29namespace Opm
30{
32{
33public:
34 virtual ~GasLiftCommon() = default;
35
36protected:
38 WellState &well_state,
39 const GroupState &group_state,
40 DeferredLogger &deferred_logger,
41 const Parallel::Communication& comm,
42 bool debug
43 );
44 enum class MessageType { INFO, WARNING };
45
46 int debugUpdateGlobalCounter_() const;
47 virtual void displayDebugMessage_(const std::string& msg) const = 0;
48 void displayDebugMessageOnRank0_(const std::string &msg) const;
49 void logMessage_(
50 const std::string& prefix,
51 const std::string& msg,
52 MessageType msg_type = MessageType::INFO) const;
53
54 WellState &well_state_;
55 const GroupState& group_state_;
56 DeferredLogger &deferred_logger_;
57 const Parallel::Communication& comm_;
58 bool debug;
59 // By setting this variable to true we restrict some debug output
60 // to only be printed for rank 0. By setting this variable to false we keep
61 // the output on all ranks. This can in some cases be helpful as a debugging
62 // aid to check that the output is in fact identical over all ranks
63 bool debug_output_only_on_rank0 = false;
64};
65
66} // namespace Opm
67
68#endif // OPM_GASLIFT_COMMON_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: GasLiftCommon.hpp:32
Definition: GroupState.hpp:34
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: WellState.hpp:60
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27