# Analytical solution for convection diffusion equation

Convection-diffusion equation is:

$$\frac{\partial u}{\partial t} + \frac{\partial u}{\partial x} = 0.01\frac{\partial^2 u}{\partial x^2}$$

Inital conditon is:

$$u(x,0) = sin(x)$$ over the domain 0 to $$2\pi$$ with periodic boundary conditon that is $$u(0,t) =u(2\pi,t)$$.

Second boundary condition is clamped at $$x = 0$$ that is $$\frac{du}{dx} = 0$$

I would like to know

1) Whether this problem has an exact solution? if so please prove the solution.

2) Can any symbolic computing software like Maple, Mathematica, Matlab can solve this problem analytically?

3) Please provide some good tutorial (external links) for finding the analytical solution of the advection-diffusion equation.

Please don't provide a numerical solution because this problem is a toy problem in numerical methods.

• Note, if $u$ solves the above convection-diffusion then $h(x, t)=u(x+t, t)$ solves \begin{align} \partial_t h =\partial_t u + \partial_x u= .01 \partial_{xx} u = .01\partial_{xx}h. \end{align} Hence $h$ solves the heat equation. – Jacky Chong Jan 3 at 7:14
• $u(x,t) = exp(-\nu t)sin(x-ct)$. Is this the solution to this equation? I found "some" match with the numerical solution but not satisfied. I think I made some mistake. Solution following the physics but I'm not sure whether it is correct or not – Arun Govind Neelan A Jan 3 at 7:29
• In addition to that grid refinement study shows a good match with analytical and numerical result. Could you tell me any way to cross check it? The solution basis is good but I don't know the impact of the boundary condition on the solution and how to cross check it. – Arun Govind Neelan A Jan 3 at 7:43

Let's rewrite

$$2ku_t = u_{xx} - 2ku_x$$

where $$k=50$$. Separation of variables $$u(x,t) = X(x)T(t)$$ gives

$$2k\frac{T'}{T} = \frac{X''-2kX}{X} = -\lambda$$

The $$X$$ part has the characteristic polynomial

$$r^2 - 2kr + \lambda = 0$$

or $$r = k \pm \sqrt{k^2-\lambda}$$

Due to the periodicity, we need the roots to have an imaginary part, therefore $$k^2-\lambda = -\mu^2$$, or $$\lambda = \mu^2+k^2$$. This makes

$$X(x) = e^{kx}\big[A\sin(\mu x) + B\cos(\mu x) \big]$$

The periodicity condition $$X(x) = X(x+2\pi)$$ requires $$\mu = n$$ where $$n=1,2,3$$.

The other boundary condition is $$X'(0)=0$$. Solving this gives $$\mu A + kB = 0$$, we can write

$$X_n(x) = e^{kx}\big[k\sin(nx) - n\cos(nx)\big]$$

up to a multiplicative constant.

Solving for $$T(t)$$ and using superposition, we have the general solution

$$u(x,t) = \sum_{n=1}^\infty c_n e^{-\frac{n^2+k^2}{2k}t}e^{kx}\big[k\sin(nx) - n\cos(nx)\big]$$

The initial condition is equivalent to solving for $$c_n$$ such that

$$\sum_{n=1}^\infty c_n\big[k\sin(nx) - n\cos(nx)\big] = e^{-kx}\sin x$$

Using orthogonality, we have

$$c_n = \frac{\int_0^{2\pi} e^{-kx}\sin x \big[k\sin(nx) - n\cos(nx)\big] dx}{\int_0^{2\pi} \big[k\sin(nx) - n\cos(nx)\big]^2 dx}$$

• Sorry for the late response. I think the solution may not a good one. When I was plotting the result, I can't see any advection (travelling wave) in the solution. Based on the physics $sin(x)$ should move from one end to other and diffuse over the time. – Arun Govind Neelan A Jan 4 at 11:51
• I have learnt solving advection and diffusion equation in engineering maths book, I havn't learn solving advection-diffusion equation. Could you refer some text book for that? – Arun Govind Neelan A Jan 4 at 11:54
• Could you tell $u(x,t) =exp(-0.01 t) sin(x-t)$ is the solution for this. I got this solution by combining heat equation and wave equation solution and it is matching with numerical solution. Please note that the problem is little bit ill-posed because of gradient boundary conditon. – Arun Govind Neelan A Jan 4 at 11:59