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
85 void wellSpecification(const std::vector<std::string>& changedWells,
86 const std::size_t reportStepNum) const;
87
88 void timeStamp(const std::string& lbl,
89 double elapsed,
90 int rstep,
91 boost::posix_time::ptime currentDate) const;
92
93private:
94 struct ConnData
95 {
96 ConnData(const Connection& conn);
97
98 int I, J, K;
99 std::vector<Scalar> data;
100 };
101
102 void beginCumulativeReport_() const;
103 void endCumulativeReport_() const;
104 void outputCumulativeReportRecord_(const std::vector<Scalar>& wellCum,
105 const std::vector<std::string>& wellCumNames,
106 const std::vector<ConnData>& connData) const;
107
108 void outputRegionFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> oip,
109 std::unordered_map<Inplace::Phase, Scalar> cip,
110 const Scalar pav,
111 const std::string& name,
112 const int reg) const;
113
114 void outputResvFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> cipr,
115 const int reg) const;
116
117 void beginInjectionReport_() const;
118 void endInjectionReport_() const;
119 void outputInjectionReportRecord_(const std::vector<Scalar>& wellInj,
120 const std::vector<std::string>& wellInjNames,
121 const std::vector<ConnData>& connData) const;
122
123 void beginMSWReport_() const;
124 void endMSWReport_() const;
125 void outputMSWReportRecord_(const Well& well) const;
126
127 void beginProductionReport_() const;
128 void endProductionReport_() const;
129 void outputProductionReportRecord_(const std::vector<Scalar>& wellProd,
130 const std::vector<std::string>& wellProdNames,
131 const std::vector<ConnData>& connData) const;
132
133 void fipUnitConvert_(std::unordered_map<Inplace::Phase, Scalar>& fip) const;
134 void pressureUnitConvert_(Scalar& pav) const;
135
136 struct WellCumDataType
137 {
138 enum WCId
139 {
140 WellLocationi = 0, // WLi
141 WellLocationj = 1, // WLj
142 OilProd = 2, // OP
143 WaterProd = 3, // WP
144 GasProd = 4, // GP
145 FluidResVolProd = 5, // FRVP
146 OilInj = 6, // OI
147 WaterInj = 7, // WI
148 GasInj = 8, // GI
149 FluidResVolInj = 9, // FRVI
150 WellName = 0, // WName
151 WellType = 1, // WType
152 WellCTRL = 2, // WCTRL
153 };
154 static constexpr int numWCValues = 10;
155 static constexpr int numWCNames = 3;
156 };
157
158 struct WellInjDataType
159 {
160 enum WIId
161 {
162 WellLocationi = 0, // WLi
163 WellLocationj = 1, // WLj
164 OilRate = 2, // OR
165 WaterRate = 3, // WR
166 GasRate = 4, // GR
167 FluidResVol = 5, // FRV
168 BHP = 6, // BHP
169 CPR = 6, // Connection pressure
170 THP = 7, // THP
171 BPR = 7, // Block pressures for connections
172 SteadyStateII = 8, // SteadyStateII
173 WellName = 0, // WName
174 CTRLModeOil = 1, // CTRLo
175 CTRLModeWat = 2, // CTRLw
176 CTRLModeGas = 3, // CTRLg
177 };
178 static constexpr int numWIValues = 9;
179 static constexpr int numWINames = 4;
180 };
181
182 struct WellProdDataType
183 {
184 enum WPId
185 {
186 WellLocationi = 0, // WLi
187 WellLocationj = 1, // WLj
188 OilRate = 2, // OR
189 WaterRate = 3, // WR
190 GasRate = 4, // GR
191 FluidResVol = 5, // FRV
192 WaterCut = 6, // WC
193 GasOilRatio = 7, // GOR
194 WatGasRatio = 8, // WGR
195 BHP = 9, // BHP
196 CPR = 9, // Connection pressure
197 THP = 10, // THP
198 BPR = 10, // Block pressures for connections
199 SteadyStatePI = 11, // SteadyStatePI
200 WellName = 0, // WName
201 CTRLMode = 1, // CTRL
202 };
203
204 static constexpr int numWPValues = 12;
205 static constexpr int numWPNames = 2;
206 };
207
208 const EclipseState& eclState_;
209 const Schedule& schedule_;
210 const SummaryState& summaryState_;
211 std::string flowVersionName_;
212};
213
214} // namespace Opm
215
216#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:272
void fip(const Inplace &inplace, const Inplace &initialInplace, const std::string &name) const
Write fluid-in-place reports to output.
Definition LogOutputHelper.cpp:299
void msw(const std::size_t reportStepNum) const
Write msw report to output.
Definition LogOutputHelper.cpp:513
void cumulative(const std::size_t reportStepNum, const bool withConns) const
Write cumulative production and injection reports to output.
Definition LogOutputHelper.cpp:176
void fipResv(const Inplace &inplace, const std::string &name) const
Write fluid-in-place reservoir reports to output.
Definition LogOutputHelper.cpp:346
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:412
void wellSpecification(const std::vector< std::string > &changedWells, const std::size_t reportStepNum) const
Write well specification report to output.
Definition LogOutputHelper.cpp:647
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:534
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