Computational Fluid Dynamics - Basic (d-2)

1-D viscous, steady Burgers' equation

In this section, exact and numerical solutions of a generalized form of 1-D steady, viscous, Burgers' equation are presented:
\begin{equation} (bu - c) u_x = \nu u_{xx}, \end{equation} where $ b $ and $ c $ are constants, $ \nu $ is kinematic viscosity, and the subscripts denote partial derivatives.

Exact solution

The exact solution of steady Burgers' equation can be presented as:
\begin{equation} u = \frac{c}{b} \left[1-\tanh \frac{c(x - x_0)}{2\nu} \right] \ , \ c^2 + b^2 \neq 0. \end{equation} The equation is solved in an interval of $ [0,1] $, with the following parameters:
\begin{equation} \nu = 0.01 \ , \ b = 1 \ , \ c = 0.5 \ , \ x_0 = 0.5. \end{equation}

Numerical solution

Burgers' equation is to be solved with Dirichlet boundary conditions on $ u $. For discretisation, the three-point centered difference scheme is employed using a uniform grid:
\begin{equation} (u_i - 0.5)\frac{u_{i+1} - u_{i-1}}{2 \Delta x} = \nu \frac{u_{i+1} - 2u_i + u_{i-1}}{\Delta x^2}. \end{equation} Then the equation can be written as:
\begin{equation} F_i = (u_i - 0.5)\frac{u_{i+1} - u_{i-1}}{2 \Delta x} - \nu \frac{u_{i+1} - 2u_i + u_{i-1}}{\Delta x^2} = 0. \end{equation} The boundary values of $ u $ are taken from the exact solution described above and the system of equations is solved using Newton's method. In order to solve the system of equations using Newton's method, the following equation should be iteratively solved:
\begin{equation} \Delta \boldsymbol{u}^{k+1} = \boldsymbol{u}^{k+1} - \boldsymbol{u}^k = - \boldsymbol{J}^{-1}(u^k) \boldsymbol{F}(u^k), \end{equation} where $ \boldsymbol{u}^k $ is the vector of solutions at $ k $-th iteration, $ \boldsymbol{F} $ contains all $ F_i $ values, and $ \boldsymbol{J} $ is the Jacobian matrix.

The numerical results together with the respective exact solution is plotted in Fig. d.4.

Fig. d.4: Exact vs. numerical solution for 1-D steady Burgers' equation.

Convergence: Newton's method vs. numerical solution

It is a common mistake to mix up the convergence rate of Newton's method and the convergence of the numerical solution to the exact solution. When the Newton's method iteration converges (e.g. with the convergence rate of $ 10^{-8} $), it does not mean that the numerical solution error converges with the same rate. The numerical solution convergence also depends on the grid size. This is illustrated in Fig. d.5. It is clear that the Newton's method (red curve) converges steadily to the defined convergence criteria ($ 10^{-8} $), but the numerical solution convergence (blue curve) saturates to a much larger error value ($ 6 \times 10^{-3} $) for grid size of $ 100 $.

Fig. d.5: Newton's method vs. numerical solution convergence.

The relevant Matlab codes can be downloaded using the following link:
Matlab Codes Bank

Back to 1-D non-linear partial differential equations

No comments:

Post a Comment