Synthesis and applications of carbon nanomaterials for energy generation and storage