Consider the diffusion equation as $$\frac{\partial c}{\partial t} = D\frac{\partial^2c}{\partial x^2}$$ with boundary conditions of
c(x,0) = 0 (x > 0)
c(0,t) = A
c(∞,t) = 0
the Laplace transform leads to
$$c(x,t) = A erfc\Big(\frac{x}{2\sqrt{Dt}}\Big)$$
then, at x=0
$$J_{(x=0)} = D\frac{\partial c(x,t)}{\partial t} = \frac{A\sqrt{D}}{\sqrt{\pi t}}$$
Now, how the solution will be if adding middle boundary conditions for x as
c(0,t) = A
c(x,0) = B (x=0)
c(x,0) = 0 (x >= x1)
A > B
meaning that there is a pre-existing gradient in the domain of (0 < x < x1) where x1 is a given value.
Hint:
For $0\leq x\leq x_1$ ,
Ommit the condition $c(\infty,t)=0$ ,
According to Does solve PDE by combination of variables always cannot find the general solutions?,
$c(x,t)=A+(B-A)\text{erf}\left(\dfrac{x}{2\sqrt{Dt}}\right)$
Hence for $x\geq x_1$ ,
Replace the condition of $c(0,t)=A$ as $c(x_1,t)=A+(B-A)\text{erf}\left(\dfrac{x_1}{2\sqrt{Dt}}\right)$