Harry Potter and the Methods of Rationality is a wonderful piece of Harry Potter fan fiction. It's about 660,000 words (which is almost as long as the first 5 Harry Potter books), and it's available for free in a variety of formats, all of which you can find at hpmor.com.
The basic premise is that Harry's Aunt, Petunia, married an Oxford professor instead of Dursley, and Harry grew up to be a rationalist. In the book, he applies the scientific method to try to better understand magic, and he tries to take human cognitive problems (like the sunk cost fallacy) into account when making decisions.
You shouldn't read this if you haven't already read all of the Harry Potter books. HPMOR both spoils and makes fun of plenty of Harry Potter.
If you have read Harry Potter, though, I highly recommend HPMOR. Frankly, HPMOR makes quite a bit more sense than Harry Potter. It was refreshing to read a well written novel featuring a protagonist that is rational and that has a humanist ethic.