Compliance with imposed hydrogen concentration limits in the lithium loop of DONES requires the installation of an yttrium-based hydrogen trap. To determine an appropriate H-trap design, it is essential to have access to a numerical tool capable of simulating hydrogen transport in the DONES lithium loop connected to an yttrium pebble-bed. In the past, a simplified model was created that allows such calculations when hydrogen concentrations in lithium are low. However, in certain DONES operating phases, the concentration in the lithium is high and in a range where yttrium dihydride (YH2) formation is likely. Due to the anticipated great impact of YH2 formation on the H-trap performance a new model is developed that includes the mechanism of hydride formation. It is based on a mathematical reproduction of complete pressure composition-isotherms of the Li-H and Y-H systems. Thus, the conditions that trigger YH2 formation are determined and the variation of hydrogen solubility in different yttrium hydride phases is deduced. An approximate concentration-dependent relationship of hydrogen diffusivity in yttrium is derived and incorporated into the model. Simulations are performed to analyze the dynamics of the concentration decrease during purification of the lithium circuit prior to the experimental DONES phase by varying design parameters of the trap. It is found that hydride formation greatly increases the hydrogen gettering capacity of the H-trap and limits the maximum concentration in the lithium. Indeed, YH2 formation may be purposefully triggered to exploit its beneficial properties for DONES. The simulations show that the H-trap must be replaced at least every 28 days during the DONES experimental phase to meet tritium limits. This work sets the conditions for the required pebble-bed mass of the H-trap at a given temperature to comply with DONES safety requirements. Finally, the model is validated by an accurate numerical reproduction of experimental results.