Thermodynamic aspects in non-ideal metal membranes for hydrogen purification