Relative entropy and applications to the convergence of thermomechanical theories