Two-dimensional periodic Stokes flow of viscous incompressible fluid in a rectangular cavity with constant velocities applied to the top and bottom walls is considered. The study of chaotic advection regimes is reduced to the sequential solving of two problems. To solve the first problem, the analytical method of superposition, that allows to obtain any desired accuracy of the velocity field, is used. To solve the second problem, which is associated with obtaining the trajectories of individual fluid particles, numerical calculations of the Cauchy problem were performed. An analysis of the boundary conditions accuracy was performed based on the control of local integration. The advection of the selected volume of fluid in the rectangular cavity under the periodic motion of walls for a finite period time based on piecewise spline cubic interpolation is modelled. The obtained numerical results agree with well-known experimental data.