Description
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:
SinglePhaseSolutionStrategy.before_nonlinear_iteration
a. Updates stored flux values <---
b. Super call to base SolutionStrategySolutionStrategy.before_nonlinear_iteration
a. Callsset_discretization_parameters
SinglePhaseSolutionStrategy.set_discretization_parameters
a. Updates stored permeabilities in aSecondOrderTensor
<---- Back to
SolutionStrategy.before_nonlinear_iterationan
a. Calls rediscretize (which rediscretizes Upwinding fromSinglePhaseFlowSolutionStrategy
)
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 .