I had a day recently that all writers dread. It was a day in which I budgeted a lot of time to write, I got up at 5:00 AM for an early start, and then...
Nothing.
By 10:15 AM, I'd spent two hours writing crap, another hour goofing off, and then two more hours getting increasingly frustrated and angry with myself. What a waste of a morning.
There are times when you just have to admit defeat and take a break from your writing. Try and recognize early on in your session whether your time will be spent well or poorly (by the one-hour mark you should know), and if things are going really badly, give yourself permission to quit and do something else.
But be sure to try another writing session later in the day. What's the worst that can happen? The worst that can happen is you'll have another horrible writing session. Don't worry: after this morning's debacle, you'll be quick to recognize another bad session before it engulfs you and you can knock off for the day.
But what if the worst doesn't happen? Some of the most productive writing sessions of my life came unexpectedly after atrocious morning writing sessions. I'd sit down to write later in the day (expecting absolutely nothing of course--that's the secret), and before I knew it I'd spent two or three hours generating really good material.
The writing gods have a rich sense of irony. It never hurts to try and take advantage.