Mathematical simulation of heat-and-mass transfer processes in “metal hydride-hydrogen-gas impurities” systems