16 FPR = summary_param.
FPR;
17 FTR = summary_param.
FTR;
18 FOPR = summary_param.
FOPR;
19 FOPT = summary_param.
FOPT;
20 FGPR = summary_param.
FGPR;
21 FGPt = summary_param.
FGPt;
22 FWPR = summary_param.
FWPR;
23 FWPT = summary_param.
FWPT;
24 FGIR = summary_param.
FGIR;
25 FGIT = summary_param.
FGIT;
26 FWIR = summary_param.
FWIR;
27 FWIT = summary_param.
FWIT;
29 WOPR = summary_param.
WOPR;
30 WOPT = summary_param.
WOPT;
31 WGPR = summary_param.
WGPR;
32 WGPT = summary_param.
WGPT;
33 WWPR = summary_param.
WWPR;
34 WWPT = summary_param.
WWPT;
35 WGIR = summary_param.
WGIR;
36 WGIT = summary_param.
WGIT;
37 WWIR = summary_param.
WWIR;
38 WWIT = summary_param.
WWIT;
40 WBHP = summary_param.
WBHP;
41 DG = summary_param.
DG;
43 BPR = summary_param.
BPR;
44 SOIL = summary_param.
SOIL;
45 SGAS = summary_param.
SGAS;
46 SWAT = summary_param.
SWAT;
53 Sumdata.push_back(
SumItem(
"TIME",
" ",
"DAY",
"fixed"));
54 Sumdata.push_back(
SumItem(
"NRiter",
" ",
" ",
"int"));
55 Sumdata.push_back(
SumItem(
"LSiter",
" ",
" ",
"int"));
56 if (FPR) Sumdata.push_back(
SumItem(
"FPR",
" ",
"PSIA",
"float"));
57 if (FTR) Sumdata.push_back(
SumItem(
"FTR",
" ",
"F",
"float"));
58 if (FOPR) Sumdata.push_back(
SumItem(
"FOPR",
" ",
"STB/DAY",
"float"));
59 if (FOPT) Sumdata.push_back(
SumItem(
"FOPT",
" ",
"STB",
"float"));
60 if (FGPR) Sumdata.push_back(
SumItem(
"FGPR",
" ",
"MSCF/DAY",
"float"));
61 if (FGPt) Sumdata.push_back(
SumItem(
"FGPT",
" ",
"MSCF",
"float"));
62 if (FWPR) Sumdata.push_back(
SumItem(
"FWPR",
" ",
"STB/DAY",
"float"));
63 if (FWPT) Sumdata.push_back(
SumItem(
"FWPT",
" ",
"STB",
"float"));
64 if (FGIR) Sumdata.push_back(
SumItem(
"FGIR",
" ",
"MSCF/DAY",
"float"));
65 if (FGIT) Sumdata.push_back(
SumItem(
"FGIT",
" ",
"MSCF",
"float"));
66 if (FWIR) Sumdata.push_back(
SumItem(
"FWIR",
" ",
"STB/DAY",
"float"));
67 if (FWIT) Sumdata.push_back(
SumItem(
"FWIT",
" ",
"STB",
"float"));
79 if (WOPR.obj[0] ==
"All") {
81 for (
USI w = 0; w < wellnum; w++) {
83 WOPR.obj.push_back(wellname);
84 Sumdata.push_back(
SumItem(
"WOPR", wellname,
"STB/DAY",
"float"));
85 WOPR.
index.push_back(w);
88 num = WOPR.obj.size();
89 for (
USI w = 0; w < num; w++) {
90 Sumdata.push_back(
SumItem(
"WOPR", WOPR.obj[w],
"STB/DAY",
"float"));
97 if (WOPT.obj[0] ==
"All") {
99 for (
USI w = 0; w < wellnum; w++) {
101 WOPT.obj.push_back(wellname);
102 Sumdata.push_back(
SumItem(
"WOPT", wellname,
"STB",
"float"));
103 WOPT.
index.push_back(w);
106 num = WOPT.obj.size();
107 for (
USI w = 0; w < num; w++) {
108 Sumdata.push_back(
SumItem(
"WOPT", WOPT.obj[w],
"STB",
"float"));
115 if (WGPR.obj[0] ==
"All") {
117 for (
USI w = 0; w < wellnum; w++) {
119 WGPR.obj.push_back(wellname);
120 Sumdata.push_back(
SumItem(
"WGPR", wellname,
"MSCF/DAY",
"float"));
121 WGPR.
index.push_back(w);
124 num = WGPR.obj.size();
125 for (
USI w = 0; w < num; w++) {
126 Sumdata.push_back(
SumItem(
"WGPR", WGPR.obj[w],
"MSCF/DAY",
"float"));
133 if (WGPT.obj[0] ==
"All") {
135 for (
USI w = 0; w < wellnum; w++) {
137 WGPT.obj.push_back(wellname);
138 Sumdata.push_back(
SumItem(
"WGPT", wellname,
"MSCF",
"float"));
139 WGPT.
index.push_back(w);
142 num = WGPT.obj.size();
143 for (
USI w = 0; w < num; w++) {
144 Sumdata.push_back(
SumItem(
"WGPT", WGPT.obj[w],
"MSCF",
"float"));
151 if (WWPR.obj[0] ==
"All") {
153 for (
USI w = 0; w < wellnum; w++) {
155 WWPR.obj.push_back(wellname);
156 Sumdata.push_back(
SumItem(
"WWPR", wellname,
"STB/DAY",
"float"));
157 WWPR.
index.push_back(w);
160 num = WWPR.obj.size();
161 for (
USI w = 0; w < num; w++) {
162 Sumdata.push_back(
SumItem(
"WWPR", WWPR.obj[w],
"STB/DAY",
"float"));
169 if (WWPT.obj[0] ==
"All") {
171 for (
USI w = 0; w < wellnum; w++) {
173 WWPT.obj.push_back(wellname);
174 Sumdata.push_back(
SumItem(
"WWPT", wellname,
"STB",
"float"));
175 WWPT.
index.push_back(w);
178 num = WWPT.obj.size();
179 for (
USI w = 0; w < num; w++) {
180 Sumdata.push_back(
SumItem(
"WWPT", WWPT.obj[w],
"STB",
"float"));
187 if (WGIR.obj[0] ==
"All") {
189 for (
USI w = 0; w < wellnum; w++) {
191 WGIR.obj.push_back(wellname);
192 Sumdata.push_back(
SumItem(
"WGIR", wellname,
"MSCF/DAY",
"float"));
193 WGIR.
index.push_back(w);
196 num = WGIR.obj.size();
197 for (
USI w = 0; w < num; w++) {
198 Sumdata.push_back(
SumItem(
"WGIR", WGIR.obj[w],
"MSCF/DAY",
"float"));
205 if (WGIT.obj[0] ==
"All") {
207 for (
USI w = 0; w < wellnum; w++) {
209 WGIT.obj.push_back(wellname);
210 Sumdata.push_back(
SumItem(
"WGIT", wellname,
"MSCF",
"float"));
211 WGIT.
index.push_back(w);
214 num = WGIT.obj.size();
215 for (
USI w = 0; w < num; w++) {
216 Sumdata.push_back(
SumItem(
"WGIT", WGIT.obj[w],
"MSCF",
"float"));
223 if (WWIR.obj[0] ==
"All") {
225 for (
USI w = 0; w < wellnum; w++) {
227 WWIR.obj.push_back(wellname);
228 Sumdata.push_back(
SumItem(
"WWIR", wellname,
"STB/DAY",
"float"));
229 WWIR.
index.push_back(w);
232 num = WWIR.obj.size();
233 for (
USI w = 0; w < num; w++) {
234 Sumdata.push_back(
SumItem(
"WWIR", WWIR.obj[w],
"STB/DAY",
"float"));
241 if (WWIT.obj[0] ==
"All") {
243 for (
USI w = 0; w < wellnum; w++) {
245 WWIT.obj.push_back(wellname);
246 Sumdata.push_back(
SumItem(
"WWIT", wellname,
"STB",
"float"));
247 WWIT.
index.push_back(w);
250 num = WWIT.obj.size();
251 for (
USI w = 0; w < num; w++) {
252 Sumdata.push_back(
SumItem(
"WWIT", WWIT.obj[w],
"STB",
"float"));
259 if (WBHP.obj[0] ==
"All") {
261 for (
USI w = 0; w < wellnum; w++) {
263 WBHP.obj.push_back(wellname);
264 Sumdata.push_back(
SumItem(
"WBHP", wellname,
"PSIA",
"float"));
265 WBHP.
index.push_back(w);
268 num = WBHP.obj.size();
269 for (
USI w = 0; w < num; w++) {
270 Sumdata.push_back(
SumItem(
"WBHP", WBHP.obj[w],
"PSIA",
"float"));
277 if (DG.obj[0] ==
"All") {
279 for (
USI w = 0; w < wellnum; w++) {
281 DG.obj.push_back(wellname);
283 for (
USI p = 0; p < perfnum; p++) {
284 Sumdata.push_back(
SumItem(
"DG", wellname +
" Perf" + to_string(p),
286 DG.
index.push_back(w);
291 for (
USI w = 0; w < num; w++) {
294 for (
USI p = 0; p < perfnum; p++) {
295 Sumdata.push_back(
SumItem(
"DG", DG.obj[w] +
" P" + to_string(p),
297 DG.
index.push_back(wId);
304 num = BPR.obj.size();
305 for (
USI i = 0; i < num; i++) {
306 string temp = GetIJKformat(to_string(BPR.obj[i].I), to_string(BPR.obj[i].J),
307 to_string(BPR.obj[i].K), sp);
308 Sumdata.push_back(
SumItem(
"BPR", temp,
"PSIA",
"float"));
309 USI I = BPR.obj[i].I - 1;
310 USI J = BPR.obj[i].J - 1;
311 USI K = BPR.obj[i].K - 1;
313 const OCP_INT tarId = initGrid.GetActIndex(I, J, K);
315 OCP_WARNING(
"Non Fluid Grid: " + GetIJKformat(I + 1, J + 1, K + 1, sp) +
316 "in BPR in SUMMARY");
318 BPR.
index.push_back(tarId);
323 num = SOIL.obj.size();
324 for (
USI i = 0; i < num; i++) {
326 GetIJKformat(to_string(SOIL.obj[i].I), to_string(SOIL.obj[i].J),
327 to_string(SOIL.obj[i].K), sp);
328 Sumdata.push_back(
SumItem(
"SOIL", temp,
" ",
"float"));
329 USI I = SOIL.obj[i].I - 1;
330 USI J = SOIL.obj[i].J - 1;
331 USI K = SOIL.obj[i].K - 1;
333 const OCP_INT tarId = initGrid.GetActIndex(I, J, K);
335 OCP_WARNING(
"Non Fluid Grid: " + GetIJKformat(I + 1, J + 1, K + 1, sp) +
336 "in SOIL in SUMMARY");
338 SOIL.
index.push_back(tarId);
343 num = SGAS.obj.size();
344 for (
USI i = 0; i < num; i++) {
346 GetIJKformat(to_string(SGAS.obj[i].I), to_string(SGAS.obj[i].J),
347 to_string(SGAS.obj[i].K), sp);
348 Sumdata.push_back(
SumItem(
"SGAS", temp,
" ",
"float"));
349 USI I = SGAS.obj[i].I - 1;
350 USI J = SGAS.obj[i].J - 1;
351 USI K = SGAS.obj[i].K - 1;
353 const OCP_INT tarId = initGrid.GetActIndex(I, J, K);
355 OCP_WARNING(
"Non Fluid Grid: " + GetIJKformat(I + 1, J + 1, K + 1, sp) +
356 "in SOIL in SUMMARY");
358 SGAS.
index.push_back(tarId);
363 num = SWAT.obj.size();
364 for (
USI i = 0; i < num; i++) {
366 GetIJKformat(to_string(SWAT.obj[i].I), to_string(SWAT.obj[i].J),
367 to_string(SWAT.obj[i].K), sp);
368 Sumdata.push_back(
SumItem(
"SWAT", temp,
" ",
"float"));
369 USI I = SWAT.obj[i].I - 1;
370 USI J = SWAT.obj[i].J - 1;
371 USI K = SWAT.obj[i].K - 1;
373 const OCP_INT tarId = initGrid.GetActIndex(I, J, K);
375 OCP_WARNING(
"Non Fluid Grid: " + GetIJKformat(I + 1, J + 1, K + 1, sp) +
376 "in SWAT in SUMMARY");
378 SWAT.
index.push_back(tarId);
383 const USI maxRowNum = totalTime / 0.1;
384 const USI cs = Sumdata.size();
385 for (
USI i = 0; i < cs; i++) {
386 Sumdata[i].val.reserve(maxRowNum);
400 Sumdata[n++].val.push_back(ctrl.
GetCurTime());
402 Sumdata[n++].val.push_back(ctrl.
GetNRiterT());
404 Sumdata[n++].val.push_back(ctrl.
GetLSiterT());
407 if (FPR) Sumdata[n++].val.push_back(bulk.
CalFPR());
408 if (FTR) Sumdata[n++].val.push_back(bulk.
CalFTR());
409 if (FOPR) Sumdata[n++].val.push_back(wells.
GetFOPR());
410 if (FOPT) Sumdata[n++].val.push_back(wells.
GetFOPT());
411 if (FGPR) Sumdata[n++].val.push_back(wells.
GetFGPR());
412 if (FGPt) Sumdata[n++].val.push_back(wells.
GetFGPT());
413 if (FWPR) Sumdata[n++].val.push_back(wells.
GetFWPR());
414 if (FWPT) Sumdata[n++].val.push_back(wells.
GetFWPT());
415 if (FGIR) Sumdata[n++].val.push_back(wells.
GetFGIR());
416 if (FGIT) Sumdata[n++].val.push_back(wells.
GetFGIT());
417 if (FWIR) Sumdata[n++].val.push_back(wells.
GetFWIR());
418 if (FWIT) Sumdata[n++].val.push_back(wells.
GetFWIT());
422 len = WOPR.
index.size();
423 for (
USI w = 0; w < len; w++)
424 Sumdata[n++].val.push_back(wells.
GetWOPR(WOPR.
index[w]));
427 len = WOPT.
index.size();
428 for (
USI w = 0; w < len; w++)
429 Sumdata[n++].val.push_back(wells.
GetWOPT(WOPT.
index[w]));
432 len = WGPR.
index.size();
433 for (
USI w = 0; w < len; w++)
434 Sumdata[n++].val.push_back(wells.
GetWGPR(WGPR.
index[w]));
437 len = WGPT.
index.size();
438 for (
USI w = 0; w < len; w++)
439 Sumdata[n++].val.push_back(wells.
GetWGPT(WGPT.
index[w]));
442 len = WWPR.
index.size();
443 for (
USI w = 0; w < len; w++)
444 Sumdata[n++].val.push_back(wells.
GetWWPR(WWPR.
index[w]));
447 len = WWPT.
index.size();
448 for (
USI w = 0; w < len; w++)
449 Sumdata[n++].val.push_back(wells.
GetWWPT(WWPT.
index[w]));
452 len = WGIR.
index.size();
453 for (
USI w = 0; w < len; w++)
454 Sumdata[n++].val.push_back(wells.
GetWGIR(WGIR.
index[w]));
457 len = WGIT.
index.size();
458 for (
USI w = 0; w < len; w++)
459 Sumdata[n++].val.push_back(wells.
GetWGIT(WGIT.
index[w]));
462 len = WWIR.
index.size();
463 for (
USI w = 0; w < len; w++)
464 Sumdata[n++].val.push_back(wells.
GetWWIR(WWIR.
index[w]));
467 len = WWIT.
index.size();
468 for (
USI w = 0; w < len; w++)
469 Sumdata[n++].val.push_back(wells.
GetWWIT(WWIT.
index[w]));
472 len = WBHP.
index.size();
473 for (
USI w = 0; w < len; w++)
474 Sumdata[n++].val.push_back(wells.
GetWBHP(WBHP.
index[w]));
478 for (
USI w = 0; w < len; w++) {
480 for (
USI p = 0; p < numperf; p++) {
486 len = BPR.
index.size();
487 for (
USI i = 0; i < len; i++) Sumdata[n++].val.push_back(bulk.
GetP(BPR.
index[i]));
490 len = SOIL.
index.size();
491 for (
USI i = 0; i < len; i++)
492 Sumdata[n++].val.push_back(bulk.
GetSOIL(SOIL.
index[i]));
495 len = SGAS.
index.size();
496 for (
USI i = 0; i < len; i++)
497 Sumdata[n++].val.push_back(bulk.
GetSGAS(SGAS.
index[i]));
500 len = SWAT.
index.size();
501 for (
USI i = 0; i < len; i++)
502 Sumdata[n++].val.push_back(bulk.
GetSWAT(SWAT.
index[i]));
508 string FileOut = dir +
"SUMMARY.out";
509 ofstream outF(FileOut);
510 if (!outF.is_open()) {
516 const USI num = Sumdata.size();
517 const USI len = Sumdata[0].val.size();
525 outF <<
"Row " << ++row <<
"\n";
528 outF <<
"\t" << setw(ns) << Sumdata[0].Item;
531 for (
USI i = 1; i < col; i++) {
532 outF <<
"\t" << setw(ns) << Sumdata[
id++].Item;
533 if (
id == num)
break;
538 outF <<
"\t" << setw(ns) << Sumdata[0].Unit;
541 for (
USI i = 1; i < col; i++) {
542 outF <<
"\t" << setw(ns) << Sumdata[
id++].Unit;
543 if (
id == num)
break;
548 outF <<
"\t" << setw(ns) << Sumdata[0].Obj;
551 for (
USI i = 1; i < col; i++) {
552 outF <<
"\t" << setw(ns) << Sumdata[
id++].Obj;
553 if (
id == num)
break;
558 for (
USI l = 0; l < len; l++) {
561 outF <<
"\t" << setw(ns) << fixed << setprecision(3) << Sumdata[0].val[l];
564 for (
USI i = 1; i < col; i++) {
565 if (Sumdata[
id].Type ==
"int") {
566 outF << fixed << setprecision(0);
567 }
else if (Sumdata[
id].Type ==
"fixed") {
568 outF << fixed << setprecision(3);
569 }
else if (Sumdata[
id].Type ==
"float") {
570 outF << scientific << setprecision(5);
572 outF <<
"\t" << setw(ns) << Sumdata[
id++].val[l];
573 if (
id == num)
break;
589 USI rc = totalTime / 0.1;
614 string FileOut = dir +
"FastReview.out";
617 ofstream outF(FileOut);
618 if (!outF.is_open()) {
623 outF << setw(ns) <<
"Time";
624 outF << setw(ns) <<
"dt";
625 outF << setw(ns) <<
"dPmax";
626 outF << setw(ns) <<
"dVmax";
627 outF << setw(ns) <<
"dSmax";
628 outF << setw(ns) <<
"dNmax";
629 outF << setw(ns) <<
"CFL" << endl;
631 outF << setw(ns) <<
"Days";
632 outF << setw(ns) <<
"Days";
633 outF << setw(ns) <<
"Psia";
634 outF << setw(ns) <<
" ";
635 outF << setw(ns) <<
" ";
636 outF << setw(ns) <<
" ";
637 outF << setw(ns) <<
" " << endl;
640 for (
USI i = 0; i < n; i++) {
641 outF << setw(ns) << fixed << setprecision(3) << time[i];
642 outF << setw(ns) << fixed << setprecision(3) << dt[i];
643 outF << setw(ns) << scientific << setprecision(3) << dPmax[i];
644 outF << setw(ns) << scientific << setprecision(3) << dVmax[i];
645 outF << setw(ns) << scientific << setprecision(3) << dSmax[i];
646 outF << setw(ns) << scientific << setprecision(3) << dNmax[i];
647 outF << setw(ns) << scientific << setprecision(3) << cfl[i];
681 useRPT = RPTparam.useRPT;
684 bgp.SetBasicGridProperty(RPTparam.bgp);
687 void Out4RPT::Setup(
const string& dir,
const Reservoir& rs)
691 string FileOut = dir +
"RPT.out";
692 ofstream outF(FileOut);
693 if (!outF.is_open()) {
706 void Out4RPT::PrintRPT(
const string& dir,
713 string FileOut = dir +
"RPT.out";
715 outRPT.open(FileOut, ios::app);
716 if (!outRPT.is_open()) {
728 const vector<GB_Pair>& g2bp = initGrid.
map_All2Act;
730 outRPT << OCP_SEP02(50) <<
"\n";
734 outRPT <<
"Well Information"
736 outRPT << fixed << setprecision(3) << days <<
" DAYS"
739 for (
USI w = 0; w < numWell; w++) {
741 outRPT <<
"-------------------------------------"
748 outRPT <<
"OPEN\t" << rs.
allWells.
wells[w].WGIR <<
" (MSCF/DAY)\t"
757 outRPT <<
"perf" << p <<
" " << rs.
allWells.
wells[w].perf[p].I
766 outRPT <<
" " << rs.
allWells.
wells[w].perf[p].location <<
"\n";
771 for (
USI w = 0; w < numWell; w++) {
773 outRPT <<
"-------------------------------------"
780 outRPT <<
"OPEN\t" << rs.
allWells.
wells[w].WOPR <<
" (STB/DAY)\t"
790 outRPT <<
"perf" << p <<
" " << rs.
allWells.
wells[w].perf[p].I
799 outRPT <<
" " << rs.
allWells.
wells[w].perf[p].location <<
"\n";
809 PrintRPT_Scalar(outRPT,
"DX : feet", days, &initGrid.
dx[0], 1, g2bp, OCP_FALSE);
810 PrintRPT_Scalar(outRPT,
"DY : feet", days, &initGrid.
dy[0], 1, g2bp, OCP_FALSE);
811 PrintRPT_Scalar(outRPT,
"DZ : feet", days, &initGrid.
dz[0], 1, g2bp, OCP_FALSE);
812 PrintRPT_Scalar(outRPT,
"Depth : feet", days, &initGrid.
depth[0], 1, g2bp,
814 PrintRPT_Scalar(outRPT,
"PERMX : MDarcy", days, &initGrid.
kx[0], 1, g2bp,
816 PrintRPT_Scalar(outRPT,
"PERMY : MDarcy", days, &initGrid.
ky[0], 1, g2bp,
818 PrintRPT_Scalar(outRPT,
"PERMZ : MDarcy", days, &initGrid.
kz[0], 1, g2bp,
825 PrintRPT_Scalar(outRPT,
"PRESSURE : psia", days, &bulk.
P[0], 1, g2bp, OCP_TRUE);
829 if (bgp.DENO && bulk.
oil) {
830 PrintRPT_Scalar(outRPT,
"DENO : lb/ft3", days, &bulk.
rho[OIndex], np, g2bp,
836 if (bgp.DENG && bulk.
gas) {
837 PrintRPT_Scalar(outRPT,
"DENG : lb/ft3", days, &bulk.
rho[GIndex], np, g2bp,
842 if (bgp.DENW && bulk.
water) {
843 PrintRPT_Scalar(outRPT,
"DENW : lb/ft3", days, &bulk.
rho[WIndex], np, g2bp,
848 if (bgp.SOIL && bulk.
oil) {
849 PrintRPT_Scalar(outRPT,
"SOIL ", days, &bulk.
S[OIndex], np, g2bp,
854 if (bgp.SGAS && bulk.
gas) {
855 PrintRPT_Scalar(outRPT,
"SGAS ", days, &bulk.
S[GIndex], np, g2bp,
860 if (bgp.SWAT && bulk.
water) {
861 PrintRPT_Scalar(outRPT,
"SWAT ", days, &bulk.
S[WIndex], np, g2bp,
866 if (bgp.KRO && bulk.
oil) {
867 PrintRPT_Scalar(outRPT,
"KRO ", days, &bulk.
kr[OIndex], np, g2bp,
872 if (bgp.KRG && bulk.
gas) {
873 PrintRPT_Scalar(outRPT,
"KRG ", days, &bulk.
kr[GIndex], np, g2bp,
878 if (bgp.KRW && bulk.
water) {
879 PrintRPT_Scalar(outRPT,
"KRW ", days, &bulk.
kr[WIndex], np, g2bp,
885 PrintRPT_Scalar(outRPT,
"BOIL : lb-M/rb", days, &bulk.
xi[OIndex], np, g2bp,
891 PrintRPT_Scalar(outRPT,
"BGAS : lb-M/rb", days, &bulk.
xi[GIndex], np, g2bp,
896 if (bgp.BWAT && bulk.
water) {
897 PrintRPT_Scalar(outRPT,
"BWAT : lb-M/rb", days, &bulk.
xi[WIndex], np, g2bp,
898 OCP_TRUE, (
CONV1 * 19.437216));
902 if (bgp.VOIL && bulk.
oil) {
903 PrintRPT_Scalar(outRPT,
"VOIL : lb-M/rb", days, &bulk.
mu[OIndex], np, g2bp,
908 if (bgp.VGAS && bulk.
gas) {
909 PrintRPT_Scalar(outRPT,
"VGAS : lb-M/rb", days, &bulk.
mu[GIndex], np, g2bp,
914 if (bgp.VWAT && bulk.
water) {
915 PrintRPT_Scalar(outRPT,
"VWAT : lb-M/rb", days, &bulk.
mu[WIndex], np, g2bp,
921 for (
USI i = 0; i < nc - 1; i++) {
922 PrintRPT_Scalar(outRPT,
"XMF : Oil " + to_string(i + 1) +
"th Component",
923 days, &bulk.
xij[OIndex * nc + i], np * nc, g2bp, OCP_TRUE);
929 for (
USI i = 0; i < nc - 1; i++) {
930 PrintRPT_Scalar(outRPT,
"YMF : Gas " + to_string(i + 1) +
"th Component",
931 days, &bulk.
xij[GIndex * nc + i], np * nc, g2bp, OCP_TRUE);
937 PrintRPT_Scalar(outRPT,
"PCW : psia ", days, &bulk.
Pc[WIndex], np, g2bp,
952 k = n / (nx * ny) + 1;
953 j = (n - (k - 1) * nx * ny) / nx + 1;
954 i = n - (k - 1) * nx * ny - (j - 1) * nx + 1;
959 useVTK = VTKParam.useVTK;
962 bgp.SetBasicGridProperty(VTKParam.bgp);
965 void Out4VTK::Setup(
const string& dir,
const Reservoir& rs,
const USI& ndates)
969 string file = dir +
"grid" + to_string(index) +
".vtk";
971 string title =
"test";
975 out4vtk.
Init(file, title, VTK_ASCII, VTK_UNSTRUCTURED_GRID,
981 out4vtk.BeginCellData();
984 out4vtk.OutputCELL_DATA_SCALARS(file,
"CellType", VTK_UNSIGNED_INT,
986 OCP_FALSE, &tmpW[0]);
988 for (
USI i = 1; i < ndates; i++) {
990 newfile = dir +
"grid" + to_string(index) +
".vtk";
992 ifstream source(file, ios::binary);
993 ofstream dest(newfile, ios::binary);
994 dest << source.rdbuf();
1001 metisTest.Setup(rs);
1005 void Out4VTK::PrintVTK(
const string& dir,
1009 if (!useVTK)
return;
1011 string file = dir +
"grid" + to_string(index) +
".vtk";
1017 const vector<GB_Pair>& g2bp = initGrid.
map_All2Act;
1018 const vector<OCP_DBL>& well = rs.
allWells.wellVal;
1026 out4vtk.OutputCELL_DATA_SCALARS(file,
"PRESSURE", VTK_FLOAT, &bulk.
P[0], 1,
1027 g2bp, OCP_TRUE, &well[0]);
1029 out4vtk.OutputCELL_DATA_SCALARS(file,
"SOIL", VTK_FLOAT, &bulk.
S[OIndex], np,
1030 g2bp, OCP_TRUE, &well[0]);
1032 out4vtk.OutputCELL_DATA_SCALARS(file,
"SGAS", VTK_FLOAT, &bulk.
S[GIndex], np,
1033 g2bp, OCP_TRUE, &well[0]);
1035 out4vtk.OutputCELL_DATA_SCALARS(file,
"SWAT", VTK_FLOAT, &bulk.
S[WIndex], np,
1036 g2bp, OCP_TRUE, &well[0]);
1039 if (metisTest.useMetis) {
1042 metisTest.vwgt.resize(metisTest.nvtxs, 1);
1044 metisTest.MyPartitionFunc(METIS_PartGraphKway);
1046 out4vtk.OutputCELL_DATA_SCALARS(file,
"PARTIONS", VTK_UNSIGNED_INT,
1047 &metisTest.partitions[0], 1, g2bp, OCP_FALSE,
1048 &metisTest.partitions[metisTest.ng]);
1055 void OCPOutput::InputParam(
const ParamOutput& paramOutput)
1064 workDir = ctrl.workDir;
1065 summary.
Setup(reservoir, ctrl.criticalTime.back());
1066 crtInfo.
Setup(ctrl.criticalTime.back());
1067 out4RPT.Setup(workDir, reservoir);
1068 out4VTK.Setup(workDir, reservoir, ctrl.criticalTime.size());
1073 summary.
SetVal(reservoir, ctrl);
1074 crtInfo.
SetVal(reservoir, ctrl);
1077 void OCPOutput::PrintInfo()
const
1083 void OCPOutput::PrintInfoSched(
const Reservoir& rs,
1087 OCP_DBL days = ctrl.current_time;
1090 if (ctrl.printLevel >= PRINT_MIN) {
1091 cout <<
"Timestep " << setw(6) << left << ctrl.numTstep <<
": " << fixed
1092 << setw(10) << setprecision(3) << right << days <<
" Days"
1093 <<
" Wall time: " << time / 1000 <<
" Sec" << endl;
1100 out4RPT.PrintRPT(workDir, rs, days);
1101 out4VTK.PrintVTK(workDir, rs, days);
1102 outputTime += timer.
Stop() / 1000;
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 OCP_BOOL OPEN
Well type = open.
const USI OIL
Fluid type = oil.
unsigned int OCP_USI
Long unsigned integer.
const USI PROD
Well type = producer.
const USI INJ
Well type = injector.
unsigned int OCP_BOOL
OCP_BOOL in OCP.
OCPOutput class declaration.
#define OCP_WARNING(msg)
Log warning messages.
#define OCP_ABORT(msg)
Abort if critical error happens.
OCP_DBL GetWGIR(const USI &w) const
Return gas injection rate of the wth well.
vector< Well > wells
well set.
OCP_DBL GetWGIT(const USI &w) const
Return total gas injection of the wth well.
OCP_DBL GetWellDG(const USI &w, const USI &p) const
Return the pth dG of 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 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_BOOL DENG
Gas density of grids.
OCP_BOOL PWAT
Water pressure of grids.
OCP_BOOL DENW
Water density of grids.
OCP_BOOL XMF
liquid component mole fractions.
OCP_BOOL SWAT
Water saturation of grids.
OCP_BOOL BWAT
Water reservoir molar densities of grids.
OCP_BOOL PRE
Pressure of grids.
OCP_BOOL BOIL
Oil reservoir molar densities of grids.
OCP_BOOL PCW
capillary pressure: Po - Pw.
OCP_BOOL YMF
gas component mole fractions.
OCP_BOOL VOIL
Oil viscosity of grids.
OCP_BOOL KRG
Gas relative permeability of grids.
OCP_BOOL VWAT
Water viscosity of grids.
OCP_BOOL SOIL
Oil saturation of grids.
OCP_BOOL VGAS
Gas viscosity of grids.
OCP_BOOL SGAS
Gas saturation of grids.
OCP_BOOL KRW
Water relative permeability of grids.
OCP_BOOL DENO
Oil density of grids.
OCP_BOOL PGAS
Gas pressure of grids.
OCP_BOOL KRO
Oil relative permeability of grids.
OCP_BOOL BGAS
Gas reservoir molar densities of grids.
Physical information of each active reservoir bulk.
vector< OCP_DBL > mu
Viscosity of phase: numPhase*numBulk.
vector< OCP_DBL > Pc
Capillary pressure of phase: numPhase*numBulk.
USI numPhase
Number of phase.
vector< OCP_DBL > S
Saturation of phase: numPhase*numBulk.
OCP_BOOL oil
If OCP_TRUE, oil phase could exist.
vector< OCP_DBL > rho
Mass density of phase: numPhase*numBulk.
OCP_DBL GeteVmax() const
Return eVmax.
OCP_BOOL gas
If OCP_TRUE, gas phase could exist.
vector< OCP_DBL > xij
Nij / Nj: numPhase*numCom*numBulk.
vector< OCP_DBL > kr
Relative permeability of phase: numPhase*numBulk.
vector< USI > phase2Index
Location of phase according to its name: numPhase.
OCP_DBL GetSOIL(const OCP_USI &n) const
Return oil saturation of the n-th bulk.
OCP_DBL GetMaxCFL() const
Return maxCFL.
vector< OCP_DBL > xi
Moles density of phase: numPhase*numBulk.
OCP_DBL GetSWAT(const OCP_USI &n) const
Return water saturation of the n-th bulk.
OCP_DBL CalFTR() const
Calculate average Temperature in reservoir.
OCP_DBL GetSGAS(const OCP_USI &n) const
Return gas saturation of the n-th bulk.
OCP_DBL GetdSmax() const
Return dSmax.
OCP_BOOL IfUseEoS() const
Return ifUseEoS.
OCP_BOOL water
If OCP_TRUE, water phase could exist.
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.
vector< OCP_DBL > P
Pressure: numBulk.
USI numCom
Number of component.
void SetVal(const Reservoir &reservoir, const OCPControl &ctrl)
TODO: Add Doxygen.
void PrintFastReview(const string &dir) const
TODO: Add Doxygen.
void Setup(const OCP_DBL &totalTime)
TODO: Add Doxygen.
Get elapsed wall-time in millisecond.
__inline__ double Stop() const
Stop the timer and return duration from start() in ms.
__inline__ void Start()
Start the timer.
vector< OCP_DBL > ky
Absolute permeability in y-direction: numGrid.
vector< OCP_USI > map_Act2All
Mapping from active grid to all grid: activeGridNum.
USI nx
Number of cells in x-direction.
USI numDigutIJK
number of digits of maximum nx,ny,nz
vector< OCP_DBL > depth
Depth of center of grid cells: numGrid.
vector< OCP_DBL > kz
Absolute permeability in z-direction: numGrid.
USI GetNumDigitIJK() const
Return numDigutIJK.
vector< OCP_DBL > dz
Size of cell in z-direction: numGrid.
vector< OCPpolyhedron > polyhedronGrid
Coordinates of grid points.
vector< USI > gridTag
Tag of grid: dead, live(fluid), live(rock)
USI ny
Number of cells in y-direction.
vector< OCP_DBL > dy
Size of cell in y-direction: numGrid.
vector< GB_Pair > map_All2Act
Mapping from grid to active all grid: numGrid.
vector< OCP_DBL > dx
Size of cell in x-direction: numGrid.
OCP_USI numGrid
Number of all cells.
vector< OCP_DBL > kx
Absolute permeability in x-direction: numGrid.
All control parameters except for well controllers.
OCP_DBL GetLastDt() const
Return last time step size.
USI GetLSiterT() const
Return the total number of linear iterations.
OCP_DBL GetCurTime() const
Return the current time.
USI GetNRiterT() const
Return the total number of Newton iterations.
vector< USI > index
Records the index of bulk or well, whose properties will be printed.
void Init(const string &myFile, const string &shortInfo, const string &myCodeWay, const string &girdType, const VTK_USI &nG, const VTK_USI &nW)
create a new file and write basic information
Type_A_o WWIR
Well water injection rate.
Type_B_o SOIL
Oil saturation of bulk.
OCP_BOOL FGIT
Field total gas injection.
Type_A_o WGPR
Well gas production rate.
OCP_BOOL FPR
Field average Pressure.
OCP_BOOL FGPR
Field gas production rate.
Type_A_o DG
Pressure difference between wells and perforations.
Type_A_o WOPT
Well total oil production rate.
OCP_BOOL FTR
Field average Temperature.
Type_A_o WGPT
Well total gas production.
OCP_BOOL FOPT
Field total oil production.
Type_A_o WWPT
Well total water production.
OCP_BOOL FWPT
Field total water production.
Type_B_o BPR
Bulk pressure.
Type_B_o SWAT
Water saturation of bulk.
Type_A_o WOPR
Well oil production rate.
OCP_BOOL FGIR
Field gas injection rate.
OCP_BOOL FGPt
Field total gas production.
Type_A_o WGIR
Well gas injection rate.
Type_B_o SGAS
Gas saturation of bulk.
Type_A_o WGIT
Well total gas injection.
OCP_BOOL FWPR
Field water production rate.
OCP_BOOL FOPR
Field oil production rate.
OCP_BOOL FWIT
Field total water injection.
Type_A_o WBHP
Well pressure.
Type_A_o WWIT
Well total water injection.
Type_A_o WWPR
Well water production rate.
OCP_BOOL FWIR
Field water injection rate.
OutputVTKParam outVTKParam
See OutputVTKParam.
OutputSummary summary
See OutputSummary.
OutputRPTParam outRPTParam
See OutputRPTParam.
Bulk bulk
Active grid info.
AllWells allWells
Wells class info.
The SumItem 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.