Generalized two-dimensional Lagally theorem with free vortices and its application to fluid–body interaction problems