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

Wrong order of routines before nonlinear iteration for Darcy flow #1327

Open
vlipovac opened this issue Feb 10, 2025 · 0 comments
Open

Wrong order of routines before nonlinear iteration for Darcy flow #1327

vlipovac opened this issue Feb 10, 2025 · 0 comments
Labels
bug Something is not working as expected.

Comments

@vlipovac
Copy link
Contributor

In the SinglePhaseFlow setup there is an inconsistency in the order of updated and stored values of discretizations and permeabilities.

Looking at the method before_nonlinear_iteration we have the following order code executed:

  1. SinglePhaseSolutionStrategy.before_nonlinear_iteration
    a. Updates stored flux values <---
    b. Super call to base SolutionStrategy
  2. SolutionStrategy.before_nonlinear_iteration
    a. Calls set_discretization_parameters
  3. SinglePhaseSolutionStrategy.set_discretization_parameters
    a. Updates stored permeabilities in a SecondOrderTensor <---
  4. Back to SolutionStrategy.before_nonlinear_iterationan
    a. Calls rediscretize (which rediscretizes Upwinding from SinglePhaseFlowSolutionStrategy)

The two lines with arrows show that the flux values for Upwinding are evaluated and stored before permabilities are updated.

Now, for setups without non-linearities in the permeability tensor, this does not matter.
But for setups which include advanced mechanical effects, or setups which use a pressure equation with mobility terms in the tensor (frational flow in CF framework), this does matter.

The order of execution needs to be revisited, or possibly some methods need to be split to make a correct order possible given PorePy's mixin approach.

TODO once solved
Adapt SolutionStrategyNonlinearMPFA which was merged in #1236 .

@vlipovac vlipovac added the bug Something is not working as expected. label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected.
Projects
None yet
Development

No branches or pull requests

1 participant