opm-simulators icon indicating copy to clipboard operation
opm-simulators copied to clipboard

Simulator Must Detect Incompatible Linear Solver Combinations

Open bska opened this issue 1 year ago • 2 comments

At the time of writing, the simulator will/may crash if the user tries to run a case using the new default settings from PR #5147, especially using the CPRW linear solver. Crashing is not reasonable behaviour and the simulator must be able to detect when the new defaults will/may end up in this situation and issue an appropriate diagnostic.

Possible approaches include

  1. Keep a list of known good combinations (e.g, three-phase black-oil case using CpGrid) and reject all other combinations
  2. Keep a list of known incompatible combinations (e.g., single-phase MICP) and accept all other combinations

The conservative approach is to have a list of known-good combinations.

This issue is a release blocker for the 2024.10 release.

bska avatar Aug 19 '24 14:08 bska

I have looked at behaviour the two known-to-fail-with-cprw testcases MICP.DATA and 2D_POLYMER_INJECTIVITY.DATA, to see where things go wrong.

In the micp case we have two well equations and six reservoir equations. In StandardWellEquations::extractCPRPressureMatrix() this is not handled correctly, as the weights (coming from the reservoir and having size 6) are assumed implicitly to have a size equal to the number of well equations minus 1. See lines 370-374. So we are reading from indices (up to 5) outside the bounds of a smaller matrix (the 2x2 D matrix).

In the polymer injectivity case the effect is the opposite: we have a 23x23 D matrix, and we only read the top left elements of it, not taking most of it into account.

I am not sure how easy this is to fix, or where it should be fixed (the BlackOilMICPModule class, or in StandardWellEquations), @hnil what do you think?

If it is a difficult task, I propose we go with issuing error messages for known bad combinations.

atgeirr avatar Aug 22 '24 12:08 atgeirr

If [fixing the problem] is a difficult task, I propose we go with issuing error messages for known bad combinations.

To be honest I think I'd prefer a list of "known good" combinations for the 2024.10 release and then possibly a list of "known incompatible" combinations for the 2025.04 release.

bska avatar Aug 22 '24 13:08 bska

Release is out and we have a solution for this in place. Closing the issue as resolved.

bska avatar Nov 20 '24 13:11 bska