# How to approximate flux (with gradient) when using finite volumes?

In finite volume method one is using cell averages. In nonlinear conservation laws discontinuities can be created in the solution process. How to compute the flux when the flux contains a gradient and the Taylor approximation is not valid due to discontinuities?

-

Non-degenerate diffusion will prevent discontinuities in the true solution, but those may be poorly resolved. I will assume that your question is about how to evaluate diffusive fluxes of the form $f(u,\nabla u,p) = \kappa(u,\nabla u,p)\nabla u$ where $\kappa$ is a $d\times d$ SPD tensor and $p$ represents some spatially distributed parameters that are cell-centered and discontinuous. There are a few approaches.

### Two-point fluxes

Take the centroids $c_0$ and $c_1$ of the two cells and compute $\nabla u\cdot(c_1 - c_0) = u(c_1) - u(c_0)$. If the mesh is orthogonal (with face quadrature point on line segment connecting cell centroids and normal with aligned normal) and the coefficients are constant and isotropic, this is a consistent second order accurate flux (i.e., superconvergent at centroids and face centers). Unfortunately, it loses accuracy and has stability problems on general meshes and for variable coefficients. Two-point fluxes are often used because they are simple and compact, but it is a fragile methodology since the grids regularity and constant coefficient assumptions are so frequently violated.

 +1 For the notes, thanks! :) – tomislav-maric Jan 5 at 21:11 My flux contains also a convective part, but I was interested in how to treat the diffusive part. Thanks for your answer so far. Do you think it's possible to use slope limiters as gradient reconstruction? The idea was arising as I was reading about high-resolution schemes today which instead of using a constant cell value use a linear interpolation which is slope limited to limit oscillations. – delta5 Jan 5 at 21:47 @delta5 Inviscid fluxes are computed using a Riemann solver of some sort. In general, you should not try to use the "same procedure" for the diffusive fluxes. (That is, keep the Riemann solver and the diffusive flux routines separate rather than piling them into one big jumble.) Depending on the form of $\kappa(u, \nabla u, p)$, you may need to use a limited reconstruction when computing $\kappa$ (note that typically there is only one value of $\kappa$ per cell). – Jed Brown Jan 6 at 1:15 So I propose to use a Riemann solver for the convective part and compute the diffusive flux with a two point flux and add those fluxes together? My equations are like that: $\frac{\partial d}{\partial t} = - \nabla \cdot ( \vec e(d) d - f \nabla d)$ – delta5 Jan 6 at 10:42 @delta5 Good, that is the standard approach. If $f$ is variable or tensor-valued, or if your mesh is irregular, you may want to consider replacing the two-point flux with one of the more sophisticated methods I mentioned. – Jed Brown Jan 6 at 16:07