Real-time powder diffraction studies of energy materials under non-equilibrium conditions