2

I have the following equation:

$$ \frac{\partial u}{\partial t} + \frac{\partial}{\partial x}(Cu) - \frac{\partial}{\partial x}\left(D\frac{\partial u}{\partial x}\right) = f(x,t) $$

And I've written a code that will solve this type of problem using finite elements (discontinuous Galerkin, to be precise) in space and backwards Euler in time.

Now I'm testing my code for $C = 0$ with a non-time dependent solution (i.e. something like $u(x,t) = x^{2}$)...essentially the heat equation in 1D. I can take any time step I want and still have a stable solution in this case (and intuitively, if $u(x,t)$ is not time dependent then I should think that the time step doesn't play a role in the stability of the solution since $u^{(i-1)} = u^{(i)}$ where $i$ is the ith time step $t_{i}$.

Now the oddest thing happens when I add in the convection term with $C = 1$. Immediately, it's obvious that I need to take the time step to be quite small in order to get a stable solution. I don't think this should be happening since there is no time-dependence of the exact solution in this test case.

So I'm just wondering if it's actually expected that the convection term can cause stability issues with the time-stepping, even with Backward Euler where the time step size shouldn't matter for linear problems. If not, then I'll know I've obviously coded something incorrectly. However, since the case with $C = 0$ works fine, I'm inclined to think it might be something other than my code...

Any help would be greatly appreciated

doraemonpaul
  • 16,178
  • 3
  • 31
  • 75
asdfghjkl
  • 1,335

0 Answers0