The thermodynamics of direct air capture of carbon dioxide