First-principles study of thermodynamic properties in thin-film photovoltaics