Want to get in the zone? Expertise matters.
TL;DR: Flow comes with mastery. There's no shortcut.
You've been there many times. You fire up your debugger or start your favourite video game and hours fly by. And then you end your day tired but with a deep sense of accomplishment. The flow.
The recent study from Drexel University (see the source below) suggests that the state of flow requires more than just the right mood and a cup of coffee. You have to achieve mastery through extensive practice first. Of course you might want to have that cup of coffee and get into the right mood in order to enter the state of flow, but it won't happen unless you really put your back into practice first.
In my personal experience it only happened (the flow) when I was doing things I love and I've practiced a lot - writing code and debugging it, playing my favorite video games, cooking/baking things I like, riding a motorcycle or a bycicle, and running. What is your experience? Let's discuss in comments.