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;
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;
39 WBHP = summary_param.
WBHP;
40 DG = summary_param.
DG;
42 BPR = summary_param.
BPR;
43 SOIL = summary_param.
SOIL;
44 SGAS = summary_param.
SGAS;
45 SWAT = summary_param.
SWAT;
52 Sumdata.push_back(
SumPair(
"TIME",
" ",
"DAY"));
53 Sumdata.push_back(
SumPair(
"NRiter",
" ",
" "));
54 Sumdata.push_back(
SumPair(
"LSiter",
" ",
" "));
56 Sumdata.push_back(
SumPair(
"FPR",
" ",
"PSIA"));
58 Sumdata.push_back(
SumPair(
"FOPR",
" ",
"STB/DAY"));
60 Sumdata.push_back(
SumPair(
"FOPT",
" ",
"STB"));
62 Sumdata.push_back(
SumPair(
"FGPR",
" ",
"MSCF/DAY"));
64 Sumdata.push_back(
SumPair(
"FGPT",
" ",
"MSCF"));
66 Sumdata.push_back(
SumPair(
"FWPR",
" ",
"STB/DAY"));
68 Sumdata.push_back(
SumPair(
"FWPT",
" ",
"STB"));
70 Sumdata.push_back(
SumPair(
"FGIR",
" ",
"MSCF/DAY"));
72 Sumdata.push_back(
SumPair(
"FGIT",
" ",
"MSCF"));
74 Sumdata.push_back(
SumPair(
"FWIR",
" ",
"STB/DAY"));
76 Sumdata.push_back(
SumPair(
"FWIT",
" ",
"STB"));
78 const USI sp = reservoir.grid.GetNumDigitIJK();
86 if (WOPR.obj[0] ==
"All")
89 for (
USI w = 0; w < wellnum; w++)
92 WOPR.obj.push_back(wellname);
93 Sumdata.push_back(
SumPair(
"WOPR", wellname,
"STB/DAY"));
94 WOPR.
index.push_back(w);
99 num = WOPR.obj.size();
100 for (
USI w = 0; w < num; w++)
102 Sumdata.push_back(
SumPair(
"WOPR", WOPR.obj[w],
"STB/DAY"));
103 WOPR.
index.push_back(reservoir.allWells.
GetIndex(WOPR.obj[w]));
110 if (WOPT.obj[0] ==
"All")
113 for (
USI w = 0; w < wellnum; w++)
116 WOPT.obj.push_back(wellname);
117 Sumdata.push_back(
SumPair(
"WOPT", wellname,
"STB"));
118 WOPT.
index.push_back(w);
123 num = WOPT.obj.size();
124 for (
USI w = 0; w < num; w++)
126 Sumdata.push_back(
SumPair(
"WOPT", WOPT.obj[w],
"STB"));
127 WOPT.
index.push_back(reservoir.allWells.
GetIndex(WOPT.obj[w]));
134 if (WGPR.obj[0] ==
"All")
137 for (
USI w = 0; w < wellnum; w++)
140 WGPR.obj.push_back(wellname);
141 Sumdata.push_back(
SumPair(
"WGPR", wellname,
"MSCF/DAY"));
142 WGPR.
index.push_back(w);
147 num = WGPR.obj.size();
148 for (
USI w = 0; w < num; w++)
150 Sumdata.push_back(
SumPair(
"WGPR", WGPR.obj[w],
"MSCF/DAY"));
151 WGPR.
index.push_back(reservoir.allWells.
GetIndex(WGPR.obj[w]));
158 if (WGPT.obj[0] ==
"All")
161 for (
USI w = 0; w < wellnum; w++)
164 WGPT.obj.push_back(wellname);
165 Sumdata.push_back(
SumPair(
"WGPT", wellname,
"MSCF"));
166 WGPT.
index.push_back(w);
171 num = WGPT.obj.size();
172 for (
USI w = 0; w < num; w++)
174 Sumdata.push_back(
SumPair(
"WGPT", WGPT.obj[w],
"MSCF"));
175 WGPT.
index.push_back(reservoir.allWells.
GetIndex(WGPT.obj[w]));
182 if (WWPR.obj[0] ==
"All")
185 for (
USI w = 0; w < wellnum; w++)
188 WWPR.obj.push_back(wellname);
189 Sumdata.push_back(
SumPair(
"WWPR", wellname,
"STB/DAY"));
190 WWPR.
index.push_back(w);
195 num = WWPR.obj.size();
196 for (
USI w = 0; w < num; w++)
198 Sumdata.push_back(
SumPair(
"WWPR", WWPR.obj[w],
"STB/DAY"));
199 WWPR.
index.push_back(reservoir.allWells.
GetIndex(WWPR.obj[w]));
206 if (WWPT.obj[0] ==
"All")
209 for (
USI w = 0; w < wellnum; w++)
212 WWPT.obj.push_back(wellname);
213 Sumdata.push_back(
SumPair(
"WWPT", wellname,
"STB"));
214 WWPT.
index.push_back(w);
219 num = WWPT.obj.size();
220 for (
USI w = 0; w < num; w++)
222 Sumdata.push_back(
SumPair(
"WWPT", WWPT.obj[w],
"STB"));
223 WWPT.
index.push_back(reservoir.allWells.
GetIndex(WWPT.obj[w]));
230 if (WGIR.obj[0] ==
"All")
233 for (
USI w = 0; w < wellnum; w++)
236 WGIR.obj.push_back(wellname);
237 Sumdata.push_back(
SumPair(
"WGIR", wellname,
"MSCF/DAY"));
238 WGIR.
index.push_back(w);
243 num = WGIR.obj.size();
244 for (
USI w = 0; w < num; w++)
246 Sumdata.push_back(
SumPair(
"WGIR", WGIR.obj[w],
"MSCF/DAY"));
247 WGIR.
index.push_back(reservoir.allWells.
GetIndex(WGIR.obj[w]));
254 if (WGIT.obj[0] ==
"All")
257 for (
USI w = 0; w < wellnum; w++)
260 WGIT.obj.push_back(wellname);
261 Sumdata.push_back(
SumPair(
"WGIT", wellname,
"MSCF"));
262 WGIT.
index.push_back(w);
267 num = WGIT.obj.size();
268 for (
USI w = 0; w < num; w++)
270 Sumdata.push_back(
SumPair(
"WGIT", WGIT.obj[w],
"MSCF"));
271 WGIT.
index.push_back(reservoir.allWells.
GetIndex(WGIT.obj[w]));
278 if (WWIR.obj[0] ==
"All")
281 for (
USI w = 0; w < wellnum; w++)
284 WWIR.obj.push_back(wellname);
285 Sumdata.push_back(
SumPair(
"WWIR", wellname,
"STB/DAY"));
286 WWIR.
index.push_back(w);
291 num = WWIR.obj.size();
292 for (
USI w = 0; w < num; w++)
294 Sumdata.push_back(
SumPair(
"WWIR", WWIR.obj[w],
"STB/DAY"));
295 WWIR.
index.push_back(reservoir.allWells.
GetIndex(WWIR.obj[w]));
302 if (WWIT.obj[0] ==
"All")
305 for (
USI w = 0; w < wellnum; w++)
308 WWIT.obj.push_back(wellname);
309 Sumdata.push_back(
SumPair(
"WWIT", wellname,
"STB"));
310 WWIT.
index.push_back(w);
315 num = WWIT.obj.size();
316 for (
USI w = 0; w < num; w++)
318 Sumdata.push_back(
SumPair(
"WWIT", WWIT.obj[w],
"STB"));
319 WWIT.
index.push_back(reservoir.allWells.
GetIndex(WWIT.obj[w]));
326 if (WBHP.obj[0] ==
"All")
329 for (
USI w = 0; w < wellnum; w++)
332 WBHP.obj.push_back(wellname);
333 Sumdata.push_back(
SumPair(
"WBHP", wellname,
"PSIA"));
334 WBHP.
index.push_back(w);
339 num = WBHP.obj.size();
340 for (
USI w = 0; w < num; w++)
342 Sumdata.push_back(
SumPair(
"WBHP", WBHP.obj[w],
"PSIA"));
343 WBHP.
index.push_back(reservoir.allWells.
GetIndex(WBHP.obj[w]));
350 if (DG.obj[0] ==
"All")
353 for (
USI w = 0; w < wellnum; w++)
355 string wellname = reservoir.allWells.
GetWellName(w);
356 DG.obj.push_back(wellname);
358 for (
USI p = 0; p < perfnum; p++)
361 SumPair(
"DG", wellname +
" Perf" + to_string(p),
"PSIA"));
362 DG.
index.push_back(w);
369 for (
USI w = 0; w < num; w++)
373 for (
USI p = 0; p < perfnum; p++)
376 SumPair(
"DG", DG.obj[w] +
" P" + to_string(p),
"PSIA"));
377 DG.
index.push_back(wId);
385 num = BPR.obj.size();
386 for (
USI i = 0; i < num; i++)
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;
400 num = SOIL.obj.size();
401 for (
USI i = 0; i < num; i++)
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;
415 num = SGAS.obj.size();
416 for (
USI i = 0; i < num; i++)
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;
430 num = SWAT.obj.size();
431 for (
USI i = 0; i < num; i++)
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;
444 USI rs = totalTime / 0.1;
445 USI cs = Sumdata.size();
446 for (
USI i = 0; i < cs; i++)
448 Sumdata[i].val.reserve(rs);
459 Sumdata[n++].val.push_back(ctrl.
GetCurTime());
461 Sumdata[n++].val.push_back(ctrl.
GetNRiterT());
463 Sumdata[n++].val.push_back(ctrl.
GetLSiterT());
467 Sumdata[n++].val.push_back(rs.bulk.
CalFPR());
469 Sumdata[n++].val.push_back(rs.allWells.
GetFOPR());
471 Sumdata[n++].val.push_back(rs.allWells.
GetFOPT());
473 Sumdata[n++].val.push_back(rs.allWells.
GetFGPR());
475 Sumdata[n++].val.push_back(rs.allWells.
GetFGPT());
477 Sumdata[n++].val.push_back(rs.allWells.
GetFWPR());
479 Sumdata[n++].val.push_back(rs.allWells.
GetFWPT());
481 Sumdata[n++].val.push_back(rs.allWells.
GetFGIR());
483 Sumdata[n++].val.push_back(rs.allWells.
GetFGIT());
485 Sumdata[n++].val.push_back(rs.allWells.
GetFWIR());
487 Sumdata[n++].val.push_back(rs.allWells.
GetFWIT());
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]));
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]));
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]));
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]));
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]));
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]));
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]));
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]));
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]));
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]));
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]));
547 for (
USI w = 0; w < len; w++)
550 for (
USI p = 0; p < numperf; p++)
552 Sumdata[n++].val.push_back(rs.allWells.
GetWellDg(DG.
index[w], p));
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]));
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]));
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]));
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]));
580 string FileOut = dir +
"SUMMARY.out";
581 ofstream outF(FileOut);
590 USI num = Sumdata.size();
591 USI len = Sumdata[0].val.size();
598 outF <<
"Row " << ++row << endl;
602 outF <<
"\t" << setw(ns) << Sumdata[0].Item;
605 for (
USI i = 1; i < col; i++)
607 outF <<
"\t" << setw(ns) << Sumdata[
id++].Item;
615 outF <<
"\t" << setw(ns) << Sumdata[0].Unit;
618 for (
USI i = 1; i < col; i++)
620 outF <<
"\t" << setw(ns) << Sumdata[
id++].Unit;
628 outF <<
"\t" << setw(ns) << Sumdata[0].Obj;
631 for (
USI i = 1; i < col; i++)
633 outF <<
"\t" << setw(ns) << Sumdata[
id++].Obj;
640 for (
USI l = 0; l < len; l++)
644 outF <<
"\t" << setw(ns) << Sumdata[0].val[l];
647 for (
USI i = 1; i < col; i++)
649 outF <<
"\t" << setw(ns) << Sumdata[
id++].val[l];
667 USI rc = totalTime / 0.1;
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);
690 string FileOut = dir +
"FastReview.out";
691 ofstream outF(FileOut);
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";
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";
715 for (
USI i = 0; i < n; i++)
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];
730 void DetailInfo::InputParam(
const OutputDetail &detail_param)
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;
755 void DetailInfo::Setup(
const string &dir)
757 string FileOut = dir +
"RPT.out";
758 ofstream outF(FileOut);
766 void DetailInfo::PrintInfo(
const string &dir,
const Reservoir &rs,
769 string FileOut = dir +
"RPT.out";
771 outF.open(FileOut, ios::app);
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];
785 const USI tmpsp = rs.grid.GetNumDigitIJK();
790 const string sep01(50,
'=');
791 const string sep02(50,
'-');
793 outF << sep01 <<
"\n";
795 static bool flag =
false;
800 for (
OCP_USI i = 0; i < num; i++)
804 if (i % (nx * ny) == 0)
810 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
817 outF << setw(12) << fixed << setprecision(5) << rs.bulk.dx[bId];
821 outF << setw(12) <<
"----- ";
830 for (
OCP_USI i = 0; i < num; i++)
834 if (i % (nx * ny) == 0)
840 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
847 outF << setw(12) << fixed << setprecision(5) << rs.bulk.dy[bId];
851 outF << setw(12) <<
"----- ";
860 for (
OCP_USI i = 0; i < num; i++)
864 if (i % (nx * ny) == 0)
870 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
877 outF << setw(12) << fixed << setprecision(5) << rs.bulk.dz[bId];
881 outF << setw(12) <<
"----- ";
889 outF <<
"Depth : feet";
890 for (
OCP_USI i = 0; i < num; i++)
894 if (i % (nx * ny) == 0)
900 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
907 outF << setw(12) << fixed << setprecision(1) << rs.bulk.depth[bId];
911 outF << setw(12) <<
"----- ";
919 outF <<
"PERMX : MDarcy";
920 for (
OCP_USI i = 0; i < num; i++)
924 if (i % (nx * ny) == 0)
930 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
937 outF << setw(12) << fixed << setprecision(5) << rs.bulk.rockKxInit[bId];
941 outF << setw(12) <<
"----- ";
949 outF <<
"PERMY : MDarcy";
950 for (
OCP_USI i = 0; i < num; i++)
954 if (i % (nx * ny) == 0)
960 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
967 outF << setw(12) << fixed << setprecision(5) << rs.bulk.rockKyInit[bId];
971 outF << setw(12) <<
"----- ";
979 outF <<
"PERMZ : MDarcy";
980 for (
OCP_USI i = 0; i < num; i++)
984 if (i % (nx * ny) == 0)
990 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
997 outF << setw(12) << fixed << setprecision(5) << rs.bulk.rockKzInit[bId];
1001 outF << setw(12) <<
"----- ";
1012 outF <<
"Well Information" <<
" ";
1013 outF << fixed << setprecision(3) << days <<
" DAYS" << endl;
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;
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;
1027 outF <<
"SHUTIN" << endl;
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) {
1042 outF <<
" " << rs.allWells.wells[w].perf[p].location << endl;
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;
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;
1059 outF <<
"SHUTIN" << endl;
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) {
1074 outF <<
" " << rs.allWells.wells[w].perf[p].location << endl;
1079 outF << endl << endl;
1086 outF <<
"PRESSURE : psia"
1088 outF << fixed << setprecision(3) << days <<
" DAYS";
1089 for (
OCP_USI i = 0; i < num; i++)
1093 if (i % (nx * ny) == 0)
1099 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1106 outF << setw(12) << fixed << setprecision(3) << rs.bulk.P[bId];
1110 outF << setw(12) <<
"----- ";
1117 if (DENO && rs.bulk.oil)
1119 outF << sep02 <<
"\n";
1120 outF <<
"DENO : lb/ft3"
1122 outF << fixed << setprecision(3) << days <<
" DAYS";
1123 for (
OCP_USI i = 0; i < num; i++)
1127 if (i % (nx * ny) == 0)
1133 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1140 tmpId = bId * np + OIndex;
1141 if (rs.bulk.phaseExist[tmpId])
1143 outF << setw(10) << fixed << setprecision(3) << rs.bulk.rho[tmpId];
1147 outF << setw(9) << fixed << setprecision(2) << 0.0 <<
"N";
1152 outF << setw(10) <<
" --- ";
1159 if (DENG && rs.bulk.gas)
1161 outF << sep02 <<
"\n";
1162 outF <<
"DENG : lb/ft3"
1164 outF << fixed << setprecision(3) << days <<
" DAYS";
1165 for (
OCP_USI i = 0; i < num; i++)
1169 if (i % (nx * ny) == 0)
1175 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1182 tmpId = bId * np + GIndex;
1183 if (rs.bulk.phaseExist[tmpId])
1185 outF << setw(10) << fixed << setprecision(3) << rs.bulk.rho[tmpId];
1189 outF << setw(9) << fixed << setprecision(2) << 0.0 <<
"N";
1194 outF << setw(10) <<
" --- ";
1201 if (DENW && rs.bulk.water)
1203 outF << sep02 <<
"\n";
1204 outF <<
"DENW : lb/ft3"
1206 outF << fixed << setprecision(3) << days <<
" DAYS";
1207 for (
OCP_USI i = 0; i < num; i++)
1211 if (i % (nx * ny) == 0)
1217 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1224 tmpId = bId * np + WIndex;
1225 if (rs.bulk.phaseExist[tmpId])
1227 outF << setw(10) << fixed << setprecision(3) << rs.bulk.rho[tmpId];
1231 outF << setw(9) << fixed << setprecision(2) << 0.0 <<
"N";
1236 outF << setw(10) <<
" --- ";
1243 if (SOIL && rs.bulk.oil)
1245 outF << sep02 <<
"\n";
1248 outF << fixed << setprecision(3) << days <<
" DAYS";
1249 for (
OCP_USI i = 0; i < num; i++)
1253 if (i % (nx * ny) == 0)
1259 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1266 tmpId = bId * np + OIndex;
1267 if (rs.bulk.phaseExist[tmpId])
1269 outF << setw(10) << fixed << setprecision(5) << rs.bulk.S[tmpId];
1273 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1278 outF << setw(10) <<
" --- ";
1285 if (SGAS && rs.bulk.gas)
1287 outF << sep02 <<
"\n";
1290 outF << fixed << setprecision(3) << days <<
" DAYS";
1291 for (
OCP_USI i = 0; i < num; i++)
1295 if (i % (nx * ny) == 0)
1301 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1308 tmpId = bId * np + GIndex;
1309 if (rs.bulk.phaseExist[tmpId])
1311 outF << setw(10) << fixed << setprecision(5) << rs.bulk.S[tmpId];
1315 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1320 outF << setw(10) <<
" --- ";
1327 if (SWAT && rs.bulk.water)
1329 outF << sep02 <<
"\n";
1332 outF << fixed << setprecision(3) << days <<
" DAYS";
1333 for (
OCP_USI i = 0; i < num; i++)
1337 if (i % (nx * ny) == 0)
1343 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1350 tmpId = bId * np + WIndex;
1351 if (rs.bulk.phaseExist[tmpId])
1353 outF << setw(10) << fixed << setprecision(5) << rs.bulk.S[tmpId];
1357 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1362 outF << setw(10) <<
" --- ";
1369 if (KRO && rs.bulk.oil)
1371 outF << sep02 <<
"\n";
1374 outF << fixed << setprecision(3) << days <<
" DAYS";
1375 for (
OCP_USI i = 0; i < num; i++)
1379 if (i % (nx * ny) == 0)
1385 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1392 tmpId = bId * np + OIndex;
1393 if (rs.bulk.phaseExist[tmpId])
1395 outF << setw(10) << fixed << setprecision(5) << rs.bulk.kr[tmpId];
1399 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1404 outF << setw(10) <<
" --- ";
1411 if (KRG && rs.bulk.gas)
1413 outF << sep02 <<
"\n";
1416 outF << fixed << setprecision(3) << days <<
" DAYS";
1417 for (
OCP_USI i = 0; i < num; i++)
1421 if (i % (nx * ny) == 0)
1427 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1434 tmpId = bId * np + GIndex;
1435 if (rs.bulk.phaseExist[tmpId])
1437 outF << setw(10) << fixed << setprecision(5) << rs.bulk.kr[tmpId];
1441 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1446 outF << setw(10) <<
" --- ";
1453 if (KRW && rs.bulk.water)
1455 outF << sep02 <<
"\n";
1458 outF << fixed << setprecision(3) << days <<
" DAYS";
1459 for (
OCP_USI i = 0; i < num; i++)
1463 if (i % (nx * ny) == 0)
1469 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1476 tmpId = bId * np + WIndex;
1477 if (rs.bulk.phaseExist[tmpId])
1479 outF << setw(10) << fixed << setprecision(5) << rs.bulk.kr[tmpId];
1483 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1488 outF << setw(10) <<
" --- ";
1495 if (BOIL && rs.bulk.oil && rs.bulk.comps)
1497 outF << sep02 <<
"\n";
1498 outF <<
"BOIL : lb-M/rb"
1500 outF << fixed << setprecision(3) << days <<
" DAYS";
1501 for (
OCP_USI i = 0; i < num; i++)
1505 if (i % (nx * ny) == 0)
1511 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1518 tmpId = bId * np + OIndex;
1519 if (rs.bulk.phaseExist[tmpId])
1521 outF << setw(10) << fixed << setprecision(5) << rs.bulk.xi[tmpId] *
CONV1;
1525 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1530 outF << setw(10) <<
" --- ";
1537 if (BGAS && rs.bulk.gas && rs.bulk.comps)
1539 outF << sep02 <<
"\n";
1540 outF <<
"BGAS : lb-M/rb"
1542 outF << fixed << setprecision(3) << days <<
" DAYS";
1543 for (
OCP_USI i = 0; i < num; i++)
1547 if (i % (nx * ny) == 0)
1553 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1560 tmpId = bId * np + GIndex;
1561 if (rs.bulk.phaseExist[tmpId])
1563 outF << setw(10) << fixed << setprecision(5) << rs.bulk.xi[tmpId] *
CONV1;
1567 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1572 outF << setw(10) <<
" --- ";
1579 if (BWAT && rs.bulk.water)
1581 outF << sep02 <<
"\n";
1582 outF <<
"BWAT : lb-M/rb"
1584 outF << fixed << setprecision(3) << days <<
" DAYS";
1585 for (
OCP_USI i = 0; i < num; i++)
1589 if (i % (nx * ny) == 0)
1595 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1602 tmpId = bId * np + WIndex;
1603 if (rs.bulk.phaseExist[tmpId])
1605 outF << setw(10) << fixed << setprecision(5) << rs.bulk.xi[tmpId] * (
CONV1 * 19.437216);
1609 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1614 outF << setw(10) <<
" --- ";
1621 if (VOIL && rs.bulk.oil)
1623 outF << sep02 <<
"\n";
1626 outF << fixed << setprecision(3) << days <<
" DAYS";
1627 for (
OCP_USI i = 0; i < num; i++)
1631 if (i % (nx * ny) == 0)
1637 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1644 tmpId = bId * np + OIndex;
1645 if (rs.bulk.phaseExist[tmpId])
1647 outF << setw(10) << fixed << setprecision(5) << rs.bulk.mu[tmpId];
1651 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1656 outF << setw(10) <<
" --- ";
1663 if (VGAS && rs.bulk.gas)
1665 outF << sep02 <<
"\n";
1668 outF << fixed << setprecision(3) << days <<
" DAYS";
1669 for (
OCP_USI i = 0; i < num; i++)
1673 if (i % (nx * ny) == 0)
1679 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1686 tmpId = bId * np + GIndex;
1687 if (rs.bulk.phaseExist[tmpId])
1689 outF << setw(10) << fixed << setprecision(5) << rs.bulk.mu[tmpId];
1693 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1698 outF << setw(10) <<
" --- ";
1705 if (VWAT && rs.bulk.water)
1707 outF << sep02 <<
"\n";
1710 outF << fixed << setprecision(3) << days <<
" DAYS";
1711 for (
OCP_USI i = 0; i < num; i++)
1715 if (i % (nx * ny) == 0)
1721 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1728 tmpId = bId * np + WIndex;
1729 if (rs.bulk.phaseExist[tmpId])
1731 outF << setw(10) << fixed << setprecision(5) << rs.bulk.mu[tmpId];
1735 outF << setw(9) << fixed << setprecision(4) << 0.0 <<
"N";
1740 outF << setw(10) <<
" --- ";
1747 if (XMF && rs.bulk.comps) {
1748 for (
USI i = 0; i < nc - 1; i++) {
1750 outF << sep02 <<
"\n";
1751 outF <<
"XMF : Oil " << i+1 <<
"th Component"
1753 outF << fixed << setprecision(3) << days <<
" DAYS";
1755 for (
OCP_USI n = 0; n < num; n++) {
1756 if (n % nx == 0) outF <<
"\n";
1757 if (n % (nx * ny) == 0) outF <<
"\n";
1761 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
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];
1773 outF << setw(9) << fixed << setprecision(5) << 0.0 <<
"N";
1777 outF << setw(10) <<
" --- ";
1785 if (YMF && rs.bulk.comps) {
1786 for (
USI i = 0; i < nc - 1; i++) {
1788 outF << sep02 <<
"\n";
1789 outF <<
"YMF : Gas " << i <<
"th Component"
1791 outF << fixed << setprecision(3) << days <<
" DAYS";
1793 for (
OCP_USI n = 0; n < num; n++) {
1794 if (n % nx == 0) outF <<
"\n";
1795 if (n % (nx * ny) == 0) outF <<
"\n";
1799 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
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];
1811 outF << setw(9) << fixed << setprecision(5) << 0.0 <<
"N";
1815 outF << setw(10) <<
" --- ";
1823 if (rs.bulk.miscible &&
false)
1825 outF << sep02 <<
"\n";
1828 outF << fixed << setprecision(3) << days <<
" DAYS";
1829 for (
OCP_USI i = 0; i < num; i++)
1833 if (i % (nx * ny) == 0)
1839 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1846 outF << setw(10) << fixed << setprecision(5) << rs.bulk.surTen[bId];
1850 outF << setw(10) <<
" --- ";
1857 if (rs.bulk.miscible &&
false)
1859 outF << sep02 <<
"\n";
1862 outF << fixed << setprecision(3) << days <<
" DAYS";
1863 for (
OCP_USI i = 0; i < num; i++)
1867 if (i % (nx * ny) == 0)
1873 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1880 outF << setw(10) << fixed << setprecision(5) << rs.bulk.Fk[bId];
1884 outF << setw(10) <<
" --- ";
1891 if (rs.bulk.miscible &&
false)
1893 outF << sep02 <<
"\n";
1896 outF << fixed << setprecision(3) << days <<
" DAYS";
1897 for (
OCP_USI i = 0; i < num; i++)
1901 if (i % (nx * ny) == 0)
1907 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1914 outF << setw(10) << fixed << setprecision(5) << rs.bulk.Fp[bId];
1918 outF << setw(10) <<
" --- ";
1929 outF <<
"PCW : psia"
1931 outF << fixed << setprecision(3) << days <<
" DAYS";
1932 for (
OCP_USI i = 0; i < num; i++)
1936 if (i % (nx * ny) == 0)
1942 outF << GetIJKformat(
"*", to_string(J), to_string(K), tmpsp);
1949 outF << setw(12) << fixed << setprecision(3) << -rs.bulk.Pc[bId * np + WIndex];
1953 outF << setw(12) <<
"----- ";
1963 void OCPOutput::InputParam(
const ParamOutput ¶mOutput)
1971 wordDir = ctrl.workDir;
1972 summary.
Setup(reservoir, ctrl.criticalTime.back());
1973 crtInfo.
Setup(ctrl.criticalTime.back());
1974 dtlInfo.Setup(wordDir);
1979 summary.
SetVal(reservoir, ctrl);
1980 crtInfo.
SetVal(reservoir, ctrl);
1983 void OCPOutput::PrintInfo()
const
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);
unsigned int USI
Generic unsigned integer.
const USI GAS
Fluid type = gas.
double OCP_DBL
Double precision.
const OCP_DBL CONV1
1 bbl = CONV1 ft3
const USI WATER
Fluid type = water.
const USI OIL
Fluid type = oil.
unsigned int OCP_USI
Long unsigned integer.
const bool OPEN
Well type = open.
const USI PROD
Well type = producer.
const USI INJ
Well type = injector.
OCPOutput class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
OCP_DBL GetWGIR(const USI &w) const
Return gas injection rate of the wth well.
OCP_DBL GetWGIT(const USI &w) const
Return total gas injection of the wth well.
OCP_DBL GetFWPT() const
Return total water production in field.
OCP_DBL GetFWIR() const
Return water injection rate in field.
OCP_DBL GetFGPT() const
Return total gas production in field.
OCP_DBL GetWWIR(const USI &w) const
Return water injection rate of the wth well.
OCP_DBL GetWWPR(const USI &w) const
Return water production rate of the wth well.
OCP_DBL GetWWIT(const USI &w) const
Return total water injection of the wth well.
OCP_DBL GetWGPR(const USI &w) const
Return gas production rate of the wth well.
string GetWellName(const USI &i) const
Return the name of specified well.
OCP_DBL GetFWPR() const
Return water production rate in field.
OCP_DBL GetWBHP(const USI &w) const
Return the BHP of wth well.
OCP_DBL GetFWIT() const
Return total water injection in field.
OCP_DBL GetFGIT() const
Return gas water injection in field.
OCP_DBL GetWOPT(const USI &w) const
Return total oil production of the wth well.
OCP_DBL GetFOPT() const
Return total oil production in field.
OCP_DBL GetWGPT(const USI &w) const
Return total gas production of the wth well.
OCP_DBL GetWWPT(const USI &w) const
Return total water production of the wth well.
USI GetWellPerfNum(const USI &i) const
Return the num of perforations of well i.
OCP_DBL GetWellDg(const USI &w, const USI &p) const
Return the pth dG of wth well.
OCP_DBL GetWOPR(const USI &w) const
Return oil production rate of the wth well.
USI GetIndex(const string &name) const
Return the index of specified well.
OCP_DBL GetFGPR() const
Return gas production rate in field.
USI GetWellNum() const
Return the num of wells.
OCP_DBL GetFGIR() const
Return gas injection rate in field.
OCP_DBL GetFOPR() const
Return oil production rate in field.
OCP_DBL GetdVmax() const
Return dVmax.
OCP_DBL GetSOIL(const OCP_USI &n) const
Return oil saturation of the n-th bulk.
OCP_DBL GetSWAT(const OCP_USI &n) const
Return water saturation of the n-th bulk.
OCP_DBL GetSGAS(const OCP_USI &n) const
Return gas saturation of the n-th bulk.
OCP_DBL GetdSmax() const
Return dSmax.
OCP_DBL GetdNmax() const
Return dNmax.
OCP_DBL GetdPmax() const
Return dPmax.
OCP_DBL CalFPR() const
Calculate average pressure in reservoir.
OCP_DBL GetP(const OCP_USI &n) const
Return pressure of the n-th bulk.
void SetVal(const Reservoir &reservoir, const OCPControl &ctrl)
TODO: Add Doxygen.
void PrintInfo(const string &dir) const
TODO: Add Doxygen.
void Setup(const OCP_DBL &totalTime)
TODO: Add Doxygen.
bool IsAct() const
Return whether this cell is active or not.
OCP_USI GetId() const
Return the index of this cell among active cells.
OCP_USI GetGridNy() const
Return ny of grid cell.
const GB_Pair & MapG2B(const OCP_USI &i) const
Mapping from grid cells to bulks (active cells).
OCP_USI GetActIndex(const USI &i, const USI &j, const USI &k) const
Return the index of active cell (i, j, k).
OCP_USI GetGridNum() const
Return the num of grid cells.
void GetIJKGrid(USI &i, USI &j, USI &k, const OCP_USI &n) const
Return the 3D coordinate for object grid with Grid index.
OCP_USI GetGridNx() const
Return nx of grid cell.
All control parameters except for well controlers.
OCP_DBL GetLastDt() const
Return last dt.
USI GetLSiterT() const
Return the total number of linear iterations.
OCP_DBL GetCurTime() const
Return the current time.
USI GetNRiterT() const
Return the total nubmer of Newton iterations.
vector< USI > index
Records the index of bulk or well, whose properties will be printed.
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.
bool DENW
Water density of grids.
bool VWAT
Water viscosity of grids.
bool XMF
liquid component mole fractions.
bool PGAS
Gas pressure of grids.
bool PWAT
Water pressure of grids.
bool PCW
capilary pressure: Po - Pw.
bool SGAS
Gas saturation of grids.
bool KRW
Water relative permeability of grids.
bool SOIL
Oil saturation of grids.
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.
Type_A_o WWIR
Well water injection rate.
Type_B_o SOIL
Oil saturation of bulk.
bool FWPR
Field water production rate.
bool FGPR
Field gas production rate.
Type_A_o WGPR
Well gas production rate.
bool FWIR
Field water injection rate.
bool FPR
Field average Pressure.
Type_A_o DG
Pressure difference between wells and perforations.
Type_A_o WOPT
Well total oil production rate.
Type_A_o WGPT
Well total gas production.
Type_A_o WWPT
Well total water production.
bool FWIT
Field total water injection.
Type_B_o BPR
Bulk pressure.
Type_B_o SWAT
Water saturation of bulk.
Type_A_o WOPR
Well oil production rate.
bool FGIR
Field gas injection rate.
Type_A_o WGIR
Well gas injection rate.
Type_B_o SGAS
Gas saturation of bulk.
Type_A_o WGIT
Well total gas injection.
bool FOPT
Field total oil production.
bool FOPR
Field oil production rate.
Type_A_o WBHP
Well pressure.
bool FWPT
Field total water production.
Type_A_o WWIT
Well total water injection.
Type_A_o WWPR
Well water production rate.
bool FGPt
Field total gas production.
OutputDetail detailInfo
See OutputDetail.
OutputSummary summary
See OutputSummary.
The SumPair class is an auxiliary structure storing summary data to output.
void Setup(const Reservoir &reservoir, const OCP_DBL &totalTime)
TODO: Add Doxygen.
void SetVal(const Reservoir &reservoir, const OCPControl &ctrl)
TODO: Add Doxygen.
void PrintInfo(const string &dir) const
Write output information to a file.
void InputParam(const OutputSummary &summary_param)
TODO: Add Doxygen.