# Surface charge boundary conditon for Poisson-Boltzmann solver

I want to set up a surface charge boundary condition for the simulation of semiconductor and electrolyte interface.

The 2D-Poisson example and surface charge boundary condition are shown in following picture.

And then I substitute the 2nd part of LHS with boundary condition.

The final results are shown in figure 3.

After I finished the substitution of boundary condition. The 2nd part of Poisson's equation became a constant value which is the surface charge density divided by y-direction meshing. This result let me feel a little bit strange. The influence of y-direction flux is now disappeared!?

Is this result correct?

If it is not, which kind if boundary condition should I apply for the surface charge simulation?

Your equations look correct except that you dropped a minus sign on $\rho_d$ in the last equations. However the mistake (or misinterpretation) is assuming that the finite difference method (FDM) can represent an ideal surface charge. The difference equations that you gave can not tell the difference if the charge computed by $\nabla^2 \phi$ at a given point is due to surface charges or the charge per unit volume.
$$\rho_{d \, i,j} = \frac{\sigma_{s \, i,j}}{\Delta y} \, \, \, \, \, \textrm{ (at the boundary)}$$