Remove Dashed Lines Between Records in PRT File Reports

This commit splits the production, injection, and cumulative
*Report_() functions into three logically distinct parts, one for
outputting the report header (begin*Report_()), one for outputting a
single report record (output*ReportRecord_()), and one for ending
the report (end*Report_()).  This simplifies the logic of the
*Record_() member functions since they no longer need to infer the
context which is already available in the caller and can perform a
more narrow task than before.

With this separation we're also able to remove the dashed lines
which would previously separate each report record, thereby creating
PRT file report sheets which have a more expected layout.

Moreover, as an aid to future maintenance, we also factor out common
code for the well and group cases in each *Record_() function.

Finally, fix a unit conversion problem in the report values for
cumulative gas quantities.  The sheet header states that we should
be outputting values in 'MM' prefixed units, but we were only
scaling the gas values by a factor of 1000 instead of 1000*1000.  In
other words, the injection and production gas values in the
cumulative sheet were off by a factor of 1000.
This commit is contained in:
Bård Skaflestad
2023-12-08 13:44:33 +01:00
parent f9a5b1ecdb
commit c03f794f9c
3 changed files with 253 additions and 187 deletions

View File

@@ -99,13 +99,10 @@ BOOST_AUTO_TEST_CASE(Cumulative)
: : : : : MSTB : MSTB : MMSCF : MRB : MSTB : MSTB : MMSCF : MRB :
====================================================================================================================================
: FIELD: : : : 1.0: 2.0: 3.0: 4.0: 5.0: 6.0: 7.0: 8.0:
:--------:-----------:--------:----:-----------:-----------:-----------:-----------:------------:----------:-----------:-----------:
: G1: : : : 9.0: 10.0: 11.0: 12.0: 13.0: 14.0: 15.0: 15.0:
:--------:-----------:--------:----:-----------:-----------:-----------:-----------:------------:----------:-----------:-----------:
: PROD: 10, 10: PROD:ORAT: 16.0: 17.0: 18.0: 19.0: 20.0: 21.0: 22.0: 23.0:
:--------:-----------:--------:----:-----------:-----------:-----------:-----------:------------:----------:-----------:-----------:
: INJ: 1, 1: INJ:GRAT: 24.0: 25.0: 26.0: 27.0: 28.0: 29.0: 30.0: 31.0:
:--------:-----------:--------:----:-----------:-----------:-----------:-----------:------------:----------:-----------:-----------:
:--------:-----------:--------:----:-----------:-----------:-----------:-----------:-----------:-----------:-----------:-----------:
)";
std::stringstream str;
@@ -124,38 +121,42 @@ BOOST_AUTO_TEST_CASE(Cumulative)
Opm::EclipseState eclState(deck);
Opm::SummaryState st;
// Note: Cumulative gas values--e.g., FGPT--multiplied by an additional
// factor of 1000, for a total multiplicative factor of one million, in
// order to produce the expected balance sheet output in MM* units.
constexpr auto fields = std::array {
std::pair{"FOPT", 1.0},
std::pair{"FWPT", 2.0},
std::pair{"FGPT", 3.0},
std::pair{"FGPT", 3.0e3},
std::pair{"FVPT", 4.0},
std::pair{"FOIT", 5.0},
std::pair{"FWIT", 6.0},
std::pair{"FGIT", 7.0},
std::pair{"FGIT", 7.0e3},
std::pair{"FVIT", 8.0},
std::pair{"GOPT:G1", 9.0},
std::pair{"GWPT:G1", 10.0},
std::pair{"GGPT:G1", 11.0},
std::pair{"GGPT:G1", 11.0e3},
std::pair{"GVPT:G1", 12.0},
std::pair{"GOIT:G1", 13.0},
std::pair{"GWIT:G1", 14.0},
std::pair{"GGIT:G1", 15.0},
std::pair{"GGIT:G1", 15.0e3},
std::pair{"GVIT:G1", 15.0},
std::pair{"WOPT:PROD", 16.0},
std::pair{"WWPT:PROD", 17.0},
std::pair{"WGPT:PROD", 18.0},
std::pair{"WGPT:PROD", 18.0e3},
std::pair{"WVPT:PROD", 19.0},
std::pair{"WOIT:PROD", 20.0},
std::pair{"WWIT:PROD", 21.0},
std::pair{"WGIT:PROD", 22.0},
std::pair{"WGIT:PROD", 22.0e3},
std::pair{"WVIT:PROD", 23.0},
std::pair{"WOPT:INJ", 24.0},
std::pair{"WWPT:INJ", 25.0},
std::pair{"WGPT:INJ", 26.0},
std::pair{"WGPT:INJ", 26.0e3},
std::pair{"WVPT:INJ", 27.0},
std::pair{"WOIT:INJ", 28.0},
std::pair{"WWIT:INJ", 29.0},
std::pair{"WGIT:INJ", 30.0},
std::pair{"WGIT:INJ", 30.0e3},
std::pair{"WVIT:INJ", 31.0},
};
for (const auto& p : fields) {
@@ -333,11 +334,9 @@ BOOST_AUTO_TEST_CASE(Injection)
: WELL : LOCATION : CTRL : CTRL : CTRL : OIL : WATER : GAS : FLUID : BHP OR : THP OR :
: NAME : (I,J,K) : MODE : MODE : MODE : RATE : RATE : RATE : RES.VOL. : CON.PR.: BLK.PR.:
: : : OIL : WAT : GAS : STB/DAY : STB/DAY : MSCF/DAY : RB/DAY : PSIA : PSIA :
==============================================================================================================
=============================================================================================================
: FIELD: : : : : 1.0: 2.0: 3.0: 4.0: : :
:--------:-----------:------:------:------:-----------:-----------:-----------:-----------:--------:--------:
: G1: : : : : 5.0: 6.0: 7.0: 8.0: : :
:--------:-----------:------:------:------:-----------:-----------:-----------:-----------:--------:--------:
: INJ: 1, 1: : : GRAT: 9.0: 10.0: 11.0: 12.0: 13.0: 14.0:
:--------:-----------:------:------:------:-----------:-----------:-----------:-----------:--------:--------:
)";
@@ -391,9 +390,7 @@ BOOST_AUTO_TEST_CASE(Production)
: : : : STB/DAY : STB/DAY : MSCF/DAY : RB/DAY : : MSCF/STB : STB/MSCF : PSIA : PSIA :
=================================================================================================================================
: FIELD: : : 1.0: 2.0: 3.0: 4.0: 5.000: 6.00: 0.6667: : :
:--------:-----------:----:-----------:-----------:-----------:-----------:-----------:----------:------------:--------:--------:
: G1: : : 7.0: 8.0: 9.0: 10.0: 11.000: 12.00: 0.8889: : :
:--------:-----------:----:-----------:-----------:-----------:-----------:-----------:----------:------------:--------:--------:
: PROD: 10, 10:ORAT: 13.0: 14.0: 15.0: 16.0: 17.000: 18.00: 0.9333: 19.0: 20.0:
:--------:-----------:----:-----------:-----------:-----------:-----------:-----------:----------:------------:--------:--------:
)";