Ionic diffusion through confined geometries: from Langevin equations to partial differential equations