I went through that a while ago and it was torture, like a swarm of bees living in my head. Even though I knew I didn't like, trust or respect him, he still lived rent-free in my head. My Alanon sponsor suggested I get busy and physically active. Even ten minutes of fast walking clears the mind beautifully. I saw my mind as a kind of primative computer: garbage in, garbage out, and thought of ways to change the programming. What I also realized was that obsessing about him was a way of hanging on to him, an antidote to the fear that had always been in side.