# Haw to apply central difference to viscous flux in energy equation?

In many modern papers Navier-Stokes equations are solved with finite-difference or finite-volume methods using WENO reconstruction for non-viscous fluxes and central differences for viscous ones. It seems pretty straightforward to apply central difference to "simple" second derivative like $$\frac{\partial^2 u}{\partial x^2}$$, but I can't find detailed examples for more complex ones like $$\frac{\partial}{\partial x} \left( u\frac{\partial u}{\partial x}\right)$$.

Here are some details:

Suppose we solve 1D transient compressible Navier-Stokes equations with constant viscosity and heat conductivity coefficients: $$\frac{\partial U}{\partial t} + \frac{\partial F}{\partial x} = 0; \qquad U = \left( \begin{array} {c} \rho \\ \rho u \\ e \end{array} \right), \;\; F = \left( \begin{array} {c} \rho u \\ \rho u^2 + \sigma \\ (e + \sigma)u - k \frac{\partial T}{\partial x}\end{array} \right)$$ where $$\sigma$$ is viscous stress: $$\sigma = p - \frac{4}{3}\mu \frac{\partial u}{\partial x}$$

1. If we implement explicit Maccormack method according to his 1975 paper, we compute the following predictor and corrector steps: $$U^{(p)}_i = U^n_i - \frac{\Delta t}{\Delta x} \left( F_i - F_{i-1}\right) \\ U^{n+1}_i = \frac{1}{2} \left[ U^n_i + U^{(p)}_i - \frac{\Delta t}{\Delta x} \left( F^{(p)}_{i+1} - F^{(p)}_{i}\right) \right]$$ and $$\frac{\partial u}{\partial x}$$ terms inside $$F$$ and $$F^{(p)}$$ vectors are simply substituted with forward and backward differences: $$\frac{u_{i+1} - u_{i}}{\Delta x},\;\; \frac{u^{(p)}_{i} - u^{(p)}_{i-1}}{\Delta x}$$ for predictor and corrector steps, correspondingly. Choosing difference direction opposite to used in predictor and corrector steps effectively generates 2nd-order central difference analogue. Pretty straightforward and seems to work well in my tests.

2. Suppose now we switch to scheme with WENO flux reconstruction and 2nd or 3rd-order Runge-Kutta time stepping. Then terms like $$\rho u$$, $$\rho u^2 + p$$ and $$(e+p)u$$ in vector $$F$$ may be reconstructed with WENO. Terms like $$\frac{\partial^2 u}{\partial x^2}$$ or $$\frac{\partial^2 T}{\partial x^2}$$ extracted from $$\frac{\partial F}{\partial x}$$ may be approximated with central difference: $$\frac{u_{i+1} - 2u_{i} + u_{i-1}}{\Delta x^2}.$$ and treated as source terms in Runge-Kutta steps.

But what to do with $$\frac{\partial}{\partial x} \left( u\frac{\partial u}{\partial x}\right)$$ term? Should we use something like $$\frac{\frac{u_{i+1} + u_{i}}{2}\frac{u_{i+1} - u_{i}}{\Delta x} - \frac{u_{i} + u_{i-1}}{2}\frac{u_{i} - u_{i-1}}{\Delta x} }{\Delta x}?$$

And what to do if we want to use higher-order central difference?

• The term $\frac{\partial}{\partial x } (u \frac{\partial u}{\partial x } )$ in 1D is just $\frac{1}{2} \frac{\partial^2}{\partial x^2 } u^2$, and using central difference for it should be fine. Oct 14 '20 at 3:36
• @MaximUmansky haven't thought about that, thanks! Oct 14 '20 at 6:08