My Project
Loading...
Searching...
No Matches
LogOutputHelper.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5 OPM is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 OPM is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with OPM. If not, see <http://www.gnu.org/licenses/>.
15 Consult the COPYING file in the top-level source directory of this
16 module for the precise wording of the license and the list of
17 copyright holders.
18*/
22#ifndef LOG_OUTPUT_HELPER_HPP
23#define LOG_OUTPUT_HELPER_HPP
24
25#include <opm/output/eclipse/Inplace.hpp>
26
27#include <cstddef>
28#include <functional>
29#include <string>
30#include <unordered_map>
31#include <vector>
32
33namespace Opm {
34
35class EclipseState;
36class Inplace;
37class Schedule;
38class SummaryState;
39
40template<class Scalar>
42public:
43 LogOutputHelper(const EclipseState& eclState,
44 const Schedule& schedule,
45 const SummaryState& st);
46
48 void cumulative(const std::size_t reportStepNum,
49 std::function<bool(const std::string&)> isDefunct) const;
50
52 void error(const std::vector<int>& failedCellsPbub,
53 const std::vector<int>& failedCellsPdew) const;
54
56 void fip(const Inplace& inplace,
57 const Inplace& initialInplace) const;
58
60 void fipResv(const Inplace& inplace) const;
61
63 void injection(const std::size_t reportStepNum,
64 std::function<bool(const std::string&)> isDefunct) const;
65
67 void production(const std::size_t reportStepNum,
68 std::function<bool(const std::string&)> isDefunct) const;
69
70private:
71 void outputCumulativeReport_(const std::vector<Scalar>& wellCum,
72 const std::vector<std::string>& wellCumNames) const;
73
74 void outputRegionFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> oip,
75 std::unordered_map<Inplace::Phase, Scalar> cip,
76 const Scalar pav,
77 const int reg) const;
78
79 void outputResvFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> cipr,
80 const int reg) const;
81
82 void outputInjectionReport_(const std::vector<Scalar>& wellInj,
83 const std::vector<std::string>& wellInjNames) const;
84
85 void outputProductionReport_(const std::vector<Scalar>& wellProd,
86 const std::vector<std::string>& wellProdNames) const;
87
88 void fipUnitConvert_(std::unordered_map<Inplace::Phase, Scalar>& fip) const;
89 void pressureUnitConvert_(Scalar& pav) const;
90
91 struct WellCumDataType
92 {
93 enum WCId
94 {
95 WellLocationi = 0, // WLi
96 WellLocationj = 1, // WLj
97 OilProd = 2, // OP
98 WaterProd = 3, // WP
99 GasProd = 4, // GP
100 FluidResVolProd = 5, // FRVP
101 OilInj = 6, // OI
102 WaterInj = 7, // WI
103 GasInj = 8, // GI
104 FluidResVolInj = 9, // FRVI
105 WellName = 0, // WName
106 WellType = 1, // WType
107 WellCTRL = 2, // WCTRL
108 };
109 static constexpr int numWCValues = 10;
110 static constexpr int numWCNames = 3;
111 };
112
113 struct WellInjDataType
114 {
115 enum WIId
116 {
117 WellLocationi = 0, // WLi
118 WellLocationj = 1, // WLj
119 OilRate = 2, // OR
120 WaterRate = 3, // WR
121 GasRate = 4, // GR
122 FluidResVol = 5, // FRV
123 BHP = 6, // BHP
124 THP = 7, // THP
125 SteadyStateII = 8, // SteadyStateII
126 WellName = 0, // WName
127 CTRLModeOil = 1, // CTRLo
128 CTRLModeWat = 2, // CTRLw
129 CTRLModeGas = 3, // CTRLg
130 };
131 static constexpr int numWIValues = 9;
132 static constexpr int numWINames = 4;
133 };
134
135 struct WellProdDataType
136 {
137 enum WPId
138 {
139 WellLocationi = 0, // WLi
140 WellLocationj = 1, // WLj
141 OilRate = 2, // OR
142 WaterRate = 3, // WR
143 GasRate = 4, // GR
144 FluidResVol = 5, // FRV
145 WaterCut = 6, // WC
146 GasOilRatio = 7, // GOR
147 WatGasRatio = 8, // WGR
148 BHP = 9, // BHP
149 THP = 10, // THP
150 SteadyStatePI = 11, // SteadyStatePI
151 WellName = 0, // WName
152 CTRLMode = 1, // CTRL
153 };
154
155 static constexpr int numWPValues = 12;
156 static constexpr int numWPNames = 2;
157 };
158
159 const EclipseState& eclState_;
160 const Schedule& schedule_;
161 const SummaryState& summaryState_;
162};
163
164} // namespace Opm
165
166#endif // LOG_OUTPUT_HELPER_HPP
Definition AquiferInterface.hpp:35
Definition LogOutputHelper.hpp:41
void injection(const std::size_t reportStepNum, std::function< bool(const std::string &)> isDefunct) const
Write injection report to output.
Definition LogOutputHelper.cpp:350
void error(const std::vector< int > &failedCellsPbub, const std::vector< int > &failedCellsPdew) const
Write error report to output.
Definition LogOutputHelper.cpp:234
void cumulative(const std::size_t reportStepNum, std::function< bool(const std::string &)> isDefunct) const
Write cumulative production and injection reports to output.
Definition LogOutputHelper.cpp:94
void production(const std::size_t reportStepNum, std::function< bool(const std::string &)> isDefunct) const
Write production report to output.
Definition LogOutputHelper.cpp:473
void fipResv(const Inplace &inplace) const
Write fluid-in-place reservoir reports to output.
Definition LogOutputHelper.cpp:322
void fip(const Inplace &inplace, const Inplace &initialInplace) const
Write fluid-in-place reports to output.
Definition LogOutputHelper.cpp:261
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27