# Implementing Robin Boundary condition (finite difference)

I'm interested in applying Robin boundary condition to a convection-diffusion problem in 1D.

In the following system, $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\partial C}{\partial x}$$

$$\frac{\partial C}{\partial t} = \frac{\partial}{\partial x}( D\frac{\partial C}{\partial x} - vC)$$ To implement no-flux boundary condition ,flux $$N = D\frac{\partial C}{\partial x} - vC$$ is set to zero at the left and right boundary.

I'd like to know whether the sign of terms in the flux will vary at the right and left boundary.

According to the following description given in wiki,

Could someone explain if the above-mentioned method is the right way to implement?

I think that the second boundary condition equation is incorrect. The first one should be right for both ends. Following your notation, the flux of mass in the domain should be: $$N = vC - D \frac{\partial C}{\partial x}$$ everywhere including the boundary points.
• The total fiux consists of two fluxes: The first one is advective flux that carries mass by the flow. This can be expressed in $vC$, which means the mass $C$ is transported along the direction of the flow. The second one is dispersive (or diffusive) flux that moves mass from higher concentration area to lower one. The direction of this flux is against the concentration gradient, so $-D \partial C / \partial x$. – KJ N Oct 30 '19 at 4:46