  We review the main aspects of geometrothermodynamics, a formalism that uses
contact geometry and Riemannian geometry to describe the properties of
thermodynamic systems. We show how to handle in a geometric way the invariance
of classical thermodynamics with respect to Legendre transformations, which
means that the properties of the systems do not depend on the choice of the
thermodynamic potential. Moreover, we show that in geometrothermodynamics it is
possible to apply a variational principle to generate thermodynamic fundamental
equations, which can be used in the context of relativistic cosmology to
generate cosmological models. As a particular example, we consider a
fundamental equation that relates the entropy with the internal energy and the
volume of the Universe, and construct cosmological models with arbitrary
parameters, which can be fixed to reproduce the main aspects of the
inflationary era and the standard cosmological paradigm.
