Skip to content

fix: Fix inverse capillary pressure#4027

Open
dkachuma wants to merge 2 commits intodevelopfrom
dkachuma/fix/fix-inverse-cap-pressure
Open

fix: Fix inverse capillary pressure#4027
dkachuma wants to merge 2 commits intodevelopfrom
dkachuma/fix/fix-inverse-cap-pressure

Conversation

@dkachuma
Copy link
Copy Markdown
Contributor

This PR fixes the inverse capillary pressure calculation for 3-phase cases where the oil phase disappears. A correction factor is applied to the Newton step to ensure that we do not evaluate the capillary pressure curves outside their bounds.

@dkachuma dkachuma self-assigned this Apr 10, 2026
@dkachuma dkachuma added type: bug Something isn't working ci: run CUDA builds Allows to triggers (costly) CUDA jobs flag: ready for review ci: run integrated tests Allows to run the integrated tests in GEOS CI ci: run code coverage enables running of the code coverage CI jobs labels Apr 10, 2026
@dkachuma dkachuma requested a review from rrsettgast as a code owner April 10, 2026 23:01
@dkachuma dkachuma requested a review from bd713 April 10, 2026 23:01
Copy link
Copy Markdown
Contributor

@bd713 bd713 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing it. I confirm that the test now passes

Comment on lines +294 to +297
if( phaseStepSize < 1.0 )
{
phaseStepSize *= (1.0 - STEP_TOLERANCE);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So if the phaseStepSize is less than 1.0, you are reducing by a small factor? Can you expand on how this helps?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The phaseStepSize is less than 1 if we don't want to go outside the bounds of the capillary pressure curve. Reducing it further ensures that we are truly away from the boundary. In some cases we were ending up on the boundary itself. If evaluated at the boundary, some of the capillary pressure curves give a zero derivative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: ready for review type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants