Been there too with my first ex turd of a *gag* husband. The best thing that helped me when those obsessive thoughts came was to journal. I wrote and wrote, sometimes the same garbage over and over. It helped to purge the ugliness out of my head for a while. Called him every filthy name I could think of on paper as well, stuff I could never even whisper when he was around for fear of retaliation and his ugly rage. That helped a lot.