I am looking for an equation for the root mean square displacement for self-diffusion (e.g. of water) with boundaries (e.g. between two impenetrable walls). I am drawing an example below.
illustration diffusion in boundaries
Looking in the direction perpendicular to the walls, for longer times the water molecules would experience more of the boundaries and root mean square displacement would reach a maximum value (the distance between the walls).
The root mean square displacement for the self-diffusion without boundaries in 3D (part b of image) can be calculated by
$$ <x^2>^{1/2} = (6 D \varDelta)^{1/2} $$
where D is the diffusion coefficient and $\varDelta$ the diffusion time. I am looking for an equation which describes the situation illustrated in a and whereby $\varDelta$ goes towards infinity and the root mean square displacement towards the distance between the plates d.
The answer depends on where you start in between the walls. Here is why: if you start close to the middle for short time, mean square displacement (MSD) is close to its value when there is not boundary, but if you start close to the wall, the value is different even at short time, because you can diffuse only in one direction (away from the wall).
To calculate MSD, you can solve the diffusion equation with the boundary. Once you have the probability distribution from the diffusion equation, finding MSD is just a matter of averaging $\Delta x^2$ given the probability density.
To solve for the probability density, we need an initial condition. Here is where the starting position comes into play. If you start with a $\delta$ distribution at the initial position, after time $t$, ignoring the wall, the solution is a Gaussian distribution centered at the initial position with variance proportional to $t$. When there are walls, there is a reflecting boundary condition that can be treated by folding the Gaussian function at the boundaries infinitely many times until all of the tail of the Gaussian is inside the box. Then you add up the contribution of each part of the tail folded in the box at each point to get the probability density at that point.
I suspect that there is a closed form for the sum of the series you get at each point and it is well-known. But if not, practically, for short time, you only need to add up the first few folds before the contribution of the other terms become negligible. For long time, as you noticed, the probability distribution becomes uniform.
Note: the folding method for the probability density is known as method of images for solving diffusion equation, in case you need to look it up.