I am studying a mass transport problem in two layers. (Fig. 1)
The 1st layer is advection-diffusion (AD) layer within [-L1, 0],
dC1/dt = -U1*dC1/dz + D1*d2C1/dz2.
z = -L1, C1(-L1,t) = 1
z = 0, D1*dC1/dz = D2*dC1/dz %mass flux continuity at interface
z = 0, C1(0,t) = C2(0,t)
The 2nd layer is diffusion layer within [0, L2].
dC2/dt = D2*d2C2/dz2
z = L2, D2*dC2/dz + U3*C2 = 0;
C1 is the concentration in the 1st layer and C2 is for the 2nd one.
I have solved the equations and got the analytical solutions by Laplace transformation.
At the same time, I simulated the problem with the code of FD in matlab that I programmed. For the interface, I used this scheme:
D1*( C(i) - C(i-1) ) - D2*( C(i+1) - C(i) ) = 0 % i is Interface node.
* D1 is about 1/1000 D2. !!
I think it should be right, however, there were always the distinct errors near the interface (Fig 2) no matter how I increased the grid and time number with very long simulation time. And the error increased with the value of L1 and L2. Because the problem is the AD layer connected a diffusion layer and D1