Self-flagellation has a long religious history, but it’s rare to see it depicted in art in a sensual way. Rare, but by no means unheard of:
Click the pic for a larger, uncropped view. From here, accompanied by this bibliographical note that tells me very little:
de Voisenon, Abate. Los ejercicios de una devota. La novela pasional, n.15, Seville: Editorial Renacimiento, 1924/1999.