# How to solve advection equation using semi-lagrangian method?

I am working on something that involves solving an advection equation $\partial{x}/\partial{t}+\vec{u}\cdot\nabla{x}=0$ in 3D. I discretized the space into 3d cartesian grid and used the Semi-Lagrangian method to solve the equation.

By 'Semi-Lagrangian method' I mean the method that Jos Stam proposed in his paper 'Stable Fluids'(People in the computer graphics community might be familiar with him). The method states that to get the new value of $x$ at current position, we trace back in time and use the value of $x$ at the 'traced-back' position. It is based on 'the method of characteristic'.

Imagine I am advecting some objects with a velocity field and $x$ is some attribute of the objects. I update $x$ according to the advection equation.

I have one question: What if I get the value of $x$ outside the boundary of the object while tracing back? I can't use this value to update the value of $x$ inside the object since it's undefined. Is there any method to solve this problem?

-
Welcome to SciComp. What you need is called a boundary condition. – David Ketcheson Sep 19 '12 at 13:43
There is no method to solve a problem that is not fully defined! You have to provide initial and boundary conditions. – Stefano M Sep 19 '12 at 15:12