OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
OCPOutput.cpp
Go to the documentation of this file.
1 
12 #include "OCPOutput.hpp"
13 
14 void Summary::InputParam(const OutputSummary &summary_param)
15 {
16  FPR = summary_param.FPR;
17  FOPR = summary_param.FOPR;
18  FOPT = summary_param.FOPT;
19  FGPR = summary_param.FGPR;
20  FGPt = summary_param.FGPt;
21  FWPR = summary_param.FWPR;
22  FWPT = summary_param.FWPT;
23  FGIR = summary_param.FGIR;
24  FGIT = summary_param.FGIT;
25  FWIR = summary_param.FWIR;
26  FWIT = summary_param.FWIT;
27 
28  WOPR = summary_param.WOPR;
29  WOPT = summary_param.WOPT;
30  WGPR = summary_param.WGPR;
31  WGPT = summary_param.WGPT;
32  WWPR = summary_param.WWPR;
33  WWPT = summary_param.WWPT;
34  WGIR = summary_param.WGIR;
35  WGIT = summary_param.WGIT;
36  WWIR = summary_param.WWIR;
37  WWIT = summary_param.WWIT;
38 
39  WBHP = summary_param.WBHP;
40  DG = summary_param.DG;
41 
42  BPR = summary_param.BPR;
43  SOIL = summary_param.SOIL;
44  SGAS = summary_param.SGAS;
45  SWAT = summary_param.SWAT;
46 
47  // cout << "Summary::InputParam" << endl;
48 }
49 
50 void Summary::Setup(const Reservoir &reservoir, const OCP_DBL &totalTime)
51 {
52  Sumdata.push_back(SumPair("TIME", " ", "DAY"));
53  Sumdata.push_back(SumPair("NRiter", " ", " "));
54  Sumdata.push_back(SumPair("LSiter", " ", " "));
55  if (FPR)
56  Sumdata.push_back(SumPair("FPR", " ", "PSIA"));
57  if (FOPR)
58  Sumdata.push_back(SumPair("FOPR", " ", "STB/DAY"));
59  if (FOPT)
60  Sumdata.push_back(SumPair("FOPT", " ", "STB"));
61  if (FGPR)
62  Sumdata.push_back(SumPair("FGPR", " ", "MSCF/DAY"));
63  if (FGPt)
64  Sumdata.push_back(SumPair("FGPT", " ", "MSCF"));
65  if (FWPR)
66  Sumdata.push_back(SumPair("FWPR", " ", "STB/DAY"));
67  if (FWPT)
68  Sumdata.push_back(SumPair("FWPT", " ", "STB"));
69  if (FGIR)
70  Sumdata.push_back(SumPair("FGIR", " ", "MSCF/DAY"));
71  if (FGIT)
72  Sumdata.push_back(SumPair("FGIT", " ", "MSCF"));
73  if (FWIR)
74  Sumdata.push_back(SumPair("FWIR", " ", "STB/DAY"));
75  if (FWIT)
76  Sumdata.push_back(SumPair("FWIT", " ", "STB"));
77 
78  const USI sp = reservoir.grid.GetNumDigitIJK();
79 
80  USI num;
81  USI wellnum = reservoir.allWells.GetWellNum();
82  string wellname;
83 
84  if (WOPR.activity)
85  {
86  if (WOPR.obj[0] == "All")
87  {
88  WOPR.obj.clear();
89  for (USI w = 0; w < wellnum; w++)
90  {
91  wellname = reservoir.allWells.GetWellName(w);
92  WOPR.obj.push_back(wellname);
93  Sumdata.push_back(SumPair("WOPR", wellname, "STB/DAY"));
94  WOPR.index.push_back(w);
95  }
96  }
97  else
98  {
99  num = WOPR.obj.size();
100  for (USI w = 0; w < num; w++)
101  {
102  Sumdata.push_back(SumPair("WOPR", WOPR.obj[w], "STB/DAY"));
103  WOPR.index.push_back(reservoir.allWells.GetIndex(WOPR.obj[w]));
104  }
105  }
106  }
107 
108  if (WOPT.activity)
109  {
110  if (WOPT.obj[0] == "All")
111  {
112  WOPT.obj.clear();
113  for (USI w = 0; w < wellnum; w++)
114  {
115  wellname = reservoir.allWells.GetWellName(w);
116  WOPT.obj.push_back(wellname);
117  Sumdata.push_back(SumPair("WOPT", wellname, "STB"));
118  WOPT.index.push_back(w);
119  }
120  }
121  else
122  {
123  num = WOPT.obj.size();
124  for (USI w = 0; w < num; w++)
125  {
126  Sumdata.push_back(SumPair("WOPT", WOPT.obj[w], "STB"));
127  WOPT.index.push_back(reservoir.allWells.GetIndex(WOPT.obj[w]));
128  }
129  }
130  }
131 
132  if (WGPR.activity)
133  {
134  if (WGPR.obj[0] == "All")
135  {
136  WGPR.obj.clear();
137  for (USI w = 0; w < wellnum; w++)
138  {
139  wellname = reservoir.allWells.GetWellName(w);
140  WGPR.obj.push_back(wellname);
141  Sumdata.push_back(SumPair("WGPR", wellname, "MSCF/DAY"));
142  WGPR.index.push_back(w);
143  }
144  }
145  else
146  {
147  num = WGPR.obj.size();
148  for (USI w = 0; w < num; w++)
149  {
150  Sumdata.push_back(SumPair("WGPR", WGPR.obj[w], "MSCF/DAY"));
151  WGPR.index.push_back(reservoir.allWells.GetIndex(WGPR.obj[w]));
152  }
153  }
154  }
155 
156  if (WGPT.activity)
157  {
158  if (WGPT.obj[0] == "All")
159  {
160  WGPT.obj.clear();
161  for (USI w = 0; w < wellnum; w++)
162  {
163  wellname = reservoir.allWells.GetWellName(w);
164  WGPT.obj.push_back(wellname);
165  Sumdata.push_back(SumPair("WGPT", wellname, "MSCF"));
166  WGPT.index.push_back(w);
167  }
168  }
169  else
170  {
171  num = WGPT.obj.size();
172  for (USI w = 0; w < num; w++)
173  {
174  Sumdata.push_back(SumPair("WGPT", WGPT.obj[w], "MSCF"));
175  WGPT.index.push_back(reservoir.allWells.GetIndex(WGPT.obj[w]));
176  }
177  }
178  }
179 
180  if (WWPR.activity)
181  {
182  if (WWPR.obj[0] == "All")
183  {
184  WWPR.obj.clear();
185  for (USI w = 0; w < wellnum; w++)
186  {
187  wellname = reservoir.allWells.GetWellName(w);
188  WWPR.obj.push_back(wellname);
189  Sumdata.push_back(SumPair("WWPR", wellname, "STB/DAY"));
190  WWPR.index.push_back(w);
191  }
192  }
193  else
194  {
195  num = WWPR.obj.size();
196  for (USI w = 0; w < num; w++)
197  {
198  Sumdata.push_back(SumPair("WWPR", WWPR.obj[w], "STB/DAY"));
199  WWPR.index.push_back(reservoir.allWells.GetIndex(WWPR.obj[w]));
200  }
201  }
202  }
203 
204  if (WWPT.activity)
205  {
206  if (WWPT.obj[0] == "All")
207  {
208  WWPT.obj.clear();
209  for (USI w = 0; w < wellnum; w++)
210  {
211  wellname = reservoir.allWells.GetWellName(w);
212  WWPT.obj.push_back(wellname);
213  Sumdata.push_back(SumPair("WWPT", wellname, "STB"));
214  WWPT.index.push_back(w);
215  }
216  }
217  else
218  {
219  num = WWPT.obj.size();
220  for (USI w = 0; w < num; w++)
221  {
222  Sumdata.push_back(SumPair("WWPT", WWPT.obj[w], "STB"));
223  WWPT.index.push_back(reservoir.allWells.GetIndex(WWPT.obj[w]));
224  }
225  }
226  }
227 
228  if (WGIR.activity)
229  {
230  if (WGIR.obj[0] == "All")
231  {
232  WGIR.obj.clear();
233  for (USI w = 0; w < wellnum; w++)
234  {
235  wellname = reservoir.allWells.GetWellName(w);
236  WGIR.obj.push_back(wellname);
237  Sumdata.push_back(SumPair("WGIR", wellname, "MSCF/DAY"));
238  WGIR.index.push_back(w);
239  }
240  }
241  else
242  {
243  num = WGIR.obj.size();
244  for (USI w = 0; w < num; w++)
245  {
246  Sumdata.push_back(SumPair("WGIR", WGIR.obj[w], "MSCF/DAY"));
247  WGIR.index.push_back(reservoir.allWells.GetIndex(WGIR.obj[w]));
248  }
249  }
250  }
251 
252  if (WGIT.activity)
253  {
254  if (WGIT.obj[0] == "All")
255  {
256  WGIT.obj.clear();
257  for (USI w = 0; w < wellnum; w++)
258  {
259  wellname = reservoir.allWells.GetWellName(w);
260  WGIT.obj.push_back(wellname);
261  Sumdata.push_back(SumPair("WGIT", wellname, "MSCF"));
262  WGIT.index.push_back(w);
263  }
264  }
265  else
266  {
267  num = WGIT.obj.size();
268  for (USI w = 0; w < num; w++)
269  {
270  Sumdata.push_back(SumPair("WGIT", WGIT.obj[w], "MSCF"));
271  WGIT.index.push_back(reservoir.allWells.GetIndex(WGIT.obj[w]));
272  }
273  }
274  }
275 
276  if (WWIR.activity)
277  {
278  if (WWIR.obj[0] == "All")
279  {
280  WWIR.obj.clear();
281  for (USI w = 0; w < wellnum; w++)
282  {
283  wellname = reservoir.allWells.GetWellName(w);
284  WWIR.obj.push_back(wellname);
285  Sumdata.push_back(SumPair("WWIR", wellname, "STB/DAY"));
286  WWIR.index.push_back(w);
287  }
288  }
289  else
290  {
291  num = WWIR.obj.size();
292  for (USI w = 0; w < num; w++)
293  {
294  Sumdata.push_back(SumPair("WWIR", WWIR.obj[w], "STB/DAY"));
295  WWIR.index.push_back(reservoir.allWells.GetIndex(WWIR.obj[w]));
296  }
297  }
298  }
299 
300  if (WWIT.activity)
301  {
302  if (WWIT.obj[0] == "All")
303  {
304  WWIT.obj.clear();
305  for (USI w = 0; w < wellnum; w++)
306  {
307  wellname = reservoir.allWells.GetWellName(w);
308  WWIT.obj.push_back(wellname);
309  Sumdata.push_back(SumPair("WWIT", wellname, "STB"));
310  WWIT.index.push_back(w);
311  }
312  }
313  else
314  {
315  num = WWIT.obj.size();
316  for (USI w = 0; w < num; w++)
317  {
318  Sumdata.push_back(SumPair("WWIT", WWIT.obj[w], "STB"));
319  WWIT.index.push_back(reservoir.allWells.GetIndex(WWIT.obj[w]));
320  }
321  }
322  }
323 
324  if (WBHP.activity)
325  {
326  if (WBHP.obj[0] == "All")
327  {
328  WBHP.obj.clear();
329  for (USI w = 0; w < wellnum; w++)
330  {
331  wellname = reservoir.allWells.GetWellName(w);
332  WBHP.obj.push_back(wellname);
333  Sumdata.push_back(SumPair("WBHP", wellname, "PSIA"));
334  WBHP.index.push_back(w);
335  }
336  }
337  else
338  {
339  num = WBHP.obj.size();
340  for (USI w = 0; w < num; w++)
341  {
342  Sumdata.push_back(SumPair("WBHP", WBHP.obj[w], "PSIA"));
343  WBHP.index.push_back(reservoir.allWells.GetIndex(WBHP.obj[w]));
344  }
345  }
346  }
347 
348  if (DG.activity)
349  {
350  if (DG.obj[0] == "All")
351  {
352  DG.obj.clear();
353  for (USI w = 0; w < wellnum; w++)
354  {
355  string wellname = reservoir.allWells.GetWellName(w);
356  DG.obj.push_back(wellname);
357  USI perfnum = reservoir.allWells.GetWellPerfNum(w);
358  for (USI p = 0; p < perfnum; p++)
359  {
360  Sumdata.push_back(
361  SumPair("DG", wellname + " Perf" + to_string(p), "PSIA"));
362  DG.index.push_back(w);
363  }
364  }
365  }
366  else
367  {
368  num = DG.obj.size();
369  for (USI w = 0; w < num; w++)
370  {
371  USI wId = reservoir.allWells.GetIndex(DG.obj[w]);
372  USI perfnum = reservoir.allWells.GetWellPerfNum(wId);
373  for (USI p = 0; p < perfnum; p++)
374  {
375  Sumdata.push_back(
376  SumPair("DG", DG.obj[w] + " P" + to_string(p), "PSIA"));
377  DG.index.push_back(wId);
378  }
379  }
380  }
381  }
382 
383  if (BPR.activity)
384  {
385  num = BPR.obj.size();
386  for (USI i = 0; i < num; i++)
387  {
388  string temp = GetIJKformat(to_string(BPR.obj[i].I), to_string(BPR.obj[i].J),
389  to_string(BPR.obj[i].K), sp);
390  Sumdata.push_back(SumPair("BPR", temp, "PSIA"));
391  USI I = BPR.obj[i].I - 1;
392  USI J = BPR.obj[i].J - 1;
393  USI K = BPR.obj[i].K - 1;
394  BPR.index.push_back(reservoir.grid.GetActIndex(I, J, K));
395  }
396  }
397 
398  if (SOIL.activity)
399  {
400  num = SOIL.obj.size();
401  for (USI i = 0; i < num; i++)
402  {
403  string temp = GetIJKformat(to_string(SOIL.obj[i].I), to_string(SOIL.obj[i].J),
404  to_string(SOIL.obj[i].K), sp);
405  Sumdata.push_back(SumPair("SOIL", temp, " "));
406  USI I = SOIL.obj[i].I - 1;
407  USI J = SOIL.obj[i].J - 1;
408  USI K = SOIL.obj[i].K - 1;
409  SOIL.index.push_back(reservoir.grid.GetActIndex(I, J, K));
410  }
411  }
412 
413  if (SGAS.activity)
414  {
415  num = SGAS.obj.size();
416  for (USI i = 0; i < num; i++)
417  {
418  string temp = GetIJKformat(to_string(SGAS.obj[i].I), to_string(SGAS.obj[i].J),
419  to_string(SGAS.obj[i].K), sp);
420  Sumdata.push_back(SumPair("SGAS", temp, " "));
421  USI I = SGAS.obj[i].I - 1;
422  USI J = SGAS.obj[i].J - 1;
423  USI K = SGAS.obj[i].K - 1;
424  SGAS.index.push_back(reservoir.grid.GetActIndex(I, J, K));
425  }
426  }
427 
428  if (SWAT.activity)
429  {
430  num = SWAT.obj.size();
431  for (USI i = 0; i < num; i++)
432  {
433  string temp = GetIJKformat(to_string(SWAT.obj[i].I), to_string(SWAT.obj[i].J),
434  to_string(SWAT.obj[i].K), sp);
435  Sumdata.push_back(SumPair("SWAT", temp, " "));
436  USI I = SWAT.obj[i].I - 1;
437  USI J = SWAT.obj[i].J - 1;
438  USI K = SWAT.obj[i].K - 1;
439  SWAT.index.push_back(reservoir.grid.GetActIndex(I, J, K));
440  }
441  }
442 
443  // Allocate memory
444  USI rs = totalTime / 0.1;
445  USI cs = Sumdata.size();
446  for (USI i = 0; i < cs; i++)
447  {
448  Sumdata[i].val.reserve(rs);
449  }
450 
451  // cout << "Summary::Setup" << endl;
452 }
453 
454 void Summary::SetVal(const Reservoir &rs, const OCPControl &ctrl)
455 {
456  USI n = 0;
457 
458  // TIME
459  Sumdata[n++].val.push_back(ctrl.GetCurTime());
460  // NRiter
461  Sumdata[n++].val.push_back(ctrl.GetNRiterT());
462  // LSiter
463  Sumdata[n++].val.push_back(ctrl.GetLSiterT());
464 
465  // FPR
466  if (FPR)
467  Sumdata[n++].val.push_back(rs.bulk.CalFPR());
468  if (FOPR)
469  Sumdata[n++].val.push_back(rs.allWells.GetFOPR());
470  if (FOPT)
471  Sumdata[n++].val.push_back(rs.allWells.GetFOPT());
472  if (FGPR)
473  Sumdata[n++].val.push_back(rs.allWells.GetFGPR());
474  if (FGPt)
475  Sumdata[n++].val.push_back(rs.allWells.GetFGPT());
476  if (FWPR)
477  Sumdata[n++].val.push_back(rs.allWells.GetFWPR());
478  if (FWPT)
479  Sumdata[n++].val.push_back(rs.allWells.GetFWPT());
480  if (FGIR)
481  Sumdata[n++].val.push_back(rs.allWells.GetFGIR());
482  if (FGIT)
483  Sumdata[n++].val.push_back(rs.allWells.GetFGIT());
484  if (FWIR)
485  Sumdata[n++].val.push_back(rs.allWells.GetFWIR());
486  if (FWIT)
487  Sumdata[n++].val.push_back(rs.allWells.GetFWIT());
488 
489  USI len = 0;
490  // WOPR
491  len = WOPR.index.size();
492  for (USI w = 0; w < len; w++)
493  Sumdata[n++].val.push_back(rs.allWells.GetWOPR(WOPR.index[w]));
494 
495  // WOPT
496  len = WOPT.index.size();
497  for (USI w = 0; w < len; w++)
498  Sumdata[n++].val.push_back(rs.allWells.GetWOPT(WOPT.index[w]));
499 
500  // WGPR
501  len = WGPR.index.size();
502  for (USI w = 0; w < len; w++)
503  Sumdata[n++].val.push_back(rs.allWells.GetWGPR(WGPR.index[w]));
504 
505  // WGPT
506  len = WGPT.index.size();
507  for (USI w = 0; w < len; w++)
508  Sumdata[n++].val.push_back(rs.allWells.GetWGPT(WGPT.index[w]));
509 
510  // WWPR
511  len = WWPR.index.size();
512  for (USI w = 0; w < len; w++)
513  Sumdata[n++].val.push_back(rs.allWells.GetWWPR(WWPR.index[w]));
514 
515  // WWPT
516  len = WWPT.index.size();
517  for (USI w = 0; w < len; w++)
518  Sumdata[n++].val.push_back(rs.allWells.GetWWPT(WWPT.index[w]));
519 
520  // WGIR
521  len = WGIR.index.size();
522  for (USI w = 0; w < len; w++)
523  Sumdata[n++].val.push_back(rs.allWells.GetWGIR(WGIR.index[w]));
524 
525  // WGIT
526  len = WGIT.index.size();
527  for (USI w = 0; w < len; w++)
528  Sumdata[n++].val.push_back(rs.allWells.GetWGIT(WGIT.index[w]));
529 
530  // WWIR
531  len = WWIR.index.size();
532  for (USI w = 0; w < len; w++)
533  Sumdata[n++].val.push_back(rs.allWells.GetWWIR(WWIR.index[w]));
534 
535  // WWIT
536  len = WWIT.index.size();
537  for (USI w = 0; w < len; w++)
538  Sumdata[n++].val.push_back(rs.allWells.GetWWIT(WWIT.index[w]));
539 
540  // WBHP
541  len = WBHP.index.size();
542  for (USI w = 0; w < len; w++)
543  Sumdata[n++].val.push_back(rs.allWells.GetWBHP(WBHP.index[w]));
544 
545  // DG
546  len = DG.obj.size();
547  for (USI w = 0; w < len; w++)
548  {
549  USI numperf = rs.allWells.GetWellPerfNum(DG.index[w]);
550  for (USI p = 0; p < numperf; p++)
551  {
552  Sumdata[n++].val.push_back(rs.allWells.GetWellDg(DG.index[w], p));
553  }
554  }
555 
556  // BPR
557  len = BPR.index.size();
558  for (USI i = 0; i < len; i++)
559  Sumdata[n++].val.push_back(rs.bulk.GetP(BPR.index[i]));
560 
561  // SOIL
562  len = SOIL.index.size();
563  for (USI i = 0; i < len; i++)
564  Sumdata[n++].val.push_back(rs.bulk.GetSOIL(SOIL.index[i]));
565 
566  // SGAS
567  len = SGAS.index.size();
568  for (USI i = 0; i < len; i++)
569  Sumdata[n++].val.push_back(rs.bulk.GetSGAS(SGAS.index[i]));
570 
571  // SWAT
572  len = SWAT.index.size();
573  for (USI i = 0; i < len; i++)
574  Sumdata[n++].val.push_back(rs.bulk.GetSWAT(SWAT.index[i]));
575 }
576 
578 void Summary::PrintInfo(const string &dir) const
579 {
580  string FileOut = dir + "SUMMARY.out";
581  ofstream outF(FileOut);
582  if (!outF.is_open())
583  {
584  OCP_ABORT("Can not open " + FileOut);
585  }
586 
587  USI ns = 12;
588  USI col = 10;
589  USI row = 0;
590  USI num = Sumdata.size();
591  USI len = Sumdata[0].val.size();
592  USI id = 0;
593  USI ID = 1;
594 
595  while (id != num)
596  {
597 
598  outF << "Row " << ++row << endl;
599 
600  // Item
601  // Time
602  outF << "\t" << setw(ns) << Sumdata[0].Item;
603 
604  id = ID;
605  for (USI i = 1; i < col; i++)
606  {
607  outF << "\t" << setw(ns) << Sumdata[id++].Item;
608  if (id == num)
609  break;
610  }
611  outF << endl;
612 
613  // Unit
614  // Time
615  outF << "\t" << setw(ns) << Sumdata[0].Unit;
616 
617  id = ID;
618  for (USI i = 1; i < col; i++)
619  {
620  outF << "\t" << setw(ns) << Sumdata[id++].Unit;
621  if (id == num)
622  break;
623  }
624  outF << endl;
625 
626  // Obj
627  // Time
628  outF << "\t" << setw(ns) << Sumdata[0].Obj;
629 
630  id = ID;
631  for (USI i = 1; i < col; i++)
632  {
633  outF << "\t" << setw(ns) << Sumdata[id++].Obj;
634  if (id == num)
635  break;
636  }
637  outF << endl;
638 
639  // Data
640  for (USI l = 0; l < len; l++)
641  {
642 
643  // Time
644  outF << "\t" << setw(ns) << Sumdata[0].val[l];
645 
646  id = ID;
647  for (USI i = 1; i < col; i++)
648  {
649  outF << "\t" << setw(ns) << Sumdata[id++].val[l];
650  if (id == num)
651  break;
652  }
653  outF << endl;
654  }
655 
656  ID += (col - 1);
657 
658  outF << endl;
659  }
660 
661  outF.close();
662 }
663 
664 void CriticalInfo::Setup(const OCP_DBL &totalTime)
665 {
666  // Allocate memory
667  USI rc = totalTime / 0.1;
668  time.reserve(rc);
669  dt.reserve(rc);
670  dPmax.reserve(rc);
671  dVmax.reserve(rc);
672  dSmax.reserve(rc);
673  dNmax.reserve(rc);
674  cfl.reserve(rc);
675 }
676 
677 void CriticalInfo::SetVal(const Reservoir &reservoir, const OCPControl &ctrl)
678 {
679  time.push_back(ctrl.GetCurTime());
680  dt.push_back(ctrl.GetLastDt());
681  dPmax.push_back(reservoir.bulk.GetdPmax());
682  dVmax.push_back(reservoir.bulk.GetdVmax());
683  dSmax.push_back(reservoir.bulk.GetdSmax());
684  dNmax.push_back(reservoir.bulk.GetdNmax());
685  cfl.push_back(reservoir.cfl);
686 }
687 
688 void CriticalInfo::PrintInfo(const string &dir) const
689 {
690  string FileOut = dir + "FastReview.out";
691  ofstream outF(FileOut);
692  if (!outF.is_open())
693  {
694  OCP_ABORT("Can not open " + FileOut);
695  }
696 
697  // Item
698  outF << "\t" << setw(10) << "Time";
699  outF << "\t" << setw(10) << "dt";
700  outF << "\t" << setw(10) << "dPmax";
701  outF << "\t" << setw(10) << "dVmax";
702  outF << "\t" << setw(10) << "dSmax";
703  outF << "\t" << setw(10) << "dNmax";
704  outF << "\t" << setw(10) << "CFL\n";
705  // Unit
706  outF << "\t" << setw(10) << "Days";
707  outF << "\t" << setw(10) << "Days";
708  outF << "\t" << setw(10) << "Psia";
709  outF << "\t" << setw(10) << " ";
710  outF << "\t" << setw(10) << " ";
711  outF << "\t" << setw(10) << " ";
712  outF << "\t" << setw(10) << " \n\n";
713 
714  USI n = time.size();
715  for (USI i = 0; i < n; i++)
716  {
717  outF << "\t" << setw(10) << time[i];
718  outF << "\t" << setw(10) << dt[i];
719  outF << "\t" << setw(10) << dPmax[i];
720  outF << "\t" << setw(10) << dVmax[i];
721  outF << "\t" << setw(10) << dSmax[i];
722  outF << "\t" << setw(10) << dNmax[i];
723  outF << "\t" << setw(10) << cfl[i];
724  outF << "\n";
725  }
726 
727  outF.close();
728 }
729 
730 void DetailInfo::InputParam(const OutputDetail &detail_param)
731 {
732  PRE = detail_param.PRE;
733  PGAS = detail_param.PGAS;
734  PWAT = detail_param.PWAT;
735  SOIL = detail_param.SOIL;
736  SGAS = detail_param.SGAS;
737  SWAT = detail_param.SWAT;
738  DENO = detail_param.DENO;
739  DENG = detail_param.DENG;
740  DENW = detail_param.DENW;
741  KRO = detail_param.KRO;
742  KRG = detail_param.KRG;
743  KRW = detail_param.KRW;
744  BOIL = detail_param.BOIL;
745  BGAS = detail_param.BGAS;
746  BWAT = detail_param.BWAT;
747  VOIL = detail_param.VOIL;
748  VGAS = detail_param.VGAS;
749  VWAT = detail_param.VWAT;
750  XMF = detail_param.XMF;
751  YMF = detail_param.YMF;
752  PCW = detail_param.PCW;
753 }
754 
755 void DetailInfo::Setup(const string &dir)
756 {
757  string FileOut = dir + "RPT.out";
758  ofstream outF(FileOut);
759  if (!outF.is_open())
760  {
761  OCP_ABORT("Can not open " + FileOut);
762  }
763  outF.close();
764 }
765 
766 void DetailInfo::PrintInfo(const string &dir, const Reservoir &rs,
767  const OCP_DBL &days) const
768 {
769  string FileOut = dir + "RPT.out";
770  ofstream outF;
771  outF.open(FileOut, ios::app);
772  if (!outF.is_open())
773  {
774  OCP_ABORT("Can not open " + FileOut);
775  }
776 
777  const USI np = rs.bulk.numPhase;
778  const USI nc = rs.bulk.numCom;
779  const USI OIndex = rs.bulk.phase2Index[OIL];
780  const USI GIndex = rs.bulk.phase2Index[GAS];
781  const USI WIndex = rs.bulk.phase2Index[WATER];
782  const USI nx = rs.grid.GetGridNx();
783  const USI ny = rs.grid.GetGridNy();
784  const OCP_USI num = rs.grid.GetGridNum();
785  const USI tmpsp = rs.grid.GetNumDigitIJK();
786  OCP_USI bId;
787  OCP_USI tmpId;
788  USI I, J, K;
789 
790  const string sep01(50, '=');
791  const string sep02(50, '-');
792 
793  outF << sep01 << "\n";
794 
795  static bool flag = false;
796  // Print once
797  if (flag)
798  {
799  outF << "DX : feet";
800  for (OCP_USI i = 0; i < num; i++)
801  {
802  if (i % nx == 0)
803  outF << "\n";
804  if (i % (nx * ny) == 0)
805  outF << "\n\n";
806 
807  if (i % nx == 0)
808  {
809  rs.grid.GetIJKGrid(I, J, K, i);
810  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
811  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
812  }
813 
814  if (rs.grid.MapG2B(i).IsAct())
815  {
816  bId = rs.grid.MapG2B(i).GetId();
817  outF << setw(12) << fixed << setprecision(5) << rs.bulk.dx[bId];
818  }
819  else
820  {
821  outF << setw(12) << "----- ";
822  }
823  }
824  outF << "\n\n\n";
825  }
826 
827  if (flag)
828  {
829  outF << "DY : feet";
830  for (OCP_USI i = 0; i < num; i++)
831  {
832  if (i % nx == 0)
833  outF << "\n";
834  if (i % (nx * ny) == 0)
835  outF << "\n\n";
836 
837  if (i % nx == 0)
838  {
839  rs.grid.GetIJKGrid(I, J, K, i);
840  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
841  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
842  }
843 
844  if (rs.grid.MapG2B(i).IsAct())
845  {
846  bId = rs.grid.MapG2B(i).GetId();
847  outF << setw(12) << fixed << setprecision(5) << rs.bulk.dy[bId];
848  }
849  else
850  {
851  outF << setw(12) << "----- ";
852  }
853  }
854  outF << "\n\n\n";
855  }
856 
857  if (flag)
858  {
859  outF << "DZ : feet";
860  for (OCP_USI i = 0; i < num; i++)
861  {
862  if (i % nx == 0)
863  outF << "\n";
864  if (i % (nx * ny) == 0)
865  outF << "\n\n";
866 
867  if (i % nx == 0)
868  {
869  rs.grid.GetIJKGrid(I, J, K, i);
870  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
871  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
872  }
873 
874  if (rs.grid.MapG2B(i).IsAct())
875  {
876  bId = rs.grid.MapG2B(i).GetId();
877  outF << setw(12) << fixed << setprecision(5) << rs.bulk.dz[bId];
878  }
879  else
880  {
881  outF << setw(12) << "----- ";
882  }
883  }
884  outF << "\n\n\n";
885  }
886 
887  if (flag)
888  {
889  outF << "Depth : feet";
890  for (OCP_USI i = 0; i < num; i++)
891  {
892  if (i % nx == 0)
893  outF << "\n";
894  if (i % (nx * ny) == 0)
895  outF << "\n\n";
896 
897  if (i % nx == 0)
898  {
899  rs.grid.GetIJKGrid(I, J, K, i);
900  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
901  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
902  }
903 
904  if (rs.grid.MapG2B(i).IsAct())
905  {
906  bId = rs.grid.MapG2B(i).GetId();
907  outF << setw(12) << fixed << setprecision(1) << rs.bulk.depth[bId];
908  }
909  else
910  {
911  outF << setw(12) << "----- ";
912  }
913  }
914  outF << "\n\n\n";
915  }
916 
917  if (flag)
918  {
919  outF << "PERMX : MDarcy";
920  for (OCP_USI i = 0; i < num; i++)
921  {
922  if (i % nx == 0)
923  outF << "\n";
924  if (i % (nx * ny) == 0)
925  outF << "\n\n";
926 
927  if (i % nx == 0)
928  {
929  rs.grid.GetIJKGrid(I, J, K, i);
930  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
931  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
932  }
933 
934  if (rs.grid.MapG2B(i).IsAct())
935  {
936  bId = rs.grid.MapG2B(i).GetId();
937  outF << setw(12) << fixed << setprecision(5) << rs.bulk.rockKxInit[bId];
938  }
939  else
940  {
941  outF << setw(12) << "----- ";
942  }
943  }
944  outF << "\n\n\n";
945  }
946 
947  if (flag)
948  {
949  outF << "PERMY : MDarcy";
950  for (OCP_USI i = 0; i < num; i++)
951  {
952  if (i % nx == 0)
953  outF << "\n";
954  if (i % (nx * ny) == 0)
955  outF << "\n\n";
956 
957  if (i % nx == 0)
958  {
959  rs.grid.GetIJKGrid(I, J, K, i);
960  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
961  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
962  }
963 
964  if (rs.grid.MapG2B(i).IsAct())
965  {
966  bId = rs.grid.MapG2B(i).GetId();
967  outF << setw(12) << fixed << setprecision(5) << rs.bulk.rockKyInit[bId];
968  }
969  else
970  {
971  outF << setw(12) << "----- ";
972  }
973  }
974  outF << "\n\n\n";
975  }
976 
977  if (flag)
978  {
979  outF << "PERMZ : MDarcy";
980  for (OCP_USI i = 0; i < num; i++)
981  {
982  if (i % nx == 0)
983  outF << "\n";
984  if (i % (nx * ny) == 0)
985  outF << "\n\n";
986 
987  if (i % nx == 0)
988  {
989  rs.grid.GetIJKGrid(I, J, K, i);
990  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
991  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
992  }
993 
994  if (rs.grid.MapG2B(i).IsAct())
995  {
996  bId = rs.grid.MapG2B(i).GetId();
997  outF << setw(12) << fixed << setprecision(5) << rs.bulk.rockKzInit[bId];
998  }
999  else
1000  {
1001  outF << setw(12) << "----- ";
1002  }
1003  }
1004  outF << "\n\n\n";
1005  }
1006 
1007  flag = false;
1008 
1009 
1010  // Well infor
1011  USI numWell = rs.allWells.GetWellNum();
1012  outF << "Well Information" << " ";
1013  outF << fixed << setprecision(3) << days << " DAYS" << endl;
1014  // INJ
1015  for (USI w = 0; w < numWell; w++) {
1016  if (rs.allWells.wells[w].opt.type == INJ) {
1017  outF << "-------------------------------------" << endl;
1018  outF << rs.allWells.wells[w].name << " " << w << " "
1019  << rs.allWells.wells[w].depth << " (feet) ";
1020  outF << rs.allWells.wells[w].I << " "
1021  << rs.allWells.wells[w].J << endl;
1022 
1023  if (rs.allWells.wells[w].opt.state == OPEN) {
1024  outF << "OPEN\t" << rs.allWells.wells[w].WGIR << " (MSCF/DAY)\t" << rs.allWells.wells[w].WWIR << " (STB/DAY)" << endl;
1025  }
1026  else {
1027  outF << "SHUTIN" << endl;
1028  }
1029  // perf
1030  for (USI p = 0; p < rs.allWells.wells[w].numPerf; p++) {
1031  outF << "perf" << p << " "
1032  << rs.allWells.wells[w].perf[p].I << " "
1033  << rs.allWells.wells[w].perf[p].J << " "
1034  << rs.allWells.wells[w].perf[p].K << " "
1035  << rs.allWells.wells[w].perf[p].depth << " ";
1036  if (rs.allWells.wells[w].perf[p].state == OPEN) {
1037  outF << "OPEN";
1038  }
1039  else {
1040  outF << "SHUTIN";
1041  }
1042  outF << " " << rs.allWells.wells[w].perf[p].location << endl;
1043  }
1044  }
1045  }
1046  // PROD
1047  for (USI w = 0; w < numWell; w++) {
1048  if (rs.allWells.wells[w].opt.type == PROD) {
1049  outF << "-------------------------------------" << endl;
1050  outF << rs.allWells.wells[w].name << " " << w << " "
1051  << rs.allWells.wells[w].depth << " (feet) ";
1052  outF << rs.allWells.wells[w].I << " "
1053  << rs.allWells.wells[w].J << endl;
1054 
1055  if (rs.allWells.wells[w].opt.state == OPEN) {
1056  outF << "OPEN\t" << rs.allWells.wells[w].WOPR << " (STB/DAY)\t" << rs.allWells.wells[w].WGPR << " (MSCF/DAY)\t" << rs.allWells.wells[w].WWPR << " (STB/DAY)" << endl;
1057  }
1058  else {
1059  outF << "SHUTIN" << endl;
1060  }
1061  // perf
1062  for (USI p = 0; p < rs.allWells.wells[w].numPerf; p++) {
1063  outF << "perf" << p << " "
1064  << rs.allWells.wells[w].perf[p].I << " "
1065  << rs.allWells.wells[w].perf[p].J << " "
1066  << rs.allWells.wells[w].perf[p].K << " "
1067  << rs.allWells.wells[w].perf[p].depth << " ";
1068  if (rs.allWells.wells[w].perf[p].state == OPEN) {
1069  outF << "OPEN";
1070  }
1071  else {
1072  outF << "SHUTIN";
1073  }
1074  outF << " " << rs.allWells.wells[w].perf[p].location << endl;
1075  }
1076  }
1077  }
1078 
1079  outF << endl << endl;
1080 
1081 
1082 
1083  // PRESSURE
1084  if (PRE)
1085  {
1086  outF << "PRESSURE : psia"
1087  << " ";
1088  outF << fixed << setprecision(3) << days << " DAYS";
1089  for (OCP_USI i = 0; i < num; i++)
1090  {
1091  if (i % nx == 0)
1092  outF << "\n";
1093  if (i % (nx * ny) == 0)
1094  outF << "\n\n";
1095 
1096  if (i % nx == 0)
1097  {
1098  rs.grid.GetIJKGrid(I, J, K, i);
1099  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1100  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1101  }
1102 
1103  if (rs.grid.MapG2B(i).IsAct())
1104  {
1105  bId = rs.grid.MapG2B(i).GetId();
1106  outF << setw(12) << fixed << setprecision(3) << rs.bulk.P[bId];
1107  }
1108  else
1109  {
1110  outF << setw(12) << "----- ";
1111  }
1112  }
1113  outF << "\n\n\n";
1114  }
1115 
1116  // DENSITY of OIL
1117  if (DENO && rs.bulk.oil)
1118  {
1119  outF << sep02 << "\n";
1120  outF << "DENO : lb/ft3"
1121  << " ";
1122  outF << fixed << setprecision(3) << days << " DAYS";
1123  for (OCP_USI i = 0; i < num; i++)
1124  {
1125  if (i % nx == 0)
1126  outF << "\n";
1127  if (i % (nx * ny) == 0)
1128  outF << "\n\n";
1129 
1130  if (i % nx == 0)
1131  {
1132  rs.grid.GetIJKGrid(I, J, K, i);
1133  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1134  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1135  }
1136 
1137  if (rs.grid.MapG2B(i).IsAct())
1138  {
1139  bId = rs.grid.MapG2B(i).GetId();
1140  tmpId = bId * np + OIndex;
1141  if (rs.bulk.phaseExist[tmpId])
1142  {
1143  outF << setw(10) << fixed << setprecision(3) << rs.bulk.rho[tmpId];
1144  }
1145  else
1146  {
1147  outF << setw(9) << fixed << setprecision(2) << 0.0 << "N";
1148  }
1149  }
1150  else
1151  {
1152  outF << setw(10) << " --- ";
1153  }
1154  }
1155  outF << "\n\n";
1156  }
1157 
1158  // DENSITY of GAS
1159  if (DENG && rs.bulk.gas)
1160  {
1161  outF << sep02 << "\n";
1162  outF << "DENG : lb/ft3"
1163  << " ";
1164  outF << fixed << setprecision(3) << days << " DAYS";
1165  for (OCP_USI i = 0; i < num; i++)
1166  {
1167  if (i % nx == 0)
1168  outF << "\n";
1169  if (i % (nx * ny) == 0)
1170  outF << "\n\n";
1171 
1172  if (i % nx == 0)
1173  {
1174  rs.grid.GetIJKGrid(I, J, K, i);
1175  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1176  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1177  }
1178 
1179  if (rs.grid.MapG2B(i).IsAct())
1180  {
1181  bId = rs.grid.MapG2B(i).GetId();
1182  tmpId = bId * np + GIndex;
1183  if (rs.bulk.phaseExist[tmpId])
1184  {
1185  outF << setw(10) << fixed << setprecision(3) << rs.bulk.rho[tmpId];
1186  }
1187  else
1188  {
1189  outF << setw(9) << fixed << setprecision(2) << 0.0 << "N";
1190  }
1191  }
1192  else
1193  {
1194  outF << setw(10) << " --- ";
1195  }
1196  }
1197  outF << "\n\n";
1198  }
1199 
1200  // DENSITY of WATER
1201  if (DENW && rs.bulk.water)
1202  {
1203  outF << sep02 << "\n";
1204  outF << "DENW : lb/ft3"
1205  << " ";
1206  outF << fixed << setprecision(3) << days << " DAYS";
1207  for (OCP_USI i = 0; i < num; i++)
1208  {
1209  if (i % nx == 0)
1210  outF << "\n";
1211  if (i % (nx * ny) == 0)
1212  outF << "\n\n";
1213 
1214  if (i % nx == 0)
1215  {
1216  rs.grid.GetIJKGrid(I, J, K, i);
1217  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1218  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1219  }
1220 
1221  if (rs.grid.MapG2B(i).IsAct())
1222  {
1223  bId = rs.grid.MapG2B(i).GetId();
1224  tmpId = bId * np + WIndex;
1225  if (rs.bulk.phaseExist[tmpId])
1226  {
1227  outF << setw(10) << fixed << setprecision(3) << rs.bulk.rho[tmpId];
1228  }
1229  else
1230  {
1231  outF << setw(9) << fixed << setprecision(2) << 0.0 << "N";
1232  }
1233  }
1234  else
1235  {
1236  outF << setw(10) << " --- ";
1237  }
1238  }
1239  outF << "\n\n";
1240  }
1241 
1242  // SATURATION of OIL
1243  if (SOIL && rs.bulk.oil)
1244  {
1245  outF << sep02 << "\n";
1246  outF << "SOIL"
1247  << " ";
1248  outF << fixed << setprecision(3) << days << " DAYS";
1249  for (OCP_USI i = 0; i < num; i++)
1250  {
1251  if (i % nx == 0)
1252  outF << "\n";
1253  if (i % (nx * ny) == 0)
1254  outF << "\n\n";
1255 
1256  if (i % nx == 0)
1257  {
1258  rs.grid.GetIJKGrid(I, J, K, i);
1259  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1260  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1261  }
1262 
1263  if (rs.grid.MapG2B(i).IsAct())
1264  {
1265  bId = rs.grid.MapG2B(i).GetId();
1266  tmpId = bId * np + OIndex;
1267  if (rs.bulk.phaseExist[tmpId])
1268  {
1269  outF << setw(10) << fixed << setprecision(5) << rs.bulk.S[tmpId];
1270  }
1271  else
1272  {
1273  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1274  }
1275  }
1276  else
1277  {
1278  outF << setw(10) << " --- ";
1279  }
1280  }
1281  outF << "\n\n";
1282  }
1283 
1284  // SATURATION of GAS
1285  if (SGAS && rs.bulk.gas)
1286  {
1287  outF << sep02 << "\n";
1288  outF << "SGAS"
1289  << " ";
1290  outF << fixed << setprecision(3) << days << " DAYS";
1291  for (OCP_USI i = 0; i < num; i++)
1292  {
1293  if (i % nx == 0)
1294  outF << "\n";
1295  if (i % (nx * ny) == 0)
1296  outF << "\n\n";
1297 
1298  if (i % nx == 0)
1299  {
1300  rs.grid.GetIJKGrid(I, J, K, i);
1301  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1302  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1303  }
1304 
1305  if (rs.grid.MapG2B(i).IsAct())
1306  {
1307  bId = rs.grid.MapG2B(i).GetId();
1308  tmpId = bId * np + GIndex;
1309  if (rs.bulk.phaseExist[tmpId])
1310  {
1311  outF << setw(10) << fixed << setprecision(5) << rs.bulk.S[tmpId];
1312  }
1313  else
1314  {
1315  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1316  }
1317  }
1318  else
1319  {
1320  outF << setw(10) << " --- ";
1321  }
1322  }
1323  outF << "\n\n";
1324  }
1325 
1326  // SATURATION of WATER
1327  if (SWAT && rs.bulk.water)
1328  {
1329  outF << sep02 << "\n";
1330  outF << "SWAT"
1331  << " ";
1332  outF << fixed << setprecision(3) << days << " DAYS";
1333  for (OCP_USI i = 0; i < num; i++)
1334  {
1335  if (i % nx == 0)
1336  outF << "\n";
1337  if (i % (nx * ny) == 0)
1338  outF << "\n\n";
1339 
1340  if (i % nx == 0)
1341  {
1342  rs.grid.GetIJKGrid(I, J, K, i);
1343  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1344  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1345  }
1346 
1347  if (rs.grid.MapG2B(i).IsAct())
1348  {
1349  bId = rs.grid.MapG2B(i).GetId();
1350  tmpId = bId * np + WIndex;
1351  if (rs.bulk.phaseExist[tmpId])
1352  {
1353  outF << setw(10) << fixed << setprecision(5) << rs.bulk.S[tmpId];
1354  }
1355  else
1356  {
1357  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1358  }
1359  }
1360  else
1361  {
1362  outF << setw(10) << " --- ";
1363  }
1364  }
1365  outF << "\n\n";
1366  }
1367 
1368  // Relative Permeability of OIL
1369  if (KRO && rs.bulk.oil)
1370  {
1371  outF << sep02 << "\n";
1372  outF << "KRO"
1373  << " ";
1374  outF << fixed << setprecision(3) << days << " DAYS";
1375  for (OCP_USI i = 0; i < num; i++)
1376  {
1377  if (i % nx == 0)
1378  outF << "\n";
1379  if (i % (nx * ny) == 0)
1380  outF << "\n\n";
1381 
1382  if (i % nx == 0)
1383  {
1384  rs.grid.GetIJKGrid(I, J, K, i);
1385  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1386  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1387  }
1388 
1389  if (rs.grid.MapG2B(i).IsAct())
1390  {
1391  bId = rs.grid.MapG2B(i).GetId();
1392  tmpId = bId * np + OIndex;
1393  if (rs.bulk.phaseExist[tmpId])
1394  {
1395  outF << setw(10) << fixed << setprecision(5) << rs.bulk.kr[tmpId];
1396  }
1397  else
1398  {
1399  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1400  }
1401  }
1402  else
1403  {
1404  outF << setw(10) << " --- ";
1405  }
1406  }
1407  outF << "\n\n";
1408  }
1409 
1410  // Relative Permeability of GAS
1411  if (KRG && rs.bulk.gas)
1412  {
1413  outF << sep02 << "\n";
1414  outF << "KRG"
1415  << " ";
1416  outF << fixed << setprecision(3) << days << " DAYS";
1417  for (OCP_USI i = 0; i < num; i++)
1418  {
1419  if (i % nx == 0)
1420  outF << "\n";
1421  if (i % (nx * ny) == 0)
1422  outF << "\n\n";
1423 
1424  if (i % nx == 0)
1425  {
1426  rs.grid.GetIJKGrid(I, J, K, i);
1427  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1428  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1429  }
1430 
1431  if (rs.grid.MapG2B(i).IsAct())
1432  {
1433  bId = rs.grid.MapG2B(i).GetId();
1434  tmpId = bId * np + GIndex;
1435  if (rs.bulk.phaseExist[tmpId])
1436  {
1437  outF << setw(10) << fixed << setprecision(5) << rs.bulk.kr[tmpId];
1438  }
1439  else
1440  {
1441  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1442  }
1443  }
1444  else
1445  {
1446  outF << setw(10) << " --- ";
1447  }
1448  }
1449  outF << "\n\n";
1450  }
1451 
1452  // Relative Permeability of WATER
1453  if (KRW && rs.bulk.water)
1454  {
1455  outF << sep02 << "\n";
1456  outF << "KRW"
1457  << " ";
1458  outF << fixed << setprecision(3) << days << " DAYS";
1459  for (OCP_USI i = 0; i < num; i++)
1460  {
1461  if (i % nx == 0)
1462  outF << "\n";
1463  if (i % (nx * ny) == 0)
1464  outF << "\n\n";
1465 
1466  if (i % nx == 0)
1467  {
1468  rs.grid.GetIJKGrid(I, J, K, i);
1469  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1470  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1471  }
1472 
1473  if (rs.grid.MapG2B(i).IsAct())
1474  {
1475  bId = rs.grid.MapG2B(i).GetId();
1476  tmpId = bId * np + WIndex;
1477  if (rs.bulk.phaseExist[tmpId])
1478  {
1479  outF << setw(10) << fixed << setprecision(5) << rs.bulk.kr[tmpId];
1480  }
1481  else
1482  {
1483  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1484  }
1485  }
1486  else
1487  {
1488  outF << setw(10) << " --- ";
1489  }
1490  }
1491  outF << "\n\n";
1492  }
1493 
1494  // Molar Density of OIL
1495  if (BOIL && rs.bulk.oil && rs.bulk.comps)
1496  {
1497  outF << sep02 << "\n";
1498  outF << "BOIL : lb-M/rb"
1499  << " ";
1500  outF << fixed << setprecision(3) << days << " DAYS";
1501  for (OCP_USI i = 0; i < num; i++)
1502  {
1503  if (i % nx == 0)
1504  outF << "\n";
1505  if (i % (nx * ny) == 0)
1506  outF << "\n";
1507 
1508  if (i % nx == 0)
1509  {
1510  rs.grid.GetIJKGrid(I, J, K, i);
1511  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1512  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1513  }
1514 
1515  if (rs.grid.MapG2B(i).IsAct())
1516  {
1517  bId = rs.grid.MapG2B(i).GetId();
1518  tmpId = bId * np + OIndex;
1519  if (rs.bulk.phaseExist[tmpId])
1520  {
1521  outF << setw(10) << fixed << setprecision(5) << rs.bulk.xi[tmpId] * CONV1;
1522  }
1523  else
1524  {
1525  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1526  }
1527  }
1528  else
1529  {
1530  outF << setw(10) << " --- ";
1531  }
1532  }
1533  outF << "\n\n";
1534  }
1535 
1536  // Molar Density of GAS
1537  if (BGAS && rs.bulk.gas && rs.bulk.comps)
1538  {
1539  outF << sep02 << "\n";
1540  outF << "BGAS : lb-M/rb"
1541  << " ";
1542  outF << fixed << setprecision(3) << days << " DAYS";
1543  for (OCP_USI i = 0; i < num; i++)
1544  {
1545  if (i % nx == 0)
1546  outF << "\n";
1547  if (i % (nx * ny) == 0)
1548  outF << "\n\n";
1549 
1550  if (i % nx == 0)
1551  {
1552  rs.grid.GetIJKGrid(I, J, K, i);
1553  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1554  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1555  }
1556 
1557  if (rs.grid.MapG2B(i).IsAct())
1558  {
1559  bId = rs.grid.MapG2B(i).GetId();
1560  tmpId = bId * np + GIndex;
1561  if (rs.bulk.phaseExist[tmpId])
1562  {
1563  outF << setw(10) << fixed << setprecision(5) << rs.bulk.xi[tmpId] * CONV1;
1564  }
1565  else
1566  {
1567  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1568  }
1569  }
1570  else
1571  {
1572  outF << setw(10) << " --- ";
1573  }
1574  }
1575  outF << "\n\n";
1576  }
1577 
1578  // Molar Density of WATER
1579  if (BWAT && rs.bulk.water)
1580  {
1581  outF << sep02 << "\n";
1582  outF << "BWAT : lb-M/rb"
1583  << " ";
1584  outF << fixed << setprecision(3) << days << " DAYS";
1585  for (OCP_USI i = 0; i < num; i++)
1586  {
1587  if (i % nx == 0)
1588  outF << "\n";
1589  if (i % (nx * ny) == 0)
1590  outF << "\n\n";
1591 
1592  if (i % nx == 0)
1593  {
1594  rs.grid.GetIJKGrid(I, J, K, i);
1595  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1596  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1597  }
1598 
1599  if (rs.grid.MapG2B(i).IsAct())
1600  {
1601  bId = rs.grid.MapG2B(i).GetId();
1602  tmpId = bId * np + WIndex;
1603  if (rs.bulk.phaseExist[tmpId])
1604  {
1605  outF << setw(10) << fixed << setprecision(5) << rs.bulk.xi[tmpId] * (CONV1 * 19.437216);
1606  }
1607  else
1608  {
1609  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1610  }
1611  }
1612  else
1613  {
1614  outF << setw(10) << " --- ";
1615  }
1616  }
1617  outF << "\n\n";
1618  }
1619 
1620  // Viscosity of OIL
1621  if (VOIL && rs.bulk.oil)
1622  {
1623  outF << sep02 << "\n";
1624  outF << "VOIL : cp"
1625  << " ";
1626  outF << fixed << setprecision(3) << days << " DAYS";
1627  for (OCP_USI i = 0; i < num; i++)
1628  {
1629  if (i % nx == 0)
1630  outF << "\n";
1631  if (i % (nx * ny) == 0)
1632  outF << "\n\n";
1633 
1634  if (i % nx == 0)
1635  {
1636  rs.grid.GetIJKGrid(I, J, K, i);
1637  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1638  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1639  }
1640 
1641  if (rs.grid.MapG2B(i).IsAct())
1642  {
1643  bId = rs.grid.MapG2B(i).GetId();
1644  tmpId = bId * np + OIndex;
1645  if (rs.bulk.phaseExist[tmpId])
1646  {
1647  outF << setw(10) << fixed << setprecision(5) << rs.bulk.mu[tmpId];
1648  }
1649  else
1650  {
1651  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1652  }
1653  }
1654  else
1655  {
1656  outF << setw(10) << " --- ";
1657  }
1658  }
1659  outF << "\n\n";
1660  }
1661 
1662  // Viscosity of GAS
1663  if (VGAS && rs.bulk.gas)
1664  {
1665  outF << sep02 << "\n";
1666  outF << "VGAS : cp"
1667  << " ";
1668  outF << fixed << setprecision(3) << days << " DAYS";
1669  for (OCP_USI i = 0; i < num; i++)
1670  {
1671  if (i % nx == 0)
1672  outF << "\n";
1673  if (i % (nx * ny) == 0)
1674  outF << "\n\n";
1675 
1676  if (i % nx == 0)
1677  {
1678  rs.grid.GetIJKGrid(I, J, K, i);
1679  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1680  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1681  }
1682 
1683  if (rs.grid.MapG2B(i).IsAct())
1684  {
1685  bId = rs.grid.MapG2B(i).GetId();
1686  tmpId = bId * np + GIndex;
1687  if (rs.bulk.phaseExist[tmpId])
1688  {
1689  outF << setw(10) << fixed << setprecision(5) << rs.bulk.mu[tmpId];
1690  }
1691  else
1692  {
1693  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1694  }
1695  }
1696  else
1697  {
1698  outF << setw(10) << " --- ";
1699  }
1700  }
1701  outF << "\n\n";
1702  }
1703 
1704  // Viscosity of WATER
1705  if (VWAT && rs.bulk.water)
1706  {
1707  outF << sep02 << "\n";
1708  outF << "VWAT : cp"
1709  << " ";
1710  outF << fixed << setprecision(3) << days << " DAYS";
1711  for (OCP_USI i = 0; i < num; i++)
1712  {
1713  if (i % nx == 0)
1714  outF << "\n";
1715  if (i % (nx * ny) == 0)
1716  outF << "\n";
1717 
1718  if (i % nx == 0)
1719  {
1720  rs.grid.GetIJKGrid(I, J, K, i);
1721  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1722  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1723  }
1724 
1725  if (rs.grid.MapG2B(i).IsAct())
1726  {
1727  bId = rs.grid.MapG2B(i).GetId();
1728  tmpId = bId * np + WIndex;
1729  if (rs.bulk.phaseExist[tmpId])
1730  {
1731  outF << setw(10) << fixed << setprecision(5) << rs.bulk.mu[tmpId];
1732  }
1733  else
1734  {
1735  outF << setw(9) << fixed << setprecision(4) << 0.0 << "N";
1736  }
1737  }
1738  else
1739  {
1740  outF << setw(10) << " --- ";
1741  }
1742  }
1743  outF << "\n\n";
1744  }
1745 
1746  // liquid component mole fractions.
1747  if (XMF && rs.bulk.comps) {
1748  for (USI i = 0; i < nc - 1; i++) {
1749  // the ith component
1750  outF << sep02 << "\n";
1751  outF << "XMF : Oil " << i+1 << "th Component"
1752  << " ";
1753  outF << fixed << setprecision(3) << days << " DAYS";
1754 
1755  for (OCP_USI n = 0; n < num; n++) {
1756  if (n % nx == 0) outF << "\n";
1757  if (n % (nx * ny) == 0) outF << "\n";
1758 
1759  if (n % nx == 0) {
1760  rs.grid.GetIJKGrid(I, J, K, n);
1761  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1762  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1763  }
1764 
1765  if (rs.grid.MapG2B(n).IsAct()) {
1766  bId = rs.grid.MapG2B(n).GetId();
1767  tmpId = bId * np + OIndex;
1768  if (rs.bulk.phaseExist[tmpId]) {
1769  tmpId = tmpId * nc + i;
1770  outF << setw(10) << fixed << setprecision(6) << rs.bulk.xij[tmpId];
1771  }
1772  else {
1773  outF << setw(9) << fixed << setprecision(5) << 0.0 << "N";
1774  }
1775  }
1776  else {
1777  outF << setw(10) << " --- ";
1778  }
1779  }
1780  outF << "\n\n";
1781  }
1782  }
1783 
1784  // gas component mole fractions.
1785  if (YMF && rs.bulk.comps) {
1786  for (USI i = 0; i < nc - 1; i++) {
1787  // the ith component
1788  outF << sep02 << "\n";
1789  outF << "YMF : Gas " << i << "th Component"
1790  << " ";
1791  outF << fixed << setprecision(3) << days << " DAYS";
1792 
1793  for (OCP_USI n = 0; n < num; n++) {
1794  if (n % nx == 0) outF << "\n";
1795  if (n % (nx * ny) == 0) outF << "\n";
1796 
1797  if (n % nx == 0) {
1798  rs.grid.GetIJKGrid(I, J, K, n);
1799  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1800  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1801  }
1802 
1803  if (rs.grid.MapG2B(n).IsAct()) {
1804  bId = rs.grid.MapG2B(n).GetId();
1805  tmpId = bId * np + GIndex;
1806  if (rs.bulk.phaseExist[tmpId]) {
1807  tmpId = tmpId * nc + i;
1808  outF << setw(10) << fixed << setprecision(6) << rs.bulk.xij[tmpId];
1809  }
1810  else {
1811  outF << setw(9) << fixed << setprecision(5) << 0.0 << "N";
1812  }
1813  }
1814  else {
1815  outF << setw(10) << " --- ";
1816  }
1817  }
1818  outF << "\n\n";
1819  }
1820  }
1821 
1822  // surface tension
1823  if (rs.bulk.miscible && false)
1824  {
1825  outF << sep02 << "\n";
1826  outF << "STEN"
1827  << " ";
1828  outF << fixed << setprecision(3) << days << " DAYS";
1829  for (OCP_USI i = 0; i < num; i++)
1830  {
1831  if (i % nx == 0)
1832  outF << "\n";
1833  if (i % (nx * ny) == 0)
1834  outF << "\n";
1835 
1836  if (i % nx == 0)
1837  {
1838  rs.grid.GetIJKGrid(I, J, K, i);
1839  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1840  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1841  }
1842 
1843  if (rs.grid.MapG2B(i).IsAct())
1844  {
1845  bId = rs.grid.MapG2B(i).GetId();
1846  outF << setw(10) << fixed << setprecision(5) << rs.bulk.surTen[bId];
1847  }
1848  else
1849  {
1850  outF << setw(10) << " --- ";
1851  }
1852  }
1853  outF << "\n\n";
1854  }
1855 
1856  // Fk
1857  if (rs.bulk.miscible && false)
1858  {
1859  outF << sep02 << "\n";
1860  outF << "FMISC"
1861  << " ";
1862  outF << fixed << setprecision(3) << days << " DAYS";
1863  for (OCP_USI i = 0; i < num; i++)
1864  {
1865  if (i % nx == 0)
1866  outF << "\n";
1867  if (i % (nx * ny) == 0)
1868  outF << "\n";
1869 
1870  if (i % nx == 0)
1871  {
1872  rs.grid.GetIJKGrid(I, J, K, i);
1873  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1874  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1875  }
1876 
1877  if (rs.grid.MapG2B(i).IsAct())
1878  {
1879  bId = rs.grid.MapG2B(i).GetId();
1880  outF << setw(10) << fixed << setprecision(5) << rs.bulk.Fk[bId];
1881  }
1882  else
1883  {
1884  outF << setw(10) << " --- ";
1885  }
1886  }
1887  outF << "\n\n";
1888  }
1889 
1890  // Fp
1891  if (rs.bulk.miscible && false)
1892  {
1893  outF << sep02 << "\n";
1894  outF << "FPC"
1895  << " ";
1896  outF << fixed << setprecision(3) << days << " DAYS";
1897  for (OCP_USI i = 0; i < num; i++)
1898  {
1899  if (i % nx == 0)
1900  outF << "\n";
1901  if (i % (nx * ny) == 0)
1902  outF << "\n";
1903 
1904  if (i % nx == 0)
1905  {
1906  rs.grid.GetIJKGrid(I, J, K, i);
1907  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1908  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1909  }
1910 
1911  if (rs.grid.MapG2B(i).IsAct())
1912  {
1913  bId = rs.grid.MapG2B(i).GetId();
1914  outF << setw(10) << fixed << setprecision(5) << rs.bulk.Fp[bId];
1915  }
1916  else
1917  {
1918  outF << setw(10) << " --- ";
1919  }
1920  }
1921  outF << "\n\n";
1922  }
1923 
1924  // Po - Pw
1925  if (PCW)
1926  {
1927  OCP_DBL tmp = 1.0;
1928 
1929  outF << "PCW : psia"
1930  << " ";
1931  outF << fixed << setprecision(3) << days << " DAYS";
1932  for (OCP_USI i = 0; i < num; i++)
1933  {
1934  if (i % nx == 0)
1935  outF << "\n";
1936  if (i % (nx * ny) == 0)
1937  outF << "\n\n";
1938 
1939  if (i % nx == 0)
1940  {
1941  rs.grid.GetIJKGrid(I, J, K, i);
1942  outF << GetIJKformat("*", to_string(J), to_string(K), tmpsp);
1943  // outF << "(*," << setw(3) << J << "," << setw(3) << K << ")";
1944  }
1945 
1946  if (rs.grid.MapG2B(i).IsAct())
1947  {
1948  bId = rs.grid.MapG2B(i).GetId();
1949  outF << setw(12) << fixed << setprecision(3) << -rs.bulk.Pc[bId * np + WIndex];
1950  }
1951  else
1952  {
1953  outF << setw(12) << "----- ";
1954  }
1955  }
1956  outF << "\n\n\n";
1957  }
1958 
1959 
1960  outF.close();
1961 }
1962 
1963 void OCPOutput::InputParam(const ParamOutput &paramOutput)
1964 {
1965  summary.InputParam(paramOutput.summary);
1966  dtlInfo.InputParam(paramOutput.detailInfo);
1967 }
1968 
1969 void OCPOutput::Setup(const Reservoir &reservoir, const OCPControl &ctrl)
1970 {
1971  wordDir = ctrl.workDir;
1972  summary.Setup(reservoir, ctrl.criticalTime.back());
1973  crtInfo.Setup(ctrl.criticalTime.back());
1974  dtlInfo.Setup(wordDir);
1975 }
1976 
1977 void OCPOutput::SetVal(const Reservoir &reservoir, const OCPControl &ctrl)
1978 {
1979  summary.SetVal(reservoir, ctrl);
1980  crtInfo.SetVal(reservoir, ctrl);
1981 }
1982 
1983 void OCPOutput::PrintInfo() const
1984 {
1985  summary.PrintInfo(wordDir);
1986  crtInfo.PrintInfo(wordDir);
1987 }
1988 
1989 void OCPOutput::PrintInfoSched(const Reservoir &rs, const OCPControl &ctrl,
1990  const OCP_DBL &time) const
1991 {
1992  OCP_DBL days = ctrl.current_time;
1993  cout << "Timestep " << setw(6) << left << ctrl.numTstep
1994  << ": " << fixed << setw(10) << setprecision(3) << right << days << " Days"
1995  << " Wall time: " << time / 1000 << " Sec" << endl;
1996  dtlInfo.PrintInfo(wordDir, rs, days);
1997 }
1998 
1999 /*----------------------------------------------------------------------------*/
2000 /* Brief Change History of This File */
2001 /*----------------------------------------------------------------------------*/
2002 /* Author Date Actions */
2003 /*----------------------------------------------------------------------------*/
2004 /* Shizhe Li Oct/01/2021 Create file */
2005 /* Chensong Zhang Oct/15/2021 Format file */
2006 /* Chensong Zhang Jan/09/2022 Update Doxygen */
2007 /*----------------------------------------------------------------------------*/
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
const USI GAS
Fluid type = gas.
Definition: OCPConst.hpp:83
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:26
const OCP_DBL CONV1
1 bbl = CONV1 ft3
Definition: OCPConst.hpp:59
const USI WATER
Fluid type = water.
Definition: OCPConst.hpp:84
const USI OIL
Fluid type = oil.
Definition: OCPConst.hpp:82
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:24
const bool OPEN
Well type = open.
Definition: OCPConst.hpp:111
const USI PROD
Well type = producer.
Definition: OCPConst.hpp:108
const USI INJ
Well type = injector.
Definition: OCPConst.hpp:107
OCPOutput class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
OCP_DBL GetWGIR(const USI &w) const
Return gas injection rate of the wth well.
Definition: AllWells.hpp:175
OCP_DBL GetWGIT(const USI &w) const
Return total gas injection of the wth well.
Definition: AllWells.hpp:177
OCP_DBL GetFWPT() const
Return total water production in field.
Definition: AllWells.hpp:153
OCP_DBL GetFWIR() const
Return water injection rate in field.
Definition: AllWells.hpp:159
OCP_DBL GetFGPT() const
Return total gas production in field.
Definition: AllWells.hpp:149
OCP_DBL GetWWIR(const USI &w) const
Return water injection rate of the wth well.
Definition: AllWells.hpp:179
OCP_DBL GetWWPR(const USI &w) const
Return water production rate of the wth well.
Definition: AllWells.hpp:171
OCP_DBL GetWWIT(const USI &w) const
Return total water injection of the wth well.
Definition: AllWells.hpp:181
OCP_DBL GetWGPR(const USI &w) const
Return gas production rate of the wth well.
Definition: AllWells.hpp:167
string GetWellName(const USI &i) const
Return the name of specified well.
Definition: AllWells.hpp:131
OCP_DBL GetFWPR() const
Return water production rate in field.
Definition: AllWells.hpp:151
OCP_DBL GetWBHP(const USI &w) const
Return the BHP of wth well.
Definition: AllWells.hpp:183
OCP_DBL GetFWIT() const
Return total water injection in field.
Definition: AllWells.hpp:161
OCP_DBL GetFGIT() const
Return gas water injection in field.
Definition: AllWells.hpp:157
OCP_DBL GetWOPT(const USI &w) const
Return total oil production of the wth well.
Definition: AllWells.hpp:165
OCP_DBL GetFOPT() const
Return total oil production in field.
Definition: AllWells.hpp:145
OCP_DBL GetWGPT(const USI &w) const
Return total gas production of the wth well.
Definition: AllWells.hpp:169
OCP_DBL GetWWPT(const USI &w) const
Return total water production of the wth well.
Definition: AllWells.hpp:173
USI GetWellPerfNum(const USI &i) const
Return the num of perforations of well i.
Definition: AllWells.hpp:135
OCP_DBL GetWellDg(const USI &w, const USI &p) const
Return the pth dG of wth well.
Definition: AllWells.hpp:190
OCP_DBL GetWOPR(const USI &w) const
Return oil production rate of the wth well.
Definition: AllWells.hpp:163
USI GetIndex(const string &name) const
Return the index of specified well.
Definition: AllWells.cpp:379
OCP_DBL GetFGPR() const
Return gas production rate in field.
Definition: AllWells.hpp:147
USI GetWellNum() const
Return the num of wells.
Definition: AllWells.hpp:129
OCP_DBL GetFGIR() const
Return gas injection rate in field.
Definition: AllWells.hpp:155
OCP_DBL GetFOPR() const
Return oil production rate in field.
Definition: AllWells.hpp:143
OCP_DBL GetdVmax() const
Return dVmax.
Definition: Bulk.hpp:178
OCP_DBL GetSOIL(const OCP_USI &n) const
Return oil saturation of the n-th bulk.
Definition: Bulk.hpp:157
OCP_DBL GetSWAT(const OCP_USI &n) const
Return water saturation of the n-th bulk.
Definition: Bulk.hpp:167
OCP_DBL GetSGAS(const OCP_USI &n) const
Return gas saturation of the n-th bulk.
Definition: Bulk.hpp:162
OCP_DBL GetdSmax() const
Return dSmax.
Definition: Bulk.hpp:176
OCP_DBL GetdNmax() const
Return dNmax.
Definition: Bulk.hpp:174
OCP_DBL GetdPmax() const
Return dPmax.
Definition: Bulk.hpp:172
OCP_DBL CalFPR() const
Calculate average pressure in reservoir.
Definition: Bulk.cpp:1974
OCP_DBL GetP(const OCP_USI &n) const
Return pressure of the n-th bulk.
Definition: Bulk.hpp:155
void SetVal(const Reservoir &reservoir, const OCPControl &ctrl)
TODO: Add Doxygen.
Definition: OCPOutput.cpp:677
void PrintInfo(const string &dir) const
TODO: Add Doxygen.
Definition: OCPOutput.cpp:688
void Setup(const OCP_DBL &totalTime)
TODO: Add Doxygen.
Definition: OCPOutput.cpp:664
bool IsAct() const
Return whether this cell is active or not.
Definition: Grid.hpp:59
OCP_USI GetId() const
Return the index of this cell among active cells.
Definition: Grid.hpp:62
OCP_USI GetGridNy() const
Return ny of grid cell.
Definition: Grid.hpp:113
const GB_Pair & MapG2B(const OCP_USI &i) const
Mapping from grid cells to bulks (active cells).
Definition: Grid.hpp:109
OCP_USI GetActIndex(const USI &i, const USI &j, const USI &k) const
Return the index of active cell (i, j, k).
Definition: Grid.cpp:328
OCP_USI GetGridNum() const
Return the num of grid cells.
Definition: Grid.hpp:117
void GetIJKGrid(USI &i, USI &j, USI &k, const OCP_USI &n) const
Return the 3D coordinate for object grid with Grid index.
Definition: Grid.cpp:346
OCP_USI GetGridNx() const
Return nx of grid cell.
Definition: Grid.hpp:111
All control parameters except for well controlers.
Definition: OCPControl.hpp:94
OCP_DBL GetLastDt() const
Return last dt.
Definition: OCPControl.hpp:136
USI GetLSiterT() const
Return the total number of linear iterations.
Definition: OCPControl.hpp:142
OCP_DBL GetCurTime() const
Return the current time.
Definition: OCPControl.hpp:130
USI GetNRiterT() const
Return the total nubmer of Newton iterations.
Definition: OCPControl.hpp:148
vector< USI > index
Records the index of bulk or well, whose properties will be printed.
Definition: OCPOutput.hpp:71
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.
OutputSummary summary
See OutputSummary.
The SumPair class is an auxiliary structure storing summary data to output.
Definition: OCPOutput.hpp:76
void Setup(const Reservoir &reservoir, const OCP_DBL &totalTime)
TODO: Add Doxygen.
Definition: OCPOutput.cpp:50
void SetVal(const Reservoir &reservoir, const OCPControl &ctrl)
TODO: Add Doxygen.
Definition: OCPOutput.cpp:454
void PrintInfo(const string &dir) const
Write output information to a file.
Definition: OCPOutput.cpp:578
void InputParam(const OutputSummary &summary_param)
TODO: Add Doxygen.
Definition: OCPOutput.cpp:14