# Full upwinding

This page is part of a set of pages devoted to discussions of numerical stabilization in PorousFlow. See:

Numerical stabilization is necessary in scenarios with nonlinear advection, such as the physics modelled by PorousFlow. One such stabilization is upwinding (Huyakorn and Pinder, 1978; Dalen, 1979; Helmig and Huber, 1998). For multi-phase situations many upwinding schemes can lead to disaster as the algorithm attempts to withdraw fluid from a node where there is no fluid. In situations where one phase disappears, or almost disappears, full upwinding is often advantageous, since it prevents such attempted withdrawls, and hence PorousFlow employs full upwinding by default.

The PorousFlowBasicAdvection kernel implements a very naive non-upwinded version of advection. Its use is not recommended.

Full upwinding is numerically cheap compared with other stabilization schemes, but it suffers from two disadvantages. Firstly, it is not smooth (in contrast to the SUPG upwinding scheme (Brooks and Hughes, 1982; Hughes et al., 1986; Hughes and Mallet, 1986) or the Kuzmin-Turek scheme (Kuzmin and Turek, 2004), for instance), so that close to steady-state where the fluxes are zero, the upwind direction can oscillate, leading to nonconvergence. This is dealt with by placing a cutoff on the upwinding in PorousFlow. Secondly, upwinding is adding numerical diffusion, which can be critical in some simulations: see numerical diffusion for a discussion. PorousFlow also offers the Kuzmin-Turek stabilization scheme for users who are concerned with these disadvantages.

The remainder of this section describes full upwinding for the single-phase unsaturated situation. The multi-phase, multi-component scenario, and the advective term in the heat-flow equation are analogous.

The weak form of the Darcy flux of for a single element is (1)

Here is the test function that we are integrating against, and is the contribution to the residual for this test function. Define

(2) which is traditionally called the mobility.

Upwinding is all a matter of choosing where in the element to evaluate in the above integral. The sophisticated SUPG approach was designed to weight on the upstream side of the element. Consider for a moment taking outside the integral:

(3) is not exactly , but note:

• the original is the mass flux flowing out of node ;

• so is thereby intepreted as a measure of fluid flow out of node .

This leads to the following definition of upwinding: (4)

The nodes for which are called upwind nodes, since fluid is flowing from them to the downwind nodes. This approach was first introduced by Dalen (1979).

The residual at the downwind nodes is determined by conserving mass. Specifically, let (5) Then (6) Then as required by mass conservation within the element (which originates from ).

The fully-upwind method is extremely advantageous to use if fluid saturations ever approach residual saturation (where ) or zero density, for then the mobility is zero and it becomes impossible to withdraw fluid from such a node (in practice this may still happen due to precision loss or other related nasty artefacts).

Prescribed sinks, either from the boundary or from internal objects such as wellbores, are also fully-upwinded in PorousFlow since they also potentially suffer from phase-disappearence problems.

## References

1. A. N. Brooks and T. J. R. Hughes. Streamline upwind/Petrov-Galerkin formulations for convection dominated flows with particular emphasis on the incompressible Navier-Stokes equations. Computer Methods in Aplied Mechanics and Engineering, 32:199–259, 1982.[BibTeX]
2. V. Dalen. Simplified Finite-Element Models for Reservoir Flow Problems. Society of Petroleum Engineers Journal, 19:333–342, 1979. doi:10.2118/7196-PA.[BibTeX]
3. R. Helmig and R. Huber. Comparison of galerkin-type discretization techniques for two-phase flow in heterogeneous porous media. Adv. Water Res., 21:697–711, 1998.[BibTeX]
4. T. J. R. Hughes and M. Mallet. A new finite element formulation for computational fluid dynamics: III. The generalized streamline operator for multidimensional advective-diffusive systems. Computer Methods in Aplied Mechanics and Engineering, 58:305–328, 1986.[BibTeX]
5. T. J. R. Hughes, M. Mallet, and A. Mizukami. A new finite element formulation for computational fluid dynamics: II. Beyond SUPG. Computer Methods in Aplied Mechanics and Engineering, 54:341–355, 1986.[BibTeX]
6. P. S. Huyakorn and G. F. Pinder. A new finite element technique for the solution of two-phase flow through porous media. Adv. Water Res., 1:285–298, 1978.[BibTeX]
7. D. Kuzmin and S. Turek. High-resolution FEM-TVD shcemes based on a fully multidimensional flux limiter. Journal of Computational Physics, 198:131–158, 2004.[BibTeX]