PorousFlow's default is to fully upwind the fluid and heat fluxes. When the fluxes get really small, the full upwinding is turned off. Improve this transition from full-to-none.
Rationale for the enhancement or information for reproducing the error
It is necessary to fully upwind fluxes in all but the simplest of scenarios, but around steady state the upwinding leads to poor convergence, as the direction of the flux changes from nonlinear iteration to nonlinear iteration. Therefore i introduced a small parameter, currently set at 1E-8, and when we're "within 1E-8 of steadystate" i turn off upwinding. (For exact details of what this means, see PorousFlowDarcyBase.) This works well in lots of situations. However, the sudden transition from full-to-no upwinding is not very clever, and probably also effects convergence, and the 1E-8 parameter is rather arbitrary. I want to improve this by making the 1E-8 (or its equivalent) a user-defined parameter, and to use a smoother transition.
Off the top of my head, i could use a C1 (or C2?) transition from the upwind mobility at a node, to the minimum mobility in the element. Something like
mobility_of_node_i = mobility_of_node_i if parameter >= 1E-8
or = ((parameter - 1E-9) mobility_of_node_i + (1E-8 - parameter) min_nodal_mobility_in_element)/(1E-8 - 1E-9) if 1E-9 < parameter < 1E-8
or = min_nodal_mobility_in_element if parameter <= 1E-9
where the 1E-8 and 1E-9 are user-defined parameters.
Or perhaps i could do a SUPG-like approach in this close-to-steadystate regime
Or i could use something like Gross L, Poulet T and Sheldon HA (2013) "Conforming finite-element methods for modeling convection in an incompressible rock matrix" Transport in Porous Media 100, pp 225-246, which might be very similar to the idea above.
Fluid-mass conservation is important to consider.
Identified impact
(i.e. Internal object changes, limited interface changes, public API change, or a list of specific applications impacted)
Description of the enhancement or error report
PorousFlow's default is to fully upwind the fluid and heat fluxes. When the fluxes get really small, the full upwinding is turned off. Improve this transition from full-to-none.
Rationale for the enhancement or information for reproducing the error
It is necessary to fully upwind fluxes in all but the simplest of scenarios, but around steady state the upwinding leads to poor convergence, as the direction of the flux changes from nonlinear iteration to nonlinear iteration. Therefore i introduced a small parameter, currently set at 1E-8, and when we're "within 1E-8 of steadystate" i turn off upwinding. (For exact details of what this means, see PorousFlowDarcyBase.) This works well in lots of situations. However, the sudden transition from full-to-no upwinding is not very clever, and probably also effects convergence, and the 1E-8 parameter is rather arbitrary. I want to improve this by making the 1E-8 (or its equivalent) a user-defined parameter, and to use a smoother transition.
Off the top of my head, i could use a C1 (or C2?) transition from the upwind mobility at a node, to the minimum mobility in the element. Something like
mobility_of_node_i = mobility_of_node_i if parameter >= 1E-8 or = ((parameter - 1E-9) mobility_of_node_i + (1E-8 - parameter) min_nodal_mobility_in_element)/(1E-8 - 1E-9) if 1E-9 < parameter < 1E-8 or = min_nodal_mobility_in_element if parameter <= 1E-9
where the 1E-8 and 1E-9 are user-defined parameters.
Or perhaps i could do a SUPG-like approach in this close-to-steadystate regime
Or i could use something like Gross L, Poulet T and Sheldon HA (2013) "Conforming finite-element methods for modeling convection in an incompressible rock matrix" Transport in Porous Media 100, pp 225-246, which might be very similar to the idea above.
Fluid-mass conservation is important to consider.
Identified impact
(i.e. Internal object changes, limited interface changes, public API change, or a list of specific applications impacted)
Better convergence when close to steadystate.
Notifying @cpgr