Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Upwinding method for convection terms 2nd order PDE

  1. Apr 20, 2013 #1
    I'm trying to solve the equation

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

    where C and D allow for linearity. I'm using a discontinuous Galerkin method in space and Backward Euler for the time-stepping. I currently have a working code for the equation WITHOUT the convection term:

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

    However, I am unsure of how to properly implement the convection term. I currently have

    \int_{\Omega}\frac{\partial}{\partial x}(Cu)v = -\int_{\Omega}Cu\frac{\partial v}{\partial x} + \{Cu^{up}\}\left[v\right]

    where the { } indicate the average and the [ ] indicate the jump. My professor told me to implement the upwinding method like this:

    if $${C} \ge 0$$
    $$u^{up} = u(x^{-})$$
    $$u^{up} = u(x^{+})$$

    I've implemented this as best as I can but it's already pretty terrible for the case when C = D = 1. I can get better accuracy with the plain old CG method for this case.

    I know no one can help me with the code but is this scheme even correct?
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted