Thermomechanics of a metal hydride-based hydrogen tank