First-Principles Studies Of Energy-Related Materials