Skip to content

use analytic weights for cprw by default - except when solvent is enabled#6925

Draft
steink wants to merge 2 commits intoOPM:masterfrom
steink:set-cprw-analytic-weights-default-except-solvent
Draft

use analytic weights for cprw by default - except when solvent is enabled#6925
steink wants to merge 2 commits intoOPM:masterfrom
steink:set-cprw-analytic-weights-default-except-solvent

Conversation

@steink
Copy link
Contributor

@steink steink commented Mar 11, 2026

Redo #6840, but don't allow using analytic weights when solvent is enabled

Analytic weights are computed for oil/water/gas (and no other) and in a case where a well only contains solvent (e.g., injector with solvent-fraction 1), this leads to singular well system

@steink steink added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Mar 11, 2026
@steink
Copy link
Contributor Author

steink commented Mar 11, 2026

jenkins build this failure_report please

@steink
Copy link
Contributor Author

steink commented Mar 11, 2026

After first look:

  • Most substantial failures are due to different time-stepping

  • Something strange with GGPTF output: large negative values for PR in 03_msw_model_1 (not for master). Similar but oppsite situation for 07_base_model_1 (WGPTF) . Likely a bug not related to PR, but will have a look.

@steink steink requested a review from atgeirr March 11, 2026 16:18
Copy link
Member

@atgeirr atgeirr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, one minor change requested.

I have not looked at test failures, since you are already taking a shot at that.

FlowLinearSolverParameters() { reset(); }

void init(bool cprRequestedInDataFile);
void init(bool cprRequestedInDataFile, bool cprwUseAnalyticWeights = true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest not adding the default argument, to avoid mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This init-function is also called from ISTLSolverGPUISTL.hpp and BlackoilModelNldd.hpp. Would you rather prefer that both those also checks for the solvent? I kind of assumed it was not relevant for them, but that's maybe not a valid assumption indefinitely.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This init-function is also called from ISTLSolverGPUISTL.hpp and BlackoilModelNldd.hpp. Would you rather prefer that both those also checks for the solvent? I kind of assumed it was not relevant for them, but that's maybe not a valid assumption indefinitely.

For nldd it is relevant, and longer term also the gpu code. I think it is a good example of why the default argument is dangerous, because even if assumptions about it are correct today they might not be in the future.

@steink steink force-pushed the set-cprw-analytic-weights-default-except-solvent branch from 8bb1283 to 606d0cd Compare March 13, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants