Skip to content

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

Open
@vlipovac

Description

@vlipovac

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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working as expected.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions