# discretization of advection diffusion with variable coefficients

I am looking for help to find a somewhat stable FD numerical scheme for the advection diffusion equation posed on a curve $$(x(r),y(r))$$. The equation becomes

$$u_t=\alpha(r) u_r +\beta(r) u_{rr}+f(r,t),$$

where $$\alpha(r)= \phi(r)\phi'(r)+\phi(r)$$, $$\beta(r)=\phi(r)\phi(r)$$, and $$\phi(r)=\frac{1}{\sqrt{x'(r)^2+y'(r)^2}}$$.

I'm specifically trying to use periodic boundary conditions, but any will do. I have tried to use a centered difference discretization combined with a forward Euler, but it is diffusing very quickly. Any advice would be appreciated!

• Forward Euler isn't stable on/near the imaginary axis, so if the problem is advection-dominated you will run into trouble. It's also not very accurate and there's no reason to use it. Use a Runge-Kutta method instead -- basically any method of order 3 or greater will be fine. You could use the classic fourth order method of Kutta if you want to write it yourself, or just use a standard ODE integrator from a library. – David Ketcheson Mar 24 at 18:54
• Just use an implicit ODE integrator for the discretized equation, that would make time integration stable for large time steps, and FD central difference should be fine for the spatial discretization. And if there is excessive numerical diffusion just increase the spatial resolution. – Maxim Umansky Mar 25 at 4:22
• My apologies, could I get a bit of clarification on how to use an ODE solver to solve a PDE? I'm also doing this on a non-uniform mesh, would this create any extra issues? – lrs417 Mar 25 at 13:40
• I'm not sure how to apply RK4 to this discretization. How would i determine k2,k3,k4 in runge kutta when i only know the values at this time step? – lrs417 Mar 25 at 14:48
• @Irs417 It's called the method of lines, en.wikipedia.org/wiki/Method_of_lines. Can be used on a nonuniform mesh just fine, of course there are the usual considerations on the accuracy order. – Maxim Umansky Mar 25 at 23:35