OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
ParamOutput.cpp
Go to the documentation of this file.
1 
12 #include "ParamOutput.hpp"
13 
14 void ParamOutput::InputSUMMARY(ifstream& ifs)
15 {
16  vector<string> vbuf;
17  while (ReadLine(ifs, vbuf)) {
18  if (vbuf[0] == "/") break;
19  string keyword = vbuf[0];
20 
21  switch (Map_Str2Int(&keyword[0], keyword.size())) {
22  case Map_Str2Int("FPR", 3):
23  summary.FPR = true;
24  break;
25 
26  // Field
27  case Map_Str2Int("FOPR", 4):
28  summary.FOPR = true;
29  break;
30 
31  case Map_Str2Int("FOPT", 4):
32  summary.FOPT = true;
33  break;
34 
35  case Map_Str2Int("FGPR", 4):
36  summary.FGPR = true;
37  break;
38 
39  case Map_Str2Int("FGPT", 4):
40  summary.FGPt = true;
41  break;
42 
43  case Map_Str2Int("FWPR", 4):
44  summary.FWPR = true;
45  break;
46 
47  case Map_Str2Int("FWPT", 4):
48  summary.FWPT = true;
49  break;
50 
51  case Map_Str2Int("FGIR", 4):
52  summary.FGIR = true;
53  break;
54 
55  case Map_Str2Int("FGIT", 4):
56  summary.FGIT = true;
57  break;
58 
59  case Map_Str2Int("FWIR", 4):
60  summary.FWIR = true;
61  break;
62 
63  case Map_Str2Int("FWIT", 4):
64  summary.FWIT = true;
65  break;
66 
67  // Well
68  case Map_Str2Int("WOPR", 4):
69  InputType_A(ifs, summary.WOPR);
70  break;
71 
72  case Map_Str2Int("WOPT", 4):
73  InputType_A(ifs, summary.WOPT);
74  break;
75 
76  case Map_Str2Int("WGPR", 4):
77  InputType_A(ifs, summary.WGPR);
78  break;
79 
80  case Map_Str2Int("WGPT", 4):
81  InputType_A(ifs, summary.WGPT);
82  break;
83 
84  case Map_Str2Int("WWPR", 4):
85  InputType_A(ifs, summary.WWPR);
86  break;
87 
88  case Map_Str2Int("WWPT", 4):
89  InputType_A(ifs, summary.WWPT);
90  break;
91 
92  case Map_Str2Int("WGIR", 4):
93  InputType_A(ifs, summary.WGIR);
94  break;
95 
96  case Map_Str2Int("WGIT", 4):
97  InputType_A(ifs, summary.WGIT);
98  break;
99 
100  case Map_Str2Int("WWIR", 4):
101  InputType_A(ifs, summary.WWIR);
102  break;
103 
104  case Map_Str2Int("WWIT", 4):
105  InputType_A(ifs, summary.WWIT);
106  break;
107 
108  case Map_Str2Int("WBHP", 4):
109  InputType_A(ifs, summary.WBHP);
110  break;
111 
112  case Map_Str2Int("DG", 2):
113  InputType_A(ifs, summary.DG);
114  break;
115 
116  case Map_Str2Int("BPR", 3):
117  InputType_B(ifs, summary.BPR);
118  break;
119 
120  case Map_Str2Int("SOIL", 4):
121  InputType_B(ifs, summary.SOIL);
122  break;
123 
124  case Map_Str2Int("SGAS", 4):
125  InputType_B(ifs, summary.SGAS);
126  break;
127 
128  case Map_Str2Int("SWAT", 4):
129  InputType_B(ifs, summary.SWAT);
130  break;
131  default:
132  break;
133  }
134  }
135  cout << "SUMMARY" << endl;
136 }
137 
138 void ParamOutput::InputType_A(ifstream& ifs, Type_A_o& obj)
139 {
140  obj.activity = true;
141  vector<string> vbuf;
142  ReadLine(ifs, vbuf);
143  if (vbuf[0] == "/") {
144  obj.obj.push_back("All");
145  } else {
146  OCP_INT len = vbuf.size();
147  for (OCP_INT i = 0; i < len - 1; i++) {
148  obj.obj.push_back(vbuf[i]);
149  }
150  if (vbuf.back() != "/") obj.obj.push_back(vbuf.back());
151 
152  while (ReadLine(ifs, vbuf)) {
153  if (vbuf[0] == "/") break;
154 
155  OCP_INT len = vbuf.size();
156  for (OCP_INT i = 0; i < len - 1; i++) {
157  obj.obj.push_back(vbuf[i]);
158  }
159  if (vbuf.back() != "/") obj.obj.push_back(vbuf.back());
160  }
161  }
162  cout << "Type_A" << endl;
163 }
164 
165 void ParamOutput::InputType_B(ifstream& ifs, Type_B_o& obj)
166 {
167 
168  vector<string> vbuf;
169  while (ReadLine(ifs, vbuf)) {
170  if (vbuf[0] == "/") break;
171 
172  obj.activity = true;
173  DealDefault(vbuf);
174  USI i = stoi(vbuf[0]);
175  USI j = stoi(vbuf[1]);
176  USI k = stoi(vbuf[2]);
177 
178  obj.obj.push_back(COOIJK(i, j, k));
179  }
180  cout << "Type_B" << endl;
181 }
182 
183 void ParamOutput::InputRPTSCHED(ifstream& ifs)
184 {
185  vector<string> vbuf;
186  while (ReadLine(ifs, vbuf)) {
187  if (vbuf[0] == "/") break;
188 
189  USI len = vbuf.size();
190 
191  for (USI i = 0; i < len; i++) {
192 
193  string keyword = vbuf[i];
194 
195  switch (Map_Str2Int(&keyword[0], keyword.size())) {
196  case Map_Str2Int("PRES", 4):
197  case Map_Str2Int("PRESSURE", 8):
198  detailInfo.PRE = true;
199  break;
200  case Map_Str2Int("PGAS", 4):
201  detailInfo.PGAS = true;
202  break;
203  case Map_Str2Int("PWAT", 4):
204  detailInfo.PWAT = true;
205  break;
206  case Map_Str2Int("SOIL", 4):
207  detailInfo.SOIL = true;
208  break;
209  case Map_Str2Int("SGAS", 4):
210  detailInfo.SGAS = true;
211  break;
212  case Map_Str2Int("SWAT", 4):
213  detailInfo.SWAT = true;
214  break;
215  case Map_Str2Int("DENO", 4):
216  detailInfo.DENO = true;
217  break;
218  case Map_Str2Int("DENG", 4):
219  detailInfo.DENG = true;
220  break;
221  case Map_Str2Int("DENW", 4):
222  detailInfo.DENW = true;
223  break;
224  case Map_Str2Int("KRO", 3):
225  detailInfo.KRO = true;
226  break;
227  case Map_Str2Int("KRG", 3):
228  detailInfo.KRG = true;
229  break;
230  case Map_Str2Int("KRW", 3):
231  detailInfo.KRW = true;
232  break;
233  case Map_Str2Int("BOIL", 4):
234  detailInfo.BOIL = true;
235  break;
236  case Map_Str2Int("BGAS", 4):
237  detailInfo.BGAS = true;
238  break;
239  case Map_Str2Int("BWAT", 4):
240  detailInfo.BWAT = true;
241  break;
242  case Map_Str2Int("VOIL", 4):
243  detailInfo.VOIL = true;
244  break;
245  case Map_Str2Int("VGAS", 4):
246  detailInfo.VGAS = true;
247  break;
248  case Map_Str2Int("VWAT", 4):
249  detailInfo.VWAT = true;
250  break;
251  case Map_Str2Int("XMF", 3):
252  detailInfo.XMF = true;
253  break;
254  case Map_Str2Int("YMF", 3):
255  detailInfo.YMF = true;
256  break;
257  case Map_Str2Int("PCW", 3):
258  detailInfo.PCW = true;
259  break;
260  default:
261  break;
262  }
263  }
264  }
265  cout << "RPTSCHDE" << endl;
266 }
267 
268 /*----------------------------------------------------------------------------*/
269 /* Brief Change History of This File */
270 /*----------------------------------------------------------------------------*/
271 /* Author Date Actions */
272 /*----------------------------------------------------------------------------*/
273 /* Shizhe Li Oct/01/2021 Create file */
274 /* Chensong Zhang Oct/15/2021 Format file */
275 /*----------------------------------------------------------------------------*/
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
int OCP_INT
Long integer.
Definition: OCPConst.hpp:25
ParamOutput class declaration.
void DealDefault(vector< string > &result)
Definition: UtilInput.cpp:50
constexpr long long Map_Str2Int(const char *mystr, const USI &len)
Definition: UtilInput.hpp:34
bool ReadLine(ifstream &ifs, vector< string > &result)
Definition: UtilInput.cpp:14
A structure of three-dimensional coordinates.
Definition: ParamOutput.hpp:24
bool BWAT
Water reservoir molar densities of grids.
bool VGAS
Gas viscosity of grids.
bool DENO
Oil density of grids.
bool SWAT
Water saturation of grids.
bool PRE
Pressure of grids.
Definition: ParamOutput.hpp:95
bool DENW
Water density of grids.
bool VWAT
Water viscosity of grids.
bool XMF
liquid component mole fractions.
bool PGAS
Gas pressure of grids.
Definition: ParamOutput.hpp:96
bool PWAT
Water pressure of grids.
Definition: ParamOutput.hpp:97
bool PCW
capilary pressure: Po - Pw.
bool SGAS
Gas saturation of grids.
Definition: ParamOutput.hpp:99
bool KRW
Water relative permeability of grids.
bool SOIL
Oil saturation of grids.
Definition: ParamOutput.hpp:98
bool DENG
Gas density of grids.
bool VOIL
Oil viscosity of grids.
bool BOIL
Oil reservoir molar densities of grids.
bool KRG
Gas relative permeability of grids.
bool KRO
Oil relative permeability of grids.
bool BGAS
Gas reservoir molar densities of grids.
bool YMF
gas component mole fractions.
bool FGIT
Field total gas injection.
Definition: ParamOutput.hpp:66
Type_A_o WWIR
Well water injection rate.
Definition: ParamOutput.hpp:78
Type_B_o SOIL
Oil saturation of bulk.
Definition: ParamOutput.hpp:84
bool FWPR
Field water production rate.
Definition: ParamOutput.hpp:63
bool FGPR
Field gas production rate.
Definition: ParamOutput.hpp:61
Type_A_o WGPR
Well gas production rate.
Definition: ParamOutput.hpp:72
bool FWIR
Field water injection rate.
Definition: ParamOutput.hpp:67
bool FPR
Field average Pressure.
Definition: ParamOutput.hpp:58
Type_A_o DG
Pressure difference between wells and perforations.
Definition: ParamOutput.hpp:81
Type_A_o WOPT
Well total oil production rate.
Definition: ParamOutput.hpp:71
Type_A_o WGPT
Well total gas production.
Definition: ParamOutput.hpp:73
Type_A_o WWPT
Well total water production.
Definition: ParamOutput.hpp:75
bool FWIT
Field total water injection.
Definition: ParamOutput.hpp:68
Type_B_o BPR
Bulk pressure.
Definition: ParamOutput.hpp:83
Type_B_o SWAT
Water saturation of bulk.
Definition: ParamOutput.hpp:86
Type_A_o WOPR
Well oil production rate.
Definition: ParamOutput.hpp:70
bool FGIR
Field gas injection rate.
Definition: ParamOutput.hpp:65
Type_A_o WGIR
Well gas injection rate.
Definition: ParamOutput.hpp:76
Type_B_o SGAS
Gas saturation of bulk.
Definition: ParamOutput.hpp:85
Type_A_o WGIT
Well total gas injection.
Definition: ParamOutput.hpp:77
bool FOPT
Field total oil production.
Definition: ParamOutput.hpp:60
bool FOPR
Field oil production rate.
Definition: ParamOutput.hpp:59
Type_A_o WBHP
Well pressure.
Definition: ParamOutput.hpp:80
bool FWPT
Field total water production.
Definition: ParamOutput.hpp:64
Type_A_o WWIT
Well total water injection.
Definition: ParamOutput.hpp:79
Type_A_o WWPR
Well water production rate.
Definition: ParamOutput.hpp:74
bool FGPt
Field total gas production.
Definition: ParamOutput.hpp:62
OutputDetail detailInfo
See OutputDetail.
void InputType_A(ifstream &ifs, Type_A_o &obj)
void InputRPTSCHED(ifstream &ifs)
void InputType_B(ifstream &ifs, Type_B_o &obj)
void InputSUMMARY(ifstream &ifs)
Definition: ParamOutput.cpp:14
OutputSummary summary
See OutputSummary.
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