Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report CNV Violation Pore-Volume Fraction to INFOITER #5302

Merged
merged 1 commit into from May 6, 2024

Conversation

bska
Copy link
Member

@bska bska commented Apr 23, 2024

This commit includes the fraction of pore-volume whose CNV targets are violated as a new per-iteration quantity in the INFOITER file (--output-extra-convergence-info=iteration), with the column header CnvErrPvFrac. We collect the values which are already calculated in

BlackoilModel<>::getReservoirConvergence()

and store these as a pair of numerator and denominator in the ConvergenceReport class. Note that we need both the numerator and the denominator in order to aggregate contributions from multiple ranks.

While here, also make a few more objects 'const' and calculate column widths directly instead of the maximum number of characters in writeConvergenceHeader().

@bska
Copy link
Member Author

bska commented Apr 23, 2024

As an example of the change, here is an excerpt from NORNE_ATW2013.INFOITER before and after this PR:

Current Master Sources

 ReportStep    TimeStep        Time   Iteration      MB_Oil     CNV_Oil    MB_Water   CNV_Water      MB_Gas     CNV_Gas  WellStatus
          0           0  0.0000e+00           0  8.6812e-06  1.2137e-01  7.0255e-09  1.1041e-02  3.2716e-06  1.2271e-01        CONV
          0           0  0.0000e+00           1  3.1930e-06  1.0159e-02  5.1132e-08  1.6903e-02  1.1278e-06  6.1010e-01        CONV
          0           0  0.0000e+00           2  2.5577e-06  1.5817e-03  1.1540e-07  5.3284e-04  1.1792e-06  3.7545e-03        CONV
          0           1  1.0000e+00           0  2.8599e-05  1.1144e-02  1.3639e-07  4.9506e-03  1.1054e-05  1.5034e-02        CONV
          0           1  1.0000e+00           1  2.5662e-06  4.6834e-02  2.9369e-07  7.0983e-03  1.4220e-06  2.8133e+00        CONV
          0           1  1.0000e+00           2  5.3861e-07  2.2467e-02  2.9175e-07  5.2370e-04  1.7157e-07  5.2463e-02        CONV
          0           1  1.0000e+00           3  8.0533e-09  5.9972e-03  9.8634e-08  2.3884e-04  4.4027e-07  3.7778e-02        CONV
          0           1  1.0000e+00           4  1.9335e-07  1.2323e-03  8.9402e-09  1.5618e-04  1.3471e-07  4.5565e-03        CONV
          0           2  4.0000e+00           0  3.4937e-05  2.5046e-02  3.6711e-08  1.7544e-02  1.3224e-05  1.2642e-02        CONV

This PR

   ReportStep      TimeStep          Time  CnvErrPvFrac     Iteration       MB_Oil      CNV_Oil     MB_Water    CNV_Water       MB_Gas      CNV_Gas   WellStatus
            0             0    0.0000e+00    2.9158e-04             0   8.6812e-06   1.2137e-01   7.0255e-09   1.1041e-02   3.2716e-06   1.2271e-01         CONV
            0             0    0.0000e+00    9.3513e-04             1   3.1930e-06   1.0159e-02   5.1132e-08   1.6903e-02   1.1278e-06   6.1010e-01         CONV
            0             0    0.0000e+00    0.0000e+00             2   2.5577e-06   1.5817e-03   1.1540e-07   5.3284e-04   1.1792e-06   3.7545e-03         CONV
            0             1    1.0000e+00    1.4926e-04             0   2.8599e-05   1.1144e-02   1.3639e-07   4.9506e-03   1.1054e-05   1.5034e-02         CONV
            0             1    1.0000e+00    3.3672e-03             1   2.5662e-06   4.6834e-02   2.9369e-07   7.0983e-03   1.4220e-06   2.8133e+00         CONV
            0             1    1.0000e+00    5.7769e-04             2   5.3861e-07   2.2467e-02   2.9175e-07   5.2370e-04   1.7157e-07   5.2463e-02         CONV
            0             1    1.0000e+00    7.0193e-05             3   8.0533e-09   5.9972e-03   9.8634e-08   2.3884e-04   4.4027e-07   3.7778e-02         CONV
            0             1    1.0000e+00    0.0000e+00             4   1.9335e-07   1.2323e-03   8.9402e-09   1.5618e-04   1.3471e-07   4.5565e-03         CONV
            0             2    4.0000e+00    2.1297e-04             0   3.4937e-05   2.5046e-02   3.6711e-08   1.7544e-02   1.3224e-05   1.2642e-02         CONV

@bska
Copy link
Member Author

bska commented Apr 23, 2024

jenkins build this please

@bska
Copy link
Member Author

bska commented Apr 24, 2024

jenkins build this please

@atgeirr
Copy link
Member

atgeirr commented Apr 24, 2024

I think it would be easier for existing scripts etc. if we add the new column at the end instead of the beginning. Otherwise this is fine! Would like to add some more detailed output though: fraction of pore volume with each of {CNV > ToleranceCnvRelaxed, CNV > ToleranceCnv, [possibly more detailed as well to build a histogram]} as well as number of grid cells for each. That can be done in a followup though.

@bska
Copy link
Member Author

bska commented Apr 24, 2024

I think it would be easier for existing scripts etc. if we add the new column at the end instead of the beginning.

Maybe, but in that case I'm inclined to label those scripts "poorly written". I added it here because it's in a simple sequence of columns which will always be present whereas the other columns depend on the active phases and whether or not wells are active in the model.

fraction of pore volume with each of {CNV > ToleranceCnvRelaxed, CNV > ToleranceCnv, [possibly more detailed as well to build a histogram]} as well as number of grid cells for each.

Good idea

That can be done in a followup though.

Sure.

@bska bska marked this pull request as draft April 24, 2024 15:23
@bska bska force-pushed the more-infostep-cnv branch 10 times, most recently from 54de3a0 to 4d646f8 Compare April 29, 2024 14:53
@bska bska force-pushed the more-infostep-cnv branch 6 times, most recently from cdee128 to bb06c55 Compare May 3, 2024 15:57
@bska
Copy link
Member Author

bska commented May 3, 2024

The prerequisite PR #5307 was merged into the master branch. I'm marking this as "ready for review" once again and I'm running a build check.

@bska bska marked this pull request as ready for review May 3, 2024 15:59
@bska
Copy link
Member Author

bska commented May 3, 2024

jenkins build this please

This commit includes the fraction of pore-volume whose CNV targets
are violated as a new per-iteration quantity in the INFOITER file
(--output-extra-convergence-info=iteration), with the column header
"CnvErrPvFrac".  We collect the values which are already calculated
in

    BlackoilModel<>::getReservoirConvergence()

and store these as a pair of numerator and denominator in the
ConvergenceReport class.  Note that we need both the numerator and
the denominator in order to aggregate contributions from multiple
ranks.

While here, also make a few more objects 'const' and calculate
column widths directly instead of the maximum number of characters
in writeConvergenceHeader().
@bska
Copy link
Member Author

bska commented May 6, 2024

jenkins build this please

@atgeirr atgeirr merged commit ae7307d into OPM:master May 6, 2024
1 check passed
@bska bska deleted the more-infostep-cnv branch May 6, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants