OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
OCPOutput.hpp
Go to the documentation of this file.
1 
12 #ifndef __OCP_OUTPUT_HEADER__
13 #define __OCP_OUTPUT_HEADER__
14 
15 // Standard header files
16 #include <iomanip>
17 #include <iostream>
18 
19 // OpenCAEPoro header files
20 #include "OCPControl.hpp"
21 #include "ParamOutput.hpp"
22 #include "Reservoir.hpp"
23 #include "UtilOutput.hpp"
24 
25 using namespace std;
26 
28 class OCPIJK
29 {
30 public:
31  OCPIJK() = default;
32  OCPIJK(const USI& i, const USI& j, const USI& k)
33  : I(i)
34  , J(j)
35  , K(k) {};
36  OCPIJK(const COOIJK& src)
37  {
38  I = src.I;
39  J = src.J;
40  K = src.K;
41  };
42  OCPIJK& operator=(const COOIJK& src)
43  {
44  I = src.I;
45  J = src.J;
46  K = src.K;
47  return *this;
48  }
49  USI I, J, K;
50 };
51 
53 template <typename T> class OCPType_Sum
54 {
55 public:
56  OCPType_Sum& operator=(const Type_A_o& src)
57  {
58  activity = src.activity;
59  obj = src.obj;
60  return *this;
61  }
62  OCPType_Sum& operator=(const Type_B_o& src)
63  {
64  activity = src.activity;
65  obj.assign(src.obj.begin(), src.obj.end());
66  return *this;
67  }
68  bool activity{false};
69  vector<T> obj;
70  vector<USI>
72 };
73 
75 class SumPair
76 {
77 public:
78  SumPair(const string& item, const string& obj, const string& unit)
79  : Item(item)
80  , Obj(obj)
81  , Unit(unit){};
82  string Item;
83  string Obj;
84  string Unit;
85  vector<OCP_DBL> val;
86 };
87 
89 // Note: It contains the most interested information in each time step, which usually
90 // will be convert to figures for later analysis.
91 class Summary
92 {
93 public:
95  void InputParam(const OutputSummary& summary_param);
96 
98  void Setup(const Reservoir& reservoir, const OCP_DBL& totalTime);
99 
101  void SetVal(const Reservoir& reservoir, const OCPControl& ctrl);
102 
104  void PrintInfo(const string& dir) const;
105 
106 private:
107  vector<SumPair> Sumdata;
108 
109  bool FPR{false};
110  bool FOPR{false};
111  bool FOPT{false};
112  bool FGPR{false};
113  bool FGPt{false};
114  bool FWPR{false};
115  bool FWPT{false};
116  bool FGIR{false};
117  bool FGIT{false};
118  bool FWIR{false};
119  bool FWIT{false};
120 
121  OCPType_Sum<string> WOPR;
122  OCPType_Sum<string> WOPT;
123  OCPType_Sum<string> WGPR;
124  OCPType_Sum<string> WGPT;
125  OCPType_Sum<string> WWPR;
126  OCPType_Sum<string> WWPT;
127  OCPType_Sum<string> WGIR;
128  OCPType_Sum<string> WGIT;
129  OCPType_Sum<string> WWIR;
130  OCPType_Sum<string> WWIT;
131  OCPType_Sum<string> WBHP;
133 
134  OCPType_Sum<OCPIJK> BPR;
135  OCPType_Sum<OCPIJK> SOIL;
136  OCPType_Sum<OCPIJK> SGAS;
137  OCPType_Sum<OCPIJK> SWAT;
138 };
139 
142 {
143 public:
145  void Setup(const OCP_DBL& totalTime);
146 
148  void SetVal(const Reservoir& reservoir, const OCPControl& ctrl);
149 
151  void PrintInfo(const string& dir) const;
152 
153 private:
154  vector<OCP_DBL> time;
155  vector<OCP_DBL> dt;
156  vector<OCP_DBL> dPmax;
157  vector<OCP_DBL> dVmax;
158  vector<OCP_DBL> dSmax;
159  vector<OCP_DBL> dNmax;
160  vector<OCP_DBL> cfl;
161 };
162 
165 {
166 public:
167  void InputParam(const OutputDetail& detail_param);
168  void Setup(const string& dir);
169  void PrintInfo(const string& dir, const Reservoir& rs, const OCP_DBL& days) const;
170 
171 private:
172  bool PRE{false};
173  bool PGAS{false};
174  bool PWAT{false};
175  bool SOIL{false};
176  bool SGAS{false};
177  bool SWAT{false};
178  bool DENO{false};
179  bool DENG{false};
180  bool DENW{false};
181  bool KRO{false};
182  bool KRG{false};
183  bool KRW{false};
184  bool BOIL{false};
185  bool BGAS{false};
186  bool BWAT{false};
187  bool VOIL{false};
188  bool VGAS{false};
189  bool VWAT{false};
190  bool XMF{false};
191  bool YMF{false};
192  bool PCW{false};
193 };
194 
196 // Note: The most commonly used is the summary file, which usually gives the
197 // information of bulks and wells in each time step, such as average pressure, oil
198 // production rate of wells. If other information at critical dates is of interest, you
199 // can chose the PRT file (TODO). Also, some infomation will be printed on the screen
200 // at the critical dates to make sure the program is at the right way.
202 {
203  friend class OpenCAEPoro;
204 
205 public:
206  void InputParam(const ParamOutput& paramOutput);
207  void Setup(const Reservoir& reservoir, const OCPControl& ctrl);
208  void SetVal(const Reservoir& reservoir, const OCPControl& ctrl);
209  void PrintInfo() const;
210  void PrintInfoSched(const Reservoir& rs, const OCPControl& ctrl,
211  const OCP_DBL& time) const;
212 
213 private:
214  string wordDir;
215  Summary summary;
216  CriticalInfo crtInfo;
217  DetailInfo dtlInfo;
218 };
219 
220 #endif /* end if __OCPOUTPUT_HEADER__ */
221 
222 /*----------------------------------------------------------------------------*/
223 /* Brief Change History of This File */
224 /*----------------------------------------------------------------------------*/
225 /* Author Date Actions */
226 /*----------------------------------------------------------------------------*/
227 /* Shizhe Li Oct/01/2021 Create file */
228 /* Chensong Zhang Oct/15/2021 Format file */
229 /* Chensong Zhang Jan/08/2022 Update Doxygen */
230 /*----------------------------------------------------------------------------*/
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:26
OCPControl class declaration.
ParamOutput class declaration.
Reservoir class declaration.
Supply basic tools used to output files.
A structure of three-dimensional coordinates.
Definition: ParamOutput.hpp:24
Collect important information of each time step for fast review.
Definition: OCPOutput.hpp:142
Collect more detailed information of each time step.
Definition: OCPOutput.hpp:165
All control parameters except for well controlers.
Definition: OCPControl.hpp:94
3D coordinate representation in OpenCAEPoro
Definition: OCPOutput.hpp:29
The OCPOutput class manages different kinds of ways to output information.
Definition: OCPOutput.hpp:202
TODO: Add Doxygen.
Definition: OCPOutput.hpp:54
vector< USI > index
Records the index of bulk or well, whose properties will be printed.
Definition: OCPOutput.hpp:71
Top-level data structure for the OpenCAEPoro simulator.
Definition: OCP.hpp:27
void InputParam(ParamRead &param)
Read input parameters to an internal structure.
Definition: OCP.cpp:15
The SumPair class is an auxiliary structure storing summary data to output.
Definition: OCPOutput.hpp:76
The Summary class manages the output in the summary file.
Definition: OCPOutput.hpp:92
Used to stores the contents of keyword whose contents are in form of string.
Definition: ParamOutput.hpp:46
Used to stores the contents of keyword whose contents are in form of coordinates.
Definition: ParamOutput.hpp:38