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 <map>
29#include <string>
30#include <unordered_map>
31#include <vector>
32#include <boost/date_time.hpp>
33
34
35namespace Opm {
36
37class Connection;
38class EclipseState;
39class Inplace;
40class Schedule;
41class SummaryState;
42class Well;
43
44template<class Scalar>
46public:
47 LogOutputHelper(const EclipseState& eclState,
48 const Schedule& schedule,
49 const SummaryState& st,
50 const std::string& moduleVersionName);
51
53 void cumulative(const std::size_t reportStepNum,
54 const bool withConns) const;
55
57 void error(const std::vector<int>& failedCellsPbub,
58 const std::vector<int>& failedCellsPdew) const;
59
61 void fip(const Inplace& inplace,
62 const Inplace& initialInplace,
63 const std::string& name) const;
64
66 void fipResv(const Inplace& inplace, const std::string& name) const;
67
69 void injection(const std::size_t reportStepNum,
70 const std::map<std::pair<std::string,int>, double>& block_pressures) const;
71
73 void msw(const std::size_t reportStepNum) const;
74
76 void production(const std::size_t reportStepNum,
77 const std::map<std::pair<std::string,int>, double>& block_pressures) const;
78
79 void timeStamp(const std::string& lbl,
80 double elapsed,
81 int rstep,
82 boost::posix_time::ptime currentDate) const;
83
84private:
85 struct ConnData
86 {
87 ConnData(const Connection& conn);
88
89 int I, J, K;
90 std::vector<Scalar> data;
91 };
92
93 void beginCumulativeReport_() const;
94 void endCumulativeReport_() const;
95 void outputCumulativeReportRecord_(const std::vector<Scalar>& wellCum,
96 const std::vector<std::string>& wellCumNames,
97 const std::vector<ConnData>& connData) const;
98
99 void outputRegionFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> oip,
100 std::unordered_map<Inplace::Phase, Scalar> cip,
101 const Scalar pav,
102 const std::string& name,
103 const int reg) const;
104
105 void outputResvFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> cipr,
106 const int reg) const;
107
108 void beginInjectionReport_() const;
109 void endInjectionReport_() const;
110 void outputInjectionReportRecord_(const std::vector<Scalar>& wellInj,
111 const std::vector<std::string>& wellInjNames,
112 const std::vector<ConnData>& connData) const;
113
114 void beginMSWReport_() const;
115 void endMSWReport_() const;
116 void outputMSWReportRecord_(const Well& well) const;
117
118 void beginProductionReport_() const;
119 void endProductionReport_() const;
120 void outputProductionReportRecord_(const std::vector<Scalar>& wellProd,
121 const std::vector<std::string>& wellProdNames,
122 const std::vector<ConnData>& connData) const;
123
124 void fipUnitConvert_(std::unordered_map<Inplace::Phase, Scalar>& fip) const;
125 void pressureUnitConvert_(Scalar& pav) const;
126
127 struct WellCumDataType
128 {
129 enum WCId
130 {
131 WellLocationi = 0, // WLi
132 WellLocationj = 1, // WLj
133 OilProd = 2, // OP
134 WaterProd = 3, // WP
135 GasProd = 4, // GP
136 FluidResVolProd = 5, // FRVP
137 OilInj = 6, // OI
138 WaterInj = 7, // WI
139 GasInj = 8, // GI
140 FluidResVolInj = 9, // FRVI
141 WellName = 0, // WName
142 WellType = 1, // WType
143 WellCTRL = 2, // WCTRL
144 };
145 static constexpr int numWCValues = 10;
146 static constexpr int numWCNames = 3;
147 };
148
149 struct WellInjDataType
150 {
151 enum WIId
152 {
153 WellLocationi = 0, // WLi
154 WellLocationj = 1, // WLj
155 OilRate = 2, // OR
156 WaterRate = 3, // WR
157 GasRate = 4, // GR
158 FluidResVol = 5, // FRV
159 BHP = 6, // BHP
160 CPR = 6, // Connection pressure
161 THP = 7, // THP
162 BPR = 7, // Block pressures for connections
163 SteadyStateII = 8, // SteadyStateII
164 WellName = 0, // WName
165 CTRLModeOil = 1, // CTRLo
166 CTRLModeWat = 2, // CTRLw
167 CTRLModeGas = 3, // CTRLg
168 };
169 static constexpr int numWIValues = 9;
170 static constexpr int numWINames = 4;
171 };
172
173 struct WellProdDataType
174 {
175 enum WPId
176 {
177 WellLocationi = 0, // WLi
178 WellLocationj = 1, // WLj
179 OilRate = 2, // OR
180 WaterRate = 3, // WR
181 GasRate = 4, // GR
182 FluidResVol = 5, // FRV
183 WaterCut = 6, // WC
184 GasOilRatio = 7, // GOR
185 WatGasRatio = 8, // WGR
186 BHP = 9, // BHP
187 CPR = 9, // Connection pressure
188 THP = 10, // THP
189 BPR = 10, // Block pressures for connections
190 SteadyStatePI = 11, // SteadyStatePI
191 WellName = 0, // WName
192 CTRLMode = 1, // CTRL
193 };
194
195 static constexpr int numWPValues = 12;
196 static constexpr int numWPNames = 2;
197 };
198
199 const EclipseState& eclState_;
200 const Schedule& schedule_;
201 const SummaryState& summaryState_;
202 std::string flowVersionName_;
203};
204
205} // namespace Opm
206
207#endif // LOG_OUTPUT_HELPER_HPP
Definition LogOutputHelper.hpp:45
void error(const std::vector< int > &failedCellsPbub, const std::vector< int > &failedCellsPdew) const
Write error report to output.
Definition LogOutputHelper.cpp:267
void fip(const Inplace &inplace, const Inplace &initialInplace, const std::string &name) const
Write fluid-in-place reports to output.
Definition LogOutputHelper.cpp:294
void msw(const std::size_t reportStepNum) const
Write msw report to output.
Definition LogOutputHelper.cpp:508
void cumulative(const std::size_t reportStepNum, const bool withConns) const
Write cumulative production and injection reports to output.
Definition LogOutputHelper.cpp:171
void fipResv(const Inplace &inplace, const std::string &name) const
Write fluid-in-place reservoir reports to output.
Definition LogOutputHelper.cpp:341
void injection(const std::size_t reportStepNum, const std::map< std::pair< std::string, int >, double > &block_pressures) const
Write injection report to output.
Definition LogOutputHelper.cpp:407
void production(const std::size_t reportStepNum, const std::map< std::pair< std::string, int >, double > &block_pressures) const
Write production report to output.
Definition LogOutputHelper.cpp:529
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
std::string moduleVersionName()
Return the version name of the module, for example "2015.10" (for a release branch) or "2016....
Definition moduleVersion.cpp:34
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242