# Solving the transient advection-diffusion equation analytically

Can the following 1D transient advection diffusion and corresponding initial and boundary conditions:

$$\frac{\partial c}{\partial t} + v\frac{\partial c}{\partial x} - D\frac{\partial^2 c}{\partial x^2} = f \quad\forall x\in(0,1) \\ c(x=0,t) = 0 \\ c(x=1,t) = 0 \\ c(x,t=0) = 0$$ be solved such that we first move the advection and diffusion operators to the RHS, integrate with respect to time, and obtain the following second order ODE: $$c + vt\frac{\partial c}{\partial x} - Dt\frac{\partial^2 c}{\partial x^2} = tf$$ while assuming that $v,\;D,\;and\;f$ are constants (i.e., they do not vary spatially or temporally)? Because when I tried this and compared the solution to my SUPG and Operator Splitting formulation (assuming the same $h$-size with backward euler), it seems these numerical discretization approach steady state much quicker than the analytical solution.

For instance, if $h$-size = 1/100, $\Delta t$ = 0.01, $v$ = 1, $D$ = 1/150, and $f$ = 1, SUPG/OS comes close to the steady-state solution at $t$ = 1.0, but for the analytical solution to be close, the value of $t$ needs to be somewhere around 10 to have roughly the same closeness to the steady-state solution.

I want to know if this is an acceptable approach if I want to perform a numerical convergence study comparing SUPG/OS with the analytical solution. I would rather compare the solutions at the exact time levels as opposed to seeing how close they get to the steady-state solution after $T$ amount of time.

• When you time integrate, your spatial derivatives become time-averaged, e.g. $\int_0^tc_{x}=\langle c_x\rangle t$. But in general $\langle c_x\rangle$ will still be a function of time $t$. – GeoMatt22 Nov 4 '15 at 0:30
• Yeah, that analytical approach doesn't make sense. You could (and should) use the method of manufactured solutions. Also, I believe a coordinate transform will reduce advection-diffusion-reaction equations to diffusion-reaction equations when velocity is constant, so in that case, you could compare with suitably transformed analytical solutions for reaction-diffusion equations. – Geoff Oxberry Nov 4 '15 at 1:12
• Okay, thanks for the input guys. I'll just go ahead with method of manufactured solutions – Justin Nov 4 '15 at 18:40