A Lagrangian free-stream boundary condition for weakly compressible smoothed particle hydrodynamics