Chemical thermodynamics of materials