Rachel Toor's article "Bad Brain Days" gives just about the right level of encouragement. You should go and read it, but the gist of it is this: keep going, even if you don't think what you're writing is working. Get it done, even if it's making you momentarily miserable.
Like Toor, I've finally figured out that sometimes, writing is not a joyful act and that sometimes it can make you feel as though your brain isn't working. What's been helping?
.. Recognizing that I'm too restless and energetic in the morning to write but that it's important to do something related to writing--reading, making notes, walking around. Once I'm a little tired, my resistance to writing goes down and I get at it.
--The key is to make something related to the project the first thing I do. If I warm up by reading things related to the project, I stay on task. If I check email or news sites at all, that concentration is gone. Those things are a trip wire to web distractions.
.. Counting, timing, goals, and rewards. Right now I'm excited about the work, but that leads to bouncing all around the manuscript, and that means not getting anything down. So I set the pomodoro time, write down the word count, write down a word count goal for the time, and get moving. It sounds mechanical, but there's something inherently gamelike in seeing if you can make or even beat the word count.
.. As Toor would say, keep at it. Or as another person told London Fog, "There will be good years, and there will be bad years, but it is always going to rain."