Thermodynamics and log–contrast analysis in fluid geochemistry