Irreversible thermodynamics in petrology