Thermodynamics of Geothermal Fluids