Thermodynamics: A Riemannian geometric model