I am trying to solve the viscous Burger equation $$ \frac{\partial u}{\partial t} + u\frac{\partial u}{\partial x} = \mu \frac{\partial^2 u}{\partial x^2} $$ with Neumann boundary conditions. I am using the Maccormack predictor-corrector scheme: $$ u_j^\overline{{n+1}} = u_j^n - \frac{\Delta t}{\Delta x}(F_{j+1} - F_j^n) + r(u_{j+1}^n - 2u_{j}^n + u_{j-1}^n )\\ u_j^{n+1} = \frac{1}{2}\Big[ u_j^n + u_j^\overline{{n+1}} - \frac{\Delta t}{\Delta x}(F_{j}^\overline{{n+1}} - F_{j-1}^\overline{{n+1}} ) + r(u_{j+1}^\overline{{n+1}} - 2u_{j}^\overline{{n+1}} + u_{j-1}^\overline{{n+1}} ) \Big] $$ for $F=0.5u^2$. I understand that the diffusive term has been centre-differenced, and I believe I implement the boundary conditions in this term by solving for a ghost node. For example, if 0 is my first real node, I say that the ghost node at $j=-1$ should satisfy $u_{-1}=u_{1}$, and I impose $$ u_0^\overline{{n+1}} = \,... \,+ r(2 u_{1}^n - 2u_{0}^n ). $$ My questions:

  1. Is this correct?
  2. How do I implement the no-flux condition with the forwards (backwards) differenced terms in the predictor (corrector) step?

Simply setting everything involving $F$ to zero doesn't seem to work.


Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.