I have the following problem in 1-D: \begin{equation} \partial_t u(t,x) = v(x)\partial_x u(t,x) + \kappa(x) \partial_{xx} u(t,x),\,x\in\Omega;\quad \partial_{\nu}u(t,x) = 0, \,x\in\partial\Omega. \end{equation} I use the standard 3-point stencil for $\partial_{xx}$: $\frac{1}{h^2}\begin{bmatrix} 1 & -2 & 1 \end{bmatrix}$, and I would like to use central differences for the first derivative: $\partial_x \approx \frac{1}{2h} \begin{bmatrix} -1 & 0 & 1 \end{bmatrix}$. Let $\Omega = (0,1)$ and $\partial\Omega = \{0,1\}$, then I choose the interior nodes to be $\{1,\ldots,n\}$ and the boundary ones to be $\{0,n+1\}$. I am not sure how I should handle the boundary conditions for the first derivative however. I could for instance discretise the boundary conditions as follows: \begin{align} \partial_{\nu} u_0 &= -\partial_x u_0 \approx\frac{u_{0}-u_1}{h} = 0 \implies u_0 = u_1, \\ \partial_{\nu} u_{n+1} &= \partial_x u_{n+1} \approx \frac{u_{n+1}-u_n}{h} = 0 \implies u_{n+1} = u_n. \end{align} then by substituting in the second derivative and first derivative approximations I get: \begin{align} \partial_{xx}u_1 &\approx \frac{u_0-2u_1+u_2}{h^2} = \frac{-u_1+u_2}{h^2}, \\ \partial_x u_1 &\approx \frac{u_2-u_{0}}{2h}=\frac{u_2-u_1}{2h}, \\ \partial_x u_n &= \frac{u_{n+1}-u_{n-1}}{2h} = \frac{u_{n}-u_{n-1}}{2h}. \end{align} The latter worries me a bit since it looks like a standard forward difference except it is divided by two. Should I instead just use a forward and backward difference there that is not divided by two: \begin{equation} \partial_x u_1 \approx \frac{u_2-u_1}{h}, \quad \partial_x u_n \approx \frac{u_n-u_{n-1}}{h}? \end{equation}
I haven't tackled diffusion-advection problems or used central differences for first derivatives previously, so I am not sure what I should do. I could for instance also use a forward or backward difference for $\partial_x u_i$ instead of a central one, which I guess would make more sense if the process is advection dominated (e.g. if $v\gg\kappa$), but I wanted to try using central differences. I am just not sure what the proper approach is to handle the boundaries.