I'm studying mathematical physics and working on numerical solutions of partial differential equations. I am having trouble understanding the way we solve partial dif. equations, e.g.,
$\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2}+\frac{2}{x}.\frac{\partial u}{\partial x}$
$\frac{\partial u}{\partial t}=\frac{\partial^2 u}{\partial x^2} \dots$
I mean for first and second order partial derivatives we use backward, forward or central difference formulas. In some solutions for a partial derivative like $\frac{\partial u}{\partial x}$ it is written by using forward difference and sometimes by using central difference formula. How do we decide which formula we should use? Do we decide by looking at the boundary conditions, e.g, Dirichlet, Neumann,$\dots$? Finally, I try to solve problems with $0$ intuiton, can you enlighten me about what and how we do, please?
The advection term, $\frac{\partial u}{\partial x}$ is always tricky part to solve PDE in a numerical way. It has a certain direction as you said.
There are many techniques to treat this term. Instead of explaining all things, I give you a link that has good notation and explanation.
Randall's lecture note in UW
Look Chapter 13: Advection equation!