# Total variation diminishing

In numerical methods, total variation diminishing (TVD) is a property of certain discretization schemes used to solve hyperbolic partial differential equations. The most notable application of this method is in computational fluid dynamics. The concept of TVD was introduced by Ami Harten.[1]

## Model equation

In systems described by partial differential equations, such as the following hyperbolic advection equation,

$\frac{\part u}{\part t} + a\frac{\part u}{\part x} = 0,$

the total variation (TV) is given by,

$TV = \int \left| \frac{\part u}{\part x} \right| dx ,$

and the total variation for the discrete case is,

$TV = \sum_j \left| u_{j+1} - u_j \right| .$

A numerical method is said to be total variation diminishing (TVD) if,

$TV \left( u^{n+1}\right) \leq TV \left( u^{n}\right) .$

## Characteristics

A system is said to be monotonicity preserving if the following properties are maintained as a function of t:

• No new local extrema can be created within the solution spatial domain,
• The value of a local minimum is non-decreasing, and the value of a local maximum is non-increasing.

Harten 1983 proved the following properties for a numerical scheme,

## Application in CFD

In Computational Fluid Dynamics, TVD scheme is employed to capture sharper shock predictions without any misleading oscillations when variation of field variable “Ø” is discontinuous. To capture the variation fine grids (∆x = very small) are needed and the computation becomes heavy and therefore uneconomic. The use of coarse grids with central difference scheme, upwind scheme, hybrid difference scheme, and power law scheme gives false shock predictions. TVD scheme enables sharper shock predictions on coarse grids saving computation time and as the scheme preserves monotonicity there are no spurious oscillations in the solution.

## Discretisation

Consider the steady state one-dimensional convection diffusion equation,

$\nabla \cdot (\rho \mathbf{u} \phi)\,= \nabla \cdot (\Gamma \nabla \phi)+S_{\phi}\;$

Where, $\rho$ is the density, $\mathbf{u}$ is the velocity vector, $\phi$ is the property being transported, $\Gamma$ is the coefficient of diffusion and $S_{\phi}$ is the source term responsible for generation of the property $\phi$

Making the flux balance of this property about a control volume we get,

$\int_A \mathbf {n} \cdot (\rho\mathbf{u}\phi) \, dA = \int_A \mathbf{n} \cdot (\Gamma \nabla \phi) \, dA+ \int_CV S_\phi \, dV$ $\;$

Here $\mathbf {n}$ is the normal to the surface of control volume.

Ignoring the source term, the equation further reduces to:

$(\rho \mathbf {u} \phi A)_r - (\rho \mathbf {u} \phi A)_l = \left(\Gamma A \frac{\partial \phi}{\partial x}\right)_r-\left(\Gamma A \frac{\partial \phi}{\partial x}\right)_l$
A picture showing the control volume with velocities at the faces,nodes and the distance between them, where 'P' is the node at the center.

Assuming

$\frac{\partial \phi}{\partial x}= \frac{\delta \phi}{\delta x}$ and
$A_r = A_l ; \,$

The equation reduces to

$(\rho \mathbf {u} \phi)_r - (\rho \mathbf {u} \phi)_l \,= \left( \frac{\Gamma}{\delta x} \delta \phi\right)_r - \left( \frac{\Gamma}{\delta x} \delta \phi\right)_l.$

Say,

$F_r=(\rho \mathbf{u})_r ;\text{ and }F_l=(\rho \mathbf{u})_l;$
$D_l = \left(\frac {\Gamma}{\delta x}\right)_l ;\qquad D_r =\left(\frac {\Gamma}{\delta x}\right)_r;$

From the figure:

$\delta \phi _r = \phi_R -\phi_P ;\text{ and }\delta x_r = x_{PR};$
$\delta \phi _l = \phi_P -\phi_L ;\text{ and }\delta x_l = x_{LP};$

The equation becomes, $F_r \phi_r - F_l \phi_l = D_r (\phi _R -\phi _P)-D_l(\phi _P - \phi _L);$

Also the continuity equation has to be satisfied,

$(\rho \mathbf {u})_r -(\rho \mathbf {u})_l\,=0; (OR) F_r-F_l=0; (OR) F_r=F_l=F;$

Assuming diffusivity is a homogeneous property and equal grid spacing we can say

$\Gamma _l=\Gamma _r; \qquad \delta x_{LP}=\delta x_{PR} = \delta x$

we get $D_l=D_r=D$ The equation further reduces to $F(\phi_r-\phi_l)=D(\phi_R-2\phi_P+\phi_L)$ This can be written as $P(\phi_r-\phi_l)=(\phi_R-2\phi_P+\phi_L)$, where P is the Péclet number.

$P=\frac{F}{D}=\frac{\rho \mathbf{u} \delta x}{\Gamma}.$

## TVD scheme

Total variation diminishing scheme[2][3] makes an assumption for the values of $\phi_r$ and $\phi_l$ to be substituted in the discretized equation as follows:

$P \phi_r=\frac{1}{2}(P+|P|)[f_r^+\phi_R+(1-f_r^+)\phi_L]+\frac{1}{2}(P-|P|)[f_r^-\phi_P+(1-f_r^-)\phi_{RR}]$
$P \phi_l=\frac{1}{2}(P+|P|)[f_l^+\phi_P+(1-f_l^+)\phi_{LL}]+\frac{1}{2}(P-|P|)[f_l^-\phi_L+(1-f_l^-)\phi_R]$

Where $P$ is the Peclet number and $f$ is the weighing function to be determined from,

$f=f(\epsilon)=f\frac{\phi_U-\phi_{UU}}{\phi_D-\phi_{UU}}$

where U refers to upstream, UU refers to upstream of U and D refers to downstream.

Note that $f^+$ is the weighing function when the flow is in positive direction i.e., from left to right and $f^-$ is the weighing function when the flow is in the negative direction from right to left. So,

\begin{align} & f_r^+\text{ is a function of }\dfrac{\phi_P-\phi_L}{\phi_R-\phi_L}. \\[10pt] & f_r^-\text{ is a function of }\dfrac{\phi_R-\phi_{RR}}{\phi_P-\phi_{RR}}, \\[10pt] & f_l^+\text{ is a function of }\dfrac{\phi_L-\phi_{LL}}{\phi_P-\phi_{LL}},\text{ and} \\[10pt] & f_l^-\text{ is a function of }\dfrac{\phi_P-\phi_R}{\phi_L-\phi_R} \end{align}

If the flow is in positive direction then, peclet number $P$ is positive and the term $(P-|P|)= 0$, so the function $f^-$ won’t play any role in the assumption of Ør and Øl. Likewise when the flow is in negative direction, $P$ is negative and the term $(P+|P|)= 0$, so the function $f^+$ won’t play any role in the assumption of $\phi_r$ and $\phi_r$.

It therefore takes into account the values of property depending on the direction of flow and using the weighted functions tries to achieve monotonicity in the solution thereby producing results with no spurious shocks.

## Limitations

Monotone schemes are attractive for solving engineering and scientific problems because they do not produce non-physical solutions. Godunov's theorem proves that linear schemes which preserve monotonicity are, at most, only first order accurate. Higher order linear schemes, although more accurate for smooth solutions, are not TVD and tend to introduce spurious oscillations (wiggles) where discontinuities or shocks arise. To overcome these drawbacks, various high-resolution, non-linear techniques have been developed, often using flux/slope limiters.

## References

1. ^ Harten, Ami (1983), "High resolution schemes for hyperbolic conservation laws", J. Comput. Phys. 49: 357–393, Bibcode:1997JCoPh.135..260H, doi:10.1006/jcph.1997.5713
2. ^ Versteeg, H.K.; Malalasekera, W. (2007). An introduction to computational fluid dynamics : the finite volume method (2nd ed.). Harlow: Prentice Hall. ISBN 9780131274983.
3. ^ Blazek, Jiri (2001). Computational fluid dynamics : Principles and Applications (1st ed.). London: Elsevier. ISBN 9780080430096.